0

How can I have a form submission open a new website and sign in to that site? I'd like to have a user be able to click a dropdown on a website, then enter their email and password to sign in to a different website, and upon submission, have it open the website with them signed in.

For example, with an email, password, and website like this.

<form method="post" class="signin" action="https://www.walmart.com/account/login?tid=0&returnUrl=%2F">
<input type="hidden" name="form_posted" value="true">
<input type="hidden" name="action" value="true">

<fieldset class="textbox">
    <label class="username">
        <span>Email</span>
        <input id="username" name="username" value="" type="text" autocomplete="on" required>
    </label>

    <label class="password">
        <span>Password</span>
        <input id="password" name="password" value="" type="password" required>
    </label>
</fieldset>

<fieldset class="remb">
    <button class="submit button" type="submit button" value="Log in">Sign in</button>
</fieldset>
</form>

Do I need to have the action="" some php file with a script?

Any ideas would be much appreciated. Thank you in advance for all your help!

*** Note: I know how to have a form open to a new page by adding the attribute target="_blank".

Dev
  • 1
  • 1
  • This sounds a bit sketchy to me. But what you could do, is point the form to the websites action, and use the same form-elements, the page will use that (unless it blocks fromsubmissions from outside domains). – Qirel Mar 29 '17 at 22:21
  • I would take a look at http://php.net/manual/en/book.curl.php As for opening the form in a different window, the question has been answered here: http://stackoverflow.com/questions/356779/how-can-i-open-the-result-of-a-form-submission-in-a-new-window?rq=1 – Tony Mar 29 '17 at 22:21
  • Thank you @Qirel. That makes sense, but I've tried that and it didn't work. I don't think the website blocks form submissions from outside domains, but do you know how I could confirm whether or not it would? – Dev Mar 29 '17 at 22:28
  • Thank you @Tony, I will take a look at that php manual. I do know how to have a form open in a new window, thank you. – Dev Mar 29 '17 at 22:29
  • For one, are you sure the form names are correct? That you have *all* the names correct? It might be looking for a hidden input. – Qirel Mar 29 '17 at 22:36
  • That's a good point @Qirel. I am pretty sure I have the necessary hidden inputs, but I will double check to confirm. – Dev Mar 29 '17 at 22:43

0 Answers0