PHP doesnt work?
Posted by: wizardsbane (---.hsd1.nj.comcast.net)
Date: December 03, 2006 03:21AM

mY wamp is working perfectly.
both services are running.
when i try to veiw my new document that is a php document, i only see the html in the php document. Why don't i see the php, for backup i copied a code from the book and that still didnt work.

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: yfastud (---.mia.bellsouth.net)
Date: December 03, 2006 03:31AM

how did you run it? w/ your_file.php stores in wamp/www, hope you run it like this

[localhost]

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: wizardsbane (---.hsd1.nj.comcast.net)
Date: December 03, 2006 03:32AM

yes, i put the file in my directory, opened up my localhost and when i ran it everything but the php showed up. it was a pretty simple print script too.



~im a major noob, but am a fast learner.

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: wizardsbane (---.hsd1.nj.comcast.net)
Date: December 03, 2006 03:33AM

am i saving it wrong?
i save it as a text document and its name is test.php



~im a major noob, but am a fast learner.

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: yfastud (---.mia.bellsouth.net)
Date: December 03, 2006 06:53AM

make sure it is test.php not test.php.txt and have to save it in wamp/www, not any other directory and run it like this, just click the link below if you save it in right place

[localhost]

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: Wazzzaaa (---.uname.nl)
Date: December 04, 2006 06:23PM

Hello,

I had the same problem. I think you are using the short opening tag for php <? ?> in stead of <?php ?>

you can use <?php ?> in the code or change the php.ini file.

The php.ini is located in \wamp\Apache2\bin

change the line:
short_open_tag = Off
into:
short_open_tag = On

Options: ReplyQuote
Re: PHP doesnt work?
Posted by: yfastud (---.va-ashburn0.sa.earthlink.net)
Date: December 04, 2006 06:29PM

Instead enable short_open_tag, use standard php tag so your codes can be compatible w/ any server.

Options: ReplyQuote


Sorry, only registered users may post in this forum.