• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

PHP email string problem

Cheers again. urlencode does ensure sending of the full text but this is a plain text email, so now the customer gets:

1+Plant+Guides+Pack+%26pound%3B11.50+each%2C+total++%26pound%3B11.50+%0D% etc

The way a WP callback normally works is pretty simple, you post a value to Worldpay eg:

<form name="order" action="https://secure.worldpay.com/wcc/purchase" method=post>
<input type="text" name="name">
etc

and then process their callback exactly as if it had been submitted directly from your form eg:

<?php
$name = $_POST['name']

I had no problems at all creating variables with my jscript cart but having trouble doing what appears to be exactly the same darn thing in PHP!

Anyway, its Friday, off to the village club. Ta very much all. You are dismissed for now, will rehire you (for unpaid work experience) on Monday.
 
In the callback, try

PHP:
$description = urldecode($_POST['description']);

(or whatever). Although it seems a bit odd that they send back the URL encoded version, presumably double-encoded if PHP's automatic processing is decoding it to the encoded version :freaky:
 
Hey! urlencode the sent string, urldecode the received string works! Any sane person would imagine the string would end up as it was!

Anyway cheers Nick (again). Definitely going for a drink now.
 

Advertisers

Back
Top