Page 1 of 1

NEED HELP IN PHP PROGRAM FOR MANIPULATING SUBMITTED VALUES

Posted: Sat Feb 28, 2004 4:35 am
by mgrphp
Hay, I am newbie in php program. I have written the following script which
expect to satisfy the manipulating Submitted values in the other script.

It is not passing the submitted values to other script of different page.

Fav.html
----------
<html><head><title>Your Favourates</title></head>
<body>
<form action="fav.php" method="post">
<b>Please Enter Your Name</b>
<input type="text" size="45" name="username"><br>
<input type="submit" value="Submit This Page">
</form>
</body></html>

now in fav.php i have written following script.
Fav.php
-----------

<html><head><title>Your Submission</title></head>
<body>
<?php
echo ("Your Name is $username");
?>
</body></html>

My Current Result is
-----------------------

Your Name is (Blank Display)

Why fav.html is not passing the value of $username to fav.php ?
Please help me....so as i can proceed further.

Posted: Sat Feb 28, 2004 6:35 am
by Pointybeard
Try:

Code: Select all

echo ("Your Name is " . $_POST[username]);

Posted: Sat Feb 28, 2004 6:36 am
by Pointybeard
ALso, so you know, you can just say

Your name is <?= $_POST[username ?>

instead of

<?php
echo ("Your Name is $username");
?>

Posted: Sat Feb 28, 2004 11:24 am
by d3ad1ysp0rk
*cough* lazy *cough*

and actually, you can't.

you can say <?= $_POST['username'] ?> :P

Posted: Sat Feb 28, 2004 5:47 pm
by Pointybeard
woops. Hey, it was late. Leave me alone. *sniff*