YoungDuPage Posted March 25, 2008 Share Posted March 25, 2008 im just starting the php tutorial, and i tried the first simple syntax. the ("hello world"). i saved it in my www folder in the appserv file, with the extension .php. when i open the file on firefox it comes up blank?.? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 25, 2008 Share Posted March 25, 2008 Look through the first couple pages of the PHP forum, this question gets asked pretty much every day by people who don't bother to look through the forum first. Link to comment Share on other sites More sharing options...
Cod-nes Posted March 26, 2008 Share Posted March 26, 2008 Try doing it like this:<?phpecho "Hello World!";?>and save it as php Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 thats how it is. but still doesnt show anything in my browser Link to comment Share on other sites More sharing options...
Cod-nes Posted March 26, 2008 Share Posted March 26, 2008 hmmm... does your sever have php enabled? Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 hmm. i thought so. how do i know if it is or not? Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 i figured it out. thanks tho Link to comment Share on other sites More sharing options...
Cod-nes Posted March 26, 2008 Share Posted March 26, 2008 what was the problem? Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 ok. nevermind, i lied. it still doesnt work. do i need html in the page at all? Link to comment Share on other sites More sharing options...
Synook Posted March 26, 2008 Share Posted March 26, 2008 No. While the code generated wouldn't be "correct" as such, you will still see "Hello World" on the page.Do you see [a] nothing, the PHP code, or [c] some weird characters? Also check in the source. Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 i see nothing. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 26, 2008 Share Posted March 26, 2008 How are you accessing the file? Are you double-clicking on it? Do you have a webserver running? If you can telnet to localhost on port 80 then your server is running, if you can't then it isn't. To do that open a command prompt and type "telnet localhost 80". If it times out then you've got a problem. But instead of asking 20 questions, how about you just answer this one: how did you set up PHP? What instructions did you follow? Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 ok, my server is running. for the php - i just installed the appserv, and thought that included and installed php and mysql as it said. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 26, 2008 Share Posted March 26, 2008 It looks like it does. Create a blank file with only this in it:<?php phpinfo();?>Save it in your www directory as phpinfo.php, then open a browser and go to http://localhost/phpinfo.php. Link to comment Share on other sites More sharing options...
YoungDuPage Posted March 26, 2008 Author Share Posted March 26, 2008 ok, that worked! i take its simply using the directory instead of going to the folder and double-clicking then..?. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 26, 2008 Share Posted March 26, 2008 You can't double-click a PHP file to run it, you need to run it through the web server. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.