jonnyfortis Posted June 3, 2013 Share Posted June 3, 2013 (edited) hello, i have a url returned from a payment centre and i need to use the information to make variables out of for example www.website.com/cancel.php?orderID=969¤cy=GBP&amount=0%2E01&PM=&ACCEPTANCE=&STATUS=1&CARDNO=&ED=&CN=&TRXDATE=06%2F03%2F13&PAYID=719527322&NCERROR=&BRAND=&IP=86%2E130%2E167%2E99&SHASIGN=8D01371831130CFADEB12345678911391FD8332D6B so i need the $orderID $currency $amount etc.... how is this done? thanks in advance Edited June 3, 2013 by jonnyfortis Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/ Share on other sites More sharing options...
litebearer Posted June 3, 2013 Share Posted June 3, 2013 hint... $orderID = $_GET['orderID'] and so on Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433793 Share on other sites More sharing options...
DaveyK Posted June 3, 2013 Share Posted June 3, 2013 My first advice would be: try something! Or follow this link RTFM Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433795 Share on other sites More sharing options...
jonnyfortis Posted June 3, 2013 Author Share Posted June 3, 2013 i tried $ORDERID = $GET['orderID']; $AMOUNT = $GET['amount']; this should give me the results order ID: 969' amount?: 0.01 is that correct as when i echo out <?php echo $ORDERID ?> <?php echo $AMOUNT ?> i am not getting a value Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433802 Share on other sites More sharing options...
DaveyK Posted June 3, 2013 Share Posted June 3, 2013 (edited) Do you have error reporting turned on? If not, it would be wise to turn that on. for one, you are missing semi colons. (';') on the echo's and using var_dump() instead of echo is much better in cases like this. Edited June 3, 2013 by DaveyK Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433803 Share on other sites More sharing options...
jonnyfortis Posted June 3, 2013 Author Share Posted June 3, 2013 i added the colons and will try using var_dump() i do not have error reporting turned on. Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433807 Share on other sites More sharing options...
DaveyK Posted June 3, 2013 Share Posted June 3, 2013 (edited) Turn on error reporting. I think its: error_reporting(E_ALL); ini_set("display_errors", 1); Edited June 3, 2013 by DaveyK Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433810 Share on other sites More sharing options...
Jessica Posted June 3, 2013 Share Posted June 3, 2013 OP needs to use parse_url, the entire string is what they have. They are not the file at that URL, their file has received that URL Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433819 Share on other sites More sharing options...
Jessica Posted June 3, 2013 Share Posted June 3, 2013 Do you have error reporting turned on? If not, it would be wise to turn that on. for one, you are missing semi colons. (';') on the echo's and using var_dump() instead of echo is much better in cases like this. While it's a bad idea, it's perfectly valid syntax. <?php echo 'foo' ?> <?php echo 'bar' ?> foobar Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433820 Share on other sites More sharing options...
DaveyK Posted June 3, 2013 Share Posted June 3, 2013 Good catch, I missed that... Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433824 Share on other sites More sharing options...
Solution mac_gyver Posted June 3, 2013 Solution Share Posted June 3, 2013 not sure if the solved state of the thread is from before or after post #4, but it's $_GET not $GET. Quote Link to comment https://forums.phpfreaks.com/topic/278715-get-variable-out-of-a-returned-url/#findComment-1433830 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.