Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-10-2012, 07:50 AM   PM User | #1
john6
New Coder

 
Join Date: Sep 2012
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
john6 is an unknown quantity at this point
Question Custom name and value for _POST

If I have a form:
1) How can I choose what value goes in which index of the _POST array on the next screen?
2) How to set my own variables? (incase I need to tell the next screen what I want it to do with the values it gets)

I.e.
form:
Username: ____________
Password: ____________


** Then on the next page **

_POST[0]="MY OWN CUSTOM VARIABLE HERE?" (set in the previous form)
_POST[1]="MY OWN CUSTOM VARIABLE HERE?" (set in the previous form)
_POST[2]=(username)
_POST[3]=(password)
john6 is offline   Reply With Quote
Old 10-10-2012, 09:36 AM   PM User | #2
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
I'm not sure I fully understand.

You want to have a form and then have the PHP take in the information in each field of the form and do something with the info? Am I close?


To submit and collect info you would first make a form.

Code:
<form action="submit.php">
<input type="text" name="user">
<input type="password" name="pass">
<input type="submit" value="submit">
</form>
Then you use PHP to collect the info, and do something with it.

PHP Code:
$username $_POST['user'];
$password $_POST['pass'];

echo 
$username;
echo 
$password
Am I way off from what you want?

Of course there is a lot more too this. You'd want to check if the form actually submitted and several other things.

Last edited by stevenmw; 10-10-2012 at 09:38 AM..
stevenmw is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:48 AM.


Advertisement
Log in to turn off these ads.