Jump to content

Recommended Posts

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"];

 

Link to comment
https://forums.phpfreaks.com/topic/70775-auto-form-submit-via-php/
Share on other sites

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!

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.