php in html code
Hey all,
I am a newbie to web serving. Have gotten apache installed, and working. My website is up (currently within my LAN specifically), but i am trying to work with PHP so i can allow visitors to interact with the site, and i can record some data on my server. I am have much trouble getting php working. I have tried simply to put a php script in my html as follows: <?php echo "helllo world"; ?> Nothing. This is embeded in my index.html file which is located in /var/www/html I have tried to installed php on my machine, and I thought i did i right. ANyone know how to check the php installation, and incorrporate it with apache?? I added the line: Loadmodule php4_module modules/libphp4.so even thought $php -v returns PHP 5.0.4 THanks so much!!!! |
ohhh, when i changed the index.html file to index.php, the little php script worked, and the site remained the same. THis is correct?????? Now lets say i want to use forms, how would i included an external php script so i can capture use input in the index.html file???
THanks again, josh |
You will need to use the php extension unless you want to parse all .html files on your site.
If you want to get values that are posted to a php script then use the $_POST["field_name"] variables: http://www.php.net/manual/en/languag...predefined.php |
Hello blizunt7!
Quote:
PHP Code:
|
THANKS!, that helps very much so, one last issue. HOw can I determine where on my server (what directory/file) to store this data in, and can i simply append more data to the end???
JOsh |
You can store data in any file that the webserver has permission to write to.
|
All times are GMT -5. The time now is 09:57 AM. |