jerel Posted September 26, 2007 Share Posted September 26, 2007 Hello, My issue is that rather than pass a bunch of variables from one page to the next via a header() command I would like to post them via a form, but automatically submit, all the values will be passed, just an auto submit, the action i guess to just skip hitting the submit button? I know the below are only snippets of code, but i think it better illustrates my point. It's not hard what i'm trying to do, i just don't know how to do it. This would make my life much much easier thanks rather than this page 1 header("Location: http://www.thepage.php?somevars=$vars"); page 2 $_REQUEST["vars"]; I would like to do something like page 1 echo "<form name="form1" method="post" action="page 2"> <input type="hidden" name="vars" value="$vars" > <input type="??????AUTO?????submit" name="Submit" value="Submit"> </form> "; page 2 $_POST["vars"]; Quote Link to comment https://forums.phpfreaks.com/topic/70775-auto-form-submit-via-php/ Share on other sites More sharing options...
rarebit Posted September 26, 2007 Share Posted September 26, 2007 You could even save them in session vars and not even have to send them out and get them back! I'm not really sure what your asking though when it comes to the submit button, why would you make that automatic, when, once filled? If so then you need to use javascript that checks for a completed form whenever a form element loses focus! Quote Link to comment https://forums.phpfreaks.com/topic/70775-auto-form-submit-via-php/#findComment-355852 Share on other sites More sharing options...
jerel Posted September 26, 2007 Author Share Posted September 26, 2007 Hello, with the submit button, it's because i only know how to pass variables a few ways 1 is request 2 is post 3 is write them to a db and pull them as this is all user submitted info to traverse many a database, i now have the project almost completed and as there is no critical info being passed, it isn't a big deal. More than anything i'm problaby just overcomplicating what otherwise is a simple issue. As far as the session thing, i'm not familiar. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/70775-auto-form-submit-via-php/#findComment-356004 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.