Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   help! (http://www.programmingforums.org/showthread.php?t=13381)

kishou Jun 19th, 2007 1:39 AM

help!
 
ok why can't i see the text???
http://i91.photobucket.com/albums/k2...untitled-8.jpg

grimpirate Jun 19th, 2007 3:50 AM

First off when you save a php file you have to make the extension ".php" not ".html". Secondly, in order to produce output to the browser you have to use the "echo" instruction. So something like "echo $txt;" or "echo $number;" I suggest you read some beginners tutorials or purchase a book on the subject which will be far more productive than just trying to wing it. http://www.w3schools.com has some simple php tutorials.

mrynit Jun 19th, 2007 4:03 AM

here are 13 videos covering many topics in php. watch and learn
http://www.phpvideotutorials.com/

Alexunder Jun 19th, 2007 7:41 AM

Just code:
echo $txt;
or <?=$txt?>

kishou Jun 19th, 2007 2:11 PM

Quote:

Originally Posted by grimpirate (Post 129348)
First off when you save a php file you have to make the extension ".php" not ".html". Secondly, in order to produce output to the browser you have to use the "echo" instruction. So something like "echo $txt;" or "echo $number;" I suggest you read some beginners tutorials or purchase a book on the subject which will be far more productive than just trying to wing it. http://www.w3schools.com has some simple php tutorials.

ok i saved it as a .php file and i still can't see anything. and i got tht code form that website you provided.

Infinite Recursion Jun 19th, 2007 3:20 PM

check the apache error logs...

tail -f /var/log/httpd/error_log

Then run that file in your browser.

(assuming your logs are stored in /var/log/httpd)

tAK Jun 19th, 2007 8:22 PM

And yet no one stated the other obvious.

you cannot just open the .php file in your browser.. you have to install a local webserver, or sign up for a free online host that supports PHP !

The php video tutorials posted earlier have a rough run down in getting XAMPP running for testing on (i think)

ReggaetonKing Jun 19th, 2007 10:45 PM

Download Apache. Read the instruction on how to install it. Then install PHP. Read the instruction on how to install it.

If my instructions confuse you which I will assume. Read this:
http://www.thesitewizard.com/archive/php4install.shtml

Alexunder Jun 20th, 2007 10:07 AM

Oh :) This is how it worx:
User -> Apache -> file -> if php -> php preprocessor -> Apache -> User

So you must setup Apache or other server that worx with php fnd then setup Php. configure it. And only then it will work.

For first time you may use phptriad2.X.X I forget version. Use google to find it.


All times are GMT -5. The time now is 2:29 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC