Page 1 of 1

New to php and need some help

Posted: Tue May 02, 2006 11:51 am
by mfbrowne
hawleyjr | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello, I am new to php and I am just doing some basic testing to get my feet wet and it seems I am having som troble already.

If I do this in a html document

Code: Select all

<SCRIPT LANGUAGE='PHP'> echo '<p> This is a Test </p>' ; </SCRIPT>
or

Code: Select all

<?php
echo '<p> This is a Test </p>' ;
?>
I would have expected the "This is a Test" to show up on the document. But it does not and I have no idea what to look for on why this would happen.

Can anyone help me in trying to understand why this does not work.

Thanks

Mike


hawleyjr | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]

Posted: Tue May 02, 2006 12:04 pm
by Christopher
Both should work. You also need to make sure the name of the file containing this script ends with a ".php" extension. HTML documents are not parsed by PHP by default in most configurations (though the webserver an be configured to do that) -- only those with the PHP extension.

Posted: Tue May 02, 2006 4:16 pm
by mfbrowne
Well it seems that I can't get this to work in either format. Is there something I should look for that would help me determine why it does not work.

Posted: Tue May 02, 2006 4:32 pm
by mfbrowne
Ok I figured it out, it was just me being rather dumb. Thanks for the help.

Posted: Tue May 02, 2006 6:03 pm
by Ollie Saunders
Oh yeah and btw don't use that one:

Code: Select all

<SCRIPT LANGUAGE='PHP'> echo '<p> This is a Test </p>' ; </SCRIPT>
Its depreciated and not very good anyway.

Posted: Wed May 03, 2006 3:18 am
by php3ch0
Where are you testing your files?