Passing Variables to a URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
millsy007
Forum Commoner
Posts: 78
Joined: Wed Jul 02, 2008 7:00 pm

Passing Variables to a URL

Post by millsy007 »

I have some code that I dont exactly undertsand and wanted some help adding to.

I believe this code uses an external link (paypal) and passes additional variables to the URL?

Code: Select all

	// post back to PayPal system to validate	
	$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
	$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
	$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
	$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

	
	// assign posted variables to local variables
	$item_name 			= $_POST['item_name'];
	$item_number 		= $_POST['item_number'];
	$payment_status 	= $_POST['payment_status'];
	$payment_amount 	= $_POST['mc_gross'];
	$payment_currency 	= $_POST['mc_currency'];
	$txn_id 			= $_POST['txn_id'];
	$receiver_email 	= $_POST['receiver_email'];
	$payer_email 		= $_POST['payer_email'];
	$custom 			= $_POST['custom'];
	
	if (!$fp) {
	// HTTP ERROR
	} else {
Could I simply add to the URL by passing in an additional variable?
Post Reply