SImple variable passing Problem..
Posted by: HenryK (---.dsl.bell.ca)
Date: April 05, 2006 09:55PM

Greeting all.. I just installed WAMP5, and when doing some simple tests, observed that for some reason, I was not able to get a variable passed when using the 'SUBMIT' method.. Basically, what should happen is you enter the name, and when you press the 'Submit Data' button, the name appears below. In this case here, nothing gets entered below.. This is what I used as a test to see if it was functioning..

I know it's a simple issue, but I don't believe it's a problem with the code.. Anyone have a suggestion? Perhaps there's a setting that I need to alter? Are there any changes I have to make in the PHP.ini ? I'm really not sure.. Any help would be appreciated!

Here's the code: (there would be HTML tags at the top & bottom, but they don't show up in this posting..)




<FORM>
Enter your name:<BR>
<input TYPE=TEXT NAME=username ><BR>
<input TYPE=SUBMIT VALUE="Submit Data"><BR>
</FORM>

<BR><BR>
You Typed:
<?php
echo($username);
?>



Post Edited (04-05-06 22:15)

Henry

Options: ReplyQuote
Re: SImple variable passing Problem..
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 06, 2006 11:02AM

Change the first line of your form to this:
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">

Change:
echo($username);

to:
echo($_POST['username']);

Options: ReplyQuote
Re: SImple variable passing Problem..
Posted by: cstewart (207.42.135.---)
Date: April 07, 2006 09:08PM

hey man thats you answer here
take care ..............

<form action="" method="post">
Enter your name:<BR>
<input TYPE=TEXT NAME="username" value="username" ><BR>
<input TYPE=SUBMIT VALUE="Submit Data"><BR>
</FORM>

<BR><BR>
You Typed:
<?php
echo($_POST[username]);
?>



bowetech.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.