1.

Solve : my 1st PHP prog. fail PLZ help?

Answer»

Hello
I'm beginner to PHP & I just do my 1st test program but when I UPLOAD it to my server, it fail to work correctly as follow

I wrote this script & save it as testbox.html













then write this script & save it as textbox.php

Echo “my PREFFERD food is” . “ “ . $food ;
?>

Then when I call my local host\textbox.html
it work ok & open textbox with default value "orange"
But when I change the default value to any thing & submit it will open the PHP page with blank INSTEAD of writing my submitted word!!!

so whats my FAULT??
Please Help me
with thanksYou need to do a $_GET for the output from the html form.

Code: [Select]<?php
$foodvar = $_GET['food'];
print "my PREFERRED food is $foodvar";
?>
Yes Its working
Thank you very much for your HELPno problem, just let me know if you have any other questions.



Discussion

No Comment Found