header("Location: ... does not work correctly
Moderator: General Moderators
header("Location: ... does not work correctly
iii
Last edited by vincent on Sun Sep 10, 2006 12:02 pm, edited 1 time in total.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: header("Location: ... does not work correctly
I'd say using a redirect when you should probably be using cURL or a library like Snoopy to submit the data.vincent wrote:What am I doing wrong?
(#10850)
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Not to mention your use of $_REQUEST instead of $_GET or $_POST coupled with malformed array index names like '$Telephoneb'. Remember that a single quote is a string literal, so the array index in this example:
would actually be $Telephoneb, not what the value of the variable $Telephoneb is expected to be. To use variables properly in your array index assignments, either remove the quotes altogether (recommended) or wrap them in double quotes (acceptable but not recommended).
Code: Select all
$_REQUEST['$Telephoneb']Code: Select all
$_REQUEST[$Telephoneb]
// or
$_REQUEST["$Telephoneb"]- gkwhitworth
- Forum Commoner
- Posts: 85
- Joined: Tue Sep 05, 2006 8:28 pm
- Location: Wasilla, Alaska
It's ok...
In his defense about the quotes...he probably picked it up from a tut or something...I have been doing that until you just mentioned that they don't have to be there. Thanks for that.
--
Greg
--
Greg
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
i have a hunch you are mistaking field names with variables.. try this instead to see if I am right...
Code: Select all
<?php
header("Location: https://www.paypal.com/cgibin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&upload=1¤cy_code=EUR&business=" . $_POST['salesEmail'] . "&item_name=Order&lc=US&country=US&first_name=" . $_POST['First_Nameb'] . "&last_name=" . $_POST['Last_Nameb'] . "&address1=" . $_POST['Billing_Address1'] . "&address2=" . $_POST['Billing_Address2'] . "&zip=" . $_POST['ZIP_Postal_Codeb'] . "&city=" . $_POST['Cityb'] . "&email=" . $_POST['E_mailb'] . "&H_PhoneNumber=" . $_POST['Telephoneb'] . "&login_email=" . $_POST['E_mailb'] . "&amount=" . $_POST['total'] . "&item_number=" . $_POST['order_id'] . "");
?>
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact: