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! Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/ 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. Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448284 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. Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448285 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. Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448287 Share on other sites More sharing options...
PaulRyan Posted September 5, 2013 Share Posted September 5, 2013 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? Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448292 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. Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448323 Share on other sites More sharing options...
eldan88 Posted September 6, 2013 Author Share Posted September 6, 2013 @paulryan. Ill try that tomorrow. Thanks! @cyberoot. Sorry. I thought that it didn't post to the forums. Link to comment https://forums.phpfreaks.com/topic/281883-sending-a-_get-value-with-out-href-links/#findComment-1448394 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.