Thread: Help needed!

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    4
    Rep Power
    0
    Hi,
    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!

    Richard Underwood
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Gorakhpur,U.P.,India
    Posts
    24
    Rep Power
    0
    Please use encode(realname) in Javascript on the client side and then use rawulrdecode on the server side to retrieve the original string.

    Hope this helps...


    ------------------
    Anish Modi
    Infotech World
    India
  4. #3
  5. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    No need for javascript. Just use the php function urlencode().

    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).]
  6. #4
  7. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    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.

    ------------------
    &frac14;....&frac12;.....&frac34;.....1 __// | | __ ..... &ouml;
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    4
    Rep Power
    0
    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

Similar Threads

  1. sendmail installation problem on Linux
    By abuschr in forum Linux Help
    Replies: 0
    Last Post: January 14th, 2004, 09:08 AM
  2. IMAP Install issue
    By Sillysoft in forum Mail Server Help
    Replies: 5
    Last Post: December 11th, 2003, 01:52 AM
  3. PHP upgrade issues, plz help
    By justinm99 in forum PHP Development
    Replies: 1
    Last Post: October 23rd, 2003, 03:30 PM
  4. mplayer error in RH9
    By iceman1 in forum Linux Help
    Replies: 3
    Last Post: September 7th, 2003, 07:20 PM
  5. Problems installing mod_perl 1.2.7 with perl 5.8.0
    By cptsanity in forum Perl Programming
    Replies: 7
    Last Post: February 20th, 2003, 07:49 AM

IMN logo majestic logo threadwatch logo seochat tools logo