Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Problem passing values between form pages
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 3rd July 19:11
tjesker
External User
 
Posts: 1
Default Problem passing values between form pages


I have one form page that redirects to a second form page after using
Javascript to escape() the values so that multi-word values get passed
to the 2nd form without getting chopped off after the first space.

In the text fields on the second form if I use:

<input type="text" name="First Name" size="30" value=<?php echo
$First; ?>>

this displays:

Billy%20Bob

I need to get rid of the %20 characters and instead see spaces on the
2nd form page, but when I change it to:

<input type="text" name="First Name" size="30" value=<?php echo
htmlspecialchars(urldecode($First)); ?>>

this displays:

Billy

with everything after the first space cut off.

Can anyone tell me how to send text from one form page to another form
page and have all of the text appear on the second page the way it did
on the first?

Thanks

Tom Esker
  Reply With Quote


  sponsored links


2 3rd July 19:11
paul barfoot
External User
 
Posts: 1
Default Problem passing values between form pages


Hi Tom

This caused a bit of head scratching but if you take a look at the HTML you
have generated you should find that the correct value of Billy Bob is being
placed into the value= part of your <input> tag. The problem is that you
haven't put quotes around the value so a browser only sees value=Bob which
is what it displays. This is a problem with your HTML not your PHP! If you
change your first example to:

<input type="text" name="First Name" size="30" value="<?php echo
$First; ?>">

Then everything works OK.

--
Paul Barfoot
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666