taith Posted December 19, 2007 Share Posted December 19, 2007 does anyone know a way of php forcing POST data to be passed to the next page, without html output? Quote Link to comment Share on other sites More sharing options...
chigley Posted December 19, 2007 Share Posted December 19, 2007 Do you mean AJAX? Quote Link to comment Share on other sites More sharing options...
Pancake Posted December 19, 2007 Share Posted December 19, 2007 $_SESSION['someSession'] = $_POST['someVal']; And use the $_SESSION['someSession'] on any future page. If you want to get rid of it: unset($_SESSION['someSession']); Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 nope... php... so i can say <?force_post('name','value'); header("Location:;");?> and then on the new page, have $_POST[name]='value'; and no... not sessions... i wanna be able to go cross servers... Quote Link to comment Share on other sites More sharing options...
haku Posted December 19, 2007 Share Posted December 19, 2007 If you want to be able to cross servers (or rather domains), you are probably going to have to use $_GET variables. Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 i know you can $_POST cross servers... its just that i dont think sites (like paypal) would accept $_GET variables... i just trying to find a way to force them onto the next page... Quote Link to comment Share on other sites More sharing options...
chigley Posted December 19, 2007 Share Posted December 19, 2007 cURL? Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 cant use curl on paypal... i know curl can set its own post variables... but you cant say, set variable, and redirect there at the same time... Quote Link to comment Share on other sites More sharing options...
chigley Posted December 19, 2007 Share Posted December 19, 2007 You keep using PayPal as an example.. what are you trying to do? Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 paypal is just one example... i'm trying to shorten down my shopping cart system... so you "view cart" --> "billing info" --> "store billing info & redirect to paypal with form data(they require $_POST information(price, company, etc...))" Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 i found a way around this (multiple form submissions(at the same time)) so this isnt of vital importance... i still would like to know/make an answer for this though :-) Quote Link to comment Share on other sites More sharing options...
craygo Posted December 19, 2007 Share Posted December 19, 2007 you can always have it hidden then use a onclick command to submit it <form name=postform action="http://google.com" method=POST> <input type=hidden value="hello"> </form> <a href="javascript:document.postform.submit()">Hello</a> Ray Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2007 Author Share Posted December 19, 2007 the idea is to have it have a <form> submits to one page, stores the data into the session, and redirects to another page(paypal, etc...), however paypal needs its own $_POST data... if you redirect, it wont carry the first $_POST through to the next... :'( 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.