PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 19th, 2000, 04:04 PM
vanderlow vanderlow is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 4 vanderlow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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=$news2&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 URL

Thanks in advance!

Richard Underwood

Reply With Quote
  #2  
Old March 19th, 2000, 06:29 PM
amodi amodi is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Gorakhpur,U.P.,India
Posts: 24 amodi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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

Reply With Quote
  #3  
Old March 19th, 2000, 07:15 PM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
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).]

Reply With Quote
  #4  
Old March 20th, 2000, 01:11 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Central Florida, USA
Posts: 2,306 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 6 h 42 m 51 sec
Reputation Power: 60
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 __// | | __ ..... ö

Reply With Quote
  #5  
Old March 20th, 2000, 10:28 AM
vanderlow vanderlow is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 4 vanderlow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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 URL


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Help needed!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap