NEED HELP IN PHP PROGRAM FOR MANIPULATING SUBMITTED VALUES

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mgrphp
Forum Newbie
Posts: 2
Joined: Sat Feb 28, 2004 4:35 am
Location: Aurangabad.

NEED HELP IN PHP PROGRAM FOR MANIPULATING SUBMITTED VALUES

Post 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.
User avatar
Pointybeard
Forum Commoner
Posts: 71
Joined: Wed Sep 03, 2003 7:23 pm
Location: Brisbane, AUS
Contact:

Post by Pointybeard »

Try:

Code: Select all

echo ("Your Name is " . $_POST[username]);
User avatar
Pointybeard
Forum Commoner
Posts: 71
Joined: Wed Sep 03, 2003 7:23 pm
Location: Brisbane, AUS
Contact:

Post by Pointybeard »

ALso, so you know, you can just say

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

instead of

<?php
echo ("Your Name is $username");
?>
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

*cough* lazy *cough*

and actually, you can't.

you can say <?= $_POST['username'] ?> :P
User avatar
Pointybeard
Forum Commoner
Posts: 71
Joined: Wed Sep 03, 2003 7:23 pm
Location: Brisbane, AUS
Contact:

Post by Pointybeard »

woops. Hey, it was late. Leave me alone. *sniff*
Post Reply