and then rawurldecode( ) if you need to retrieve info from the URL in the called script.
http://us3.php.net/manual/
Main Topics
Browse All TopicsI have a PHP file that contains hidden form tags:
<input type="hidden" name="toname1" value="<?=$_POST['Name']?>
<input type="hidden" name="tomail1" value="<?=$_POST['tomail1'
Once the form posts, output code is:
file.php?toname1=".$_POST[
Issue: If I put in "Harry" for toname1, the data transfers just fine.
But when I put in "Harry Jones", I just get Harry and lose anything after the space.
????? LOST, HELP!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
and then rawurldecode( ) if you need to retrieve info from the URL in the called script.
http://us3.php.net/manual/
I assume this is a URL that you construct from the user input in the form?
file.php?toname1=".$_POST[
First of all, I would not use $_POST right in the url to start. I'd make variables that I could check, especially since they are user-input.
So my action script for the form would start with
$toname1 = $_POST['toname1'];
$tomail1 = $_POST['tomail1'];
and then I'd do some verification on these variables, depending on what you intend to do with them. Make sure they have no special characters if you will be using them in database queries, etc.
Once you have your variables set, then use THEM in constructing the URL.
$url = rawurlencode("file.php?ton
Then in file.php,
$toname1=rawurldecode($_GE
$tomail1=rawurldecode($_GE
I have not run this code, so I won't swear by correctness, but this is the approach I think you need. The rawurlencode and rawurldecode simply replace and unreplace all special characters with the % equivalents for use in a url.
So your name 'Harry Jones' would be passed on the URL as
file.php?toname1=Harry%20J
Please feel free to ask further if you don't understand.
You shoulodn't urlencode the whole url, just the vars send with it, so instead of using:
$url = rawurlencode("file.php?ton
you should do it like this:
$toname1 = urlencode($_POST['toname1'
$tomail1 = urlencode($_POST['tomail1'
$url = "file.php?toname1=$toname1
Then in file.php,
$toname1=urldecode($_GET['
$tomail1=urldecode($_GET['
Business Accounts
Answer for Membership
by: yodercmPosted on 2007-01-10 at 16:58:15ID: 18289431
You need to use the function rawurlencode( ) on the URL to replace all special characters (such as the space) with their % equivalents.
en/functio n.rawurlen code.php
http://us3.php.net/manual/