For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > July 2004 > Curious problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Curious problem
Kram

2004-07-21, 8:55 am

Hi

i have a script that has data posted to it.

1. if data sent to the script using port 80 all ok
2. if data sent to the script using port 443 it drops 1 value in $_POST

extract of script (not my work but supplied via a user who also uses this
payment system).

// SORT OUT POSTED VARIABLES
foreach($HTTP_POST_VARS AS $key => $value) {
if( @get_magic_quotes_gpc() ) {
$value = stripslashes($value);
}
$values[] = "$key" . "=" . urlencode($value);
}
$workString = @implode("&", $values); // for post back to remote SSL server
via cURL

$transaction_id = $_POST['transaction_id'];
$transaction_date = $_POST['transaction_date'];
$from_email = $_POST['from_email'];
$to_email = $_POST['to_email'];
$order_id = $_POST['order_id'];
$amount = $_POST['amount'];
$security_key = $_POST['security_key'];

extract ends.

Now testing shows $workString contains order_id but when reading $order_id
it is empty! and the only 1 that is!.

A quick fix was to use $HTTP_POST_VARS['order_id'] in place of
$_POST['order_id']

the reason for the local values is to process and write order details to
MySql which i can handle.

Seems odd that only 1 var is lost.

Kram


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com