Click here to Skip to main content
14,243,235 members

Royal PHP rookie question.

Ron Anders asked:

Open original thread
Hello.

This bit of code is to generate a query string from POST items back from PayPal to send to a licensing server but I am getting variable names not variable values.

$CustomerEmail = $_POST['payer_email'];
$CustomerName = $_POST['address_name'];
$OrderRef = $_POST['txn_id'];

fopen('http://192.168.2.2:2112/keygen.php?productid=5&"$CustomerEmail"&"$CustomerName"&quantity="1""&OrderRef"','r');


Results in:

192.168.2.3 - - [24/Jan/2014:10:55:29 -0700] "GET /keygen.php?productid=5&\"$CustomerEmail\"&\"$CustomerName\"&quantity=\"1\"\"&OrderRef\" HTTP/1.0" 200 978 "-" "-"

What I want is:

192.168.2.3 - - [24/Jan/2014:10:55:29 -0700] "GET /keygen.php?productid=5&\buyer@buyer.com&John Doe&quantity="1" 1234567890 HTTP/1.0" 200 978 "-" "-"

The way PHP deals with values of variables vs variable names is throwing this PHP rookie for a loop!

Thanks in advance

:Ron
Tags: PHP

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100