Oops, nevermind

Status
Not open for further replies.

I4AT

Platinum Member
Oct 28, 2006
2,631
3
81
I'm learning PHP and just going through some sample scripts given in one of my books. This sample in particular had me create a basic HTML form with a few radio options and a text area, and the script is pretty much just echoing back the chosen option and the text entry.

Anyway, if that's a confusing description I guess it's not that important, but the issue I was having was after hitting the submit button for the form, instead of getting the PHP processed page it was just loading the raw HTML source code.

Turns out the problem was the HTML template I was using, I had 2 lines of code for linking stylesheets in the header but left the path empty cause I don't actually have any stylesheets yet since it's just a template...

Code:
<link rel="stylesheet" type="text/css" href="" />
<link rel="alternate" media="handheld" href="" />

Took me a while to figure out what was going on, but after deleting those two lines the script finally ran as it was supposed to. So my question is, why exactly was this interfering with the script? In an easy for a beginner to follow explanation please. I've read through the book once just to get a general overview of things, and now I'm going back through and actually doing all the examples, but I'm in the very early chapters, so still very much green.

Thanks.

EDIT:
Ok turns out it wasn't the empty stylesheet links after all. Apparently after I deleted those two lines I also happened to open the browser and launch the HTML file from localhost/htmlfilename.html which then allowed the script to run correctly. I guess I can't just doubleclick the HTML file, I have to actually run it through the URL first as I do with a PHP file. That makes more sense.
 
Last edited:
Status
Not open for further replies.