March 19th, 2000, 04:04 PM
I am currently making a PHP registration script. The visitors enter their details in a form first through a normal html page, which links to a php confirmation page so they can check what they entered. I then have the following link at the bottom of the page to move on to the next page, which writes the data to a mySQL database.
<A href=http://www.server.com/cgi-bin/customise/newuser.php3?login=$login&password=$password&email=$email&realname=$realname&news1=$news1&news2=$new s2&news3=$news3>
The problem I have is with $realname.
I wanted to use only one field for the person's first and lastname as it isn't very important to me. but only the person's first name is entered into the database when the above link is followed because of the space between their first and last name on the initial form page.
Is there any way I can make the script automatically use both first and last names or should I just use two separate fields for the registrants first and last names?
I hope that makes sense - I know zip about programming terminology
Thanks in advance!
March 19th, 2000, 06:29 PM
Hope this helps...
March 19th, 2000, 07:15 PM
No need to decode in the destination script either... php does that automagically.
[This message has been edited by rod k (edited March 19, 2000).]
March 20th, 2000, 01:11 AM
Rod k is right about urlencode, but really, passing that many variables through HREF is messy anyway; why not just pass the values in hidden form fields and make the hyperlink a submit button? (you can even use an image submit button)
Another way, if you get into slightly more sophisticated PHP programming, is to make all three of your functions happen in the same PHP file, echoing the appropriate HTML as the user passes through the functions.
¼....½.....¾.....1 __// | | __ ..... ö
March 20th, 2000, 10:28 AM
Cheers guys for your help. I'm sure I could use some of the stuff to help me.
and rycamor, thanks for that tip, although I think I'll need a bit more practice with the simple stuff before I do that