Web Hosting Talk







View Full Version : Passing Variables in PHP


tarsius
11-18-2005, 05:23 AM
hi!

I have this code in my membership.php:

<frame src=<?php print("searchresult.php?text1=$_POST[company]"); ?> name="t"></iframe>

For example, $_POST['company'] has a value equal to 'Webhosting Talk'.

The problem is in my searchresult.php. When I have the code:
<?php print("$_GET[text1]"); ?>

it will only print 'Webhosting' and will not include 'Talk'. I think there is a function that will be used before passing the variable. How will I do it?

Thanks.:)

Burhan
11-18-2005, 06:27 AM
You need to urlencode() (http://php.net/urlencode) your values :)

tarsius
11-18-2005, 10:26 AM
thanks very much!:) it's working now!:)