eldan88 Posted September 5, 2013 Share Posted September 5, 2013 Hey guys. I am trying to send a $_GET['order_id'] from an order confirmation page, to a different php file in my application. Is there a way I can accomplish this with out links? Thanks! Quote Link to comment Share on other sites More sharing options...
Irate Posted September 5, 2013 Share Posted September 5, 2013 Did a bit of research on Google... try this. <?php ob_start(); include 'filetoinclude.php'; ob_end_clean(); ?> That way, you can prevent the file you're including to output data and still access the script usually. Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted September 5, 2013 Share Posted September 5, 2013 You could use a header? Example: <?PHP $name = 'Peter'; $city = 'Canada'; header('Location: file.php?name='.$name.'&city='.$city.'); exit; ?> That would re-direct you to "file.php?name=Peter&city=Canada". You would need to use the above code BEFORE any output. Quote Link to comment Share on other sites More sharing options...
eldan88 Posted September 5, 2013 Author Share Posted September 5, 2013 You could use a header? Example: <?PHP $name = 'Peter'; $city = 'Canada'; header('Location: file.php?name='.$name.'&city='.$city.'); exit; ?> That would re-direct you to "file.php?name=Peter&city=Canada". You would need to use the above code BEFORE any output. Thanks for that info. But the user will be redirected to a file I don't want them to be redirected to. Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted September 5, 2013 Share Posted September 5, 2013 (edited) The code I gave you is not meant to be put into production, it is an EXAMPLE. Modify it to suit your needs? From your other post I saw "order_confirmation.php" You could use <?PHP $orderID = 12345; header('Location: order_confirmation.php?order_id='.$orderID.''); exit; ?> *Edit - I have a feeling I'm missing something...or just not getting what you've said? Edited September 5, 2013 by PaulRyan Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted September 5, 2013 Share Posted September 5, 2013 Did you see the responses to the same question you asked yesterday? http://forums.phpfreaks.com/topic/281862-passing-a-get-value-with-out-href-links/ If these don't work, it might help if you provide a little more information on what you're trying to accomplish. Quote Link to comment Share on other sites More sharing options...
eldan88 Posted September 6, 2013 Author Share Posted September 6, 2013 (edited) @paulryan. Ill try that tomorrow. Thanks! @cyberoot. Sorry. I thought that it didn't post to the forums. Edited September 6, 2013 by eldan88 Quote Link to comment 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.