October 22nd, 2000, 01:04 AM
I have a page rigged up where someone has to enter a name and password, and then below it some variables that they enter along with it. If it is the correct password and username, I need the data they entered after it to be sent to another file - one that can be automatically updated as it recieves the data. I know this is somewhat vague, but I have limited databasing knowledge... Any help would be greatly appreciated.
October 22nd, 2000, 04:46 AM
Do you already have a way of checking the username and password, or are you asking for that too?
I'm having a hard time understanding exactly what you want...
If you have values submitted to one page, and you want to pass them along to another page, then you either have to put them into the url, or create another form and submit it. Let's say your other variables are $color, $food, and $pet. If you want to make a link that'll carry these variables to another page, you'd use:
echo "<a href="page3.php?color=$color&food=$food&pet=$pet">Click here</a>";
now..if you want it so the user doesn't have to click on anything, then you'd have to do something like this...
<form method="post" action="page3.php" name="form_name">
<input type=hidden name="color" value="<?php echo $color; ?>">
<input type=hidden name="food" value="<?php echo $food; ?>">
<input type=hidden name="pet" value="<?php echo $pet; ?>">
Modify and salt to taste...
Do you really need to send these variable to a third page? why not have everything on the page that checks the username and password? Or maybe i'm way off base already....
[This message has been edited by SepodatiCreations (edited October 22, 2000).]
October 22nd, 2000, 10:09 AM
Thanks... so far.
All right, what you've told me so far is very helpful. I have the username and password fields as well as the 3 data sources (let's use your example $color, $food, and $pet) all on the same page. When they submit the page, the username and password are checked, and then I need the latter 3 ($color, $food, and $pet) to be sent automatically to another page that will be updated - I suppose a database of some sort. And that's all with one command, so if the username password is not correct, nothing is done with the 3 pieces of data.
October 22nd, 2000, 11:42 PM
Why do you have to send them to a third page? You can probably do everything on one page. What are you going to do with these variables once they get to the third page?
October 23rd, 2000, 04:21 PM
What I'm doing is creating tutorials (HTML, Forms, all that good stuff) on my web site. When they click on the link to the tutorial they are prompted to enter their name, and then when they do, they are sent to lesson #1. Then, throughout the tutorial, I refer to them - their name rather - so it's kinda' neat - like it adds personallity to the tutorial. And I need the information that was sent to the first page to be sent to the next ones when they click on the link to go to the next ones.