NGR Posted July 17, 2004 Posted July 17, 2004 Hey there guys.... Right, no-one seems to be able to help me but ive managed to figure this out. I need to post the session_id to complete the transaction. Now, can anyone explain this piece of code PPPPLLLLLLEEEEEEEEEEAAAAAASSSSSSEEEEEEE!!!! foreach ($_GET as $key => $val){ print "<input type=\"hidden\" name=\"$key\" value=\"$val\">\n"; } Now, im presuming that its reading the URL and "decoding" it, things is what is it assigning to "key" and what to "val"... and, the problem comes with the oscsid...its sending it back to me under "reference" so would i be able to do something like this? foreach ($_GET as $key => $val){ if ($key = 'reference') { print "<input type=\"hidden\" name=\"osCsid\" value=\"$val\">\n"; } else print "<input type=\"hidden\" name=\"$key\" value=\"$val\">\n"; } That idea isnt working though... Any idea's anyone?? Thanks in advance... Nick :ph34r:
NGR Posted July 17, 2004 Author Posted July 17, 2004 The complete code "JUST IN CASE" <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title></title> <style type="text/css"> body {backgorund-color:#FFFFFF;} body, td, div {font-family: verdana, arial, sans-serif; font-size:14px;} </style> </head> <body onload="document.twocoprocessform.submit()"> <form name="twocoprocessform" method="POST" action="http://www.ngrcomputers.co.za/new/checkout_process.php"> <table cellpadding="0" width="100%" height="100%" cellspacing="0"> <tr> <td align="middle" style="height:100%; vertical-align:middle;"> <?php foreach ($_GET as $key => $val) { if ($key = 'reference') { print "<input type=\"hidden\" name=\"osCsid\" value=\"$val\">\n"; } else print "<input type=\"hidden\" name=\"$key\" value=\"$val\">\n"; } ?> Thank you... redirecting to https://www.ngrcomputers.za.net/new/checkou...gt;<br>If the page fails to redirect click <input type="submit" value="here"> </td> </tr> </table> </form> </body> </html>
♥kymation Posted July 18, 2004 Posted July 18, 2004 $_GET contains the part of the URL after the question mark. It is in the form of an array, which you correctly show as key => value pairs. So, if your URL is http://www.mystore.com/index.php?cPath=25&osCsid=acefdbc82cedfdbbc7ad8314536d2e38 then the first key is cPath and its associated value is 25. The second key is osCsid and its associated value is acefdbc82cedfdbbc7ad8314536d2e38. So to actually answer your question, you can get the osCsid by using $_GET['osCsid'] Regards Jim See my profile for a list of my addons and ways to get support.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.