This is part of what I need my url to pass:
//http://test.php?faxnumber%5B%28555%29+2 ... ubmit=Next
However I also need to pass the following:
company=$name&address=$street&city=$city&state=$state&zip=$zip
Is there any way to combine the following so that it passes all variables?
1:
company=$name&address=$street&city=$city&state=$state&zip=$zip
2:
faxnumber%5B%28555%29+222-8900%5D=%28555%29+222-8900&submit=Next\">Add To Favorites</A>");
The following does not work:
//print ("<A HREF=\"$REQUEST_URI?company=$name&address=$street&city=$city&state=$state&zip=$zip \">Add To Favorites</A>");
Any Suggestions?
Passing URL varibles combined using get and/or hyperlinks
Moderator: General Moderators
-
jbstone713
- Forum Newbie
- Posts: 14
- Joined: Wed Mar 02, 2005 10:01 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
rawurlencode() each variable.. then..
Code: Select all
echo '<a href="' . $_SERVERї'PHP_SELF'] . '?company=' . $name . '&address=' . $street .. and so on . 'faxnumber%5B%28555%29+222-8900%5D=%28555%29+222-8900&submit=Next">Add to Favorites</a>';-
jbstone713
- Forum Newbie
- Posts: 14
- Joined: Wed Mar 02, 2005 10:01 pm
rawurlencode() each variable
How do I rawurlencode() each variable when they are in an array? Is there a way to make the checkboxes be on without having to press submit (just check it) Please have a look at my code. I've never used rawurlencode() before. I looked at some examples, but I am still confused.
Code: Select all
print ("<form name=info method=get action=?php_self.php>");
while ($row2 = mysql_fetch_array($result2)){
$contact_first = $row2ї"sales_contact_first_name"];
$contact_last = $row2ї"sales_contact_last_name"];
$contact = "$contact_first $contact_last";
$name = $row2ї"company_name"];
$number = $row2ї"sales_phone_number"];
$street = $row2ї"street_address"];
$city = $row2ї"sales_city"];
$state = $row2ї"sales_state"];
$zip = $row2ї"sales_zip"];
$fax = $row2ї"sales_fax_number"];
$id = $row2ї"user_id"];
$all = "<B>$name</B><BR>Contact: $contact<BR>$street<BR>$city, $state $zip<BR>Phone: $number<BR>Fax: $fax";
////////////////////////////////////////////////////////////////
// Prints out all of the company information, a checkbox, etc.//
print("<input type=checkbox name="faxnumberї$fax]" value="$fax"");
if($faxnumberї$fax] == "$fax"){
print ("checked>");
}
print ("<B>$name</B>");
print ("<BR>");
print ("     $street");
print ("<BR>");
print ("     $city, $state $zip");
print ("<BR>");
print ("     Phone: $number");
print ("<BR>");
print ("     Fax: $fax");
print ("<BR>");
print ("     <A HREF="http://www.mapquest.com/maps/map.adp?searchtype=address&country=US&addtohistory=&searchtab=home&address=$street&city=$city&state=$state&zipcode=$zip" target="_blank">Get Map</A>");
//print ("     <A HREF="$REQUEST_URI">Add To Favorites</A>");
echo '<a href="' . $_SERVERї'PHP_SELF'] . '?company=' . $name . '&address=' . $street .. and so on . 'faxnumber%5B%28555%29+222-8900%5D=%28555%29+222-8900&submit=Next">Add to Favorites</a>';-
jbstone713
- Forum Newbie
- Posts: 14
- Joined: Wed Mar 02, 2005 10:01 pm
Got it!!
Thanks anyway. I got it!