[RESOLVED] 2 Questions (forms and images)
On my website I have a form that lets people type in their username and password and then directs them to the site they want to login to, but I don't know how to make it click the button on the other website, this is what I've done to make it direct to the other site:-
PHP Code:
header("Location:http://www.site.com?$username&$password");
Is it possible to make that click the button? It has no name, the method for the form is POST.
My other question is it possible to show certain images for different type of browsers? Example:
Using Firefox it would show image1 and if I was using any other browser it would use image2?
Re: 2 Questions (forms and images)
What exactly do you mean by "click the button on the other website"?
Why do you need to automate a log in to an external site?
Second question: Yes, look at the user agent header ($_SERVER['USER_AGENT']).
Re: 2 Questions (forms and images)
When people hit submit on my page it would direct them to the original page, this is what I've done:-
Code:
header( 'location:https://thesite.com/login.php?$username&$password&submit' );
Where you see submit is where I thought it would hit the button submit on the external site (works in visual basic).
Re: 2 Questions (forms and images)
you are going to want to get the form action from the form on the site.
Re: 2 Questions (forms and images)
I've done that, when I don't use arrays it works but when I do it doesn't, heres the code:-
Code:
header( 'location:http://thesite.com?username=$username&password=$password&dest=welcome.php' );
It doesn't grab the text from the text boxes so when the user hits login in the address bar it looks like this:-
http://thesite.com?username=$username&password=$password&dest=welcome.php
Is there a way to fix this?
Re: 2 Questions (forms and images)
can you copy/paste the form from the website for me?
Re: 2 Questions (forms and images)
you can't use variables within single quotes. single quoted strings print literal values (basically, it doesn't interpret the scalar ["$"]). use double quotes, or break your string and keep the single quotes.
PHP Code:
header("Location: http://thesite.com/?username={$username}&password={$password}&dest=welcome.php");
//or
header('Location: http://thesite.com/?username=' . $username . '&password=' . $password . '&dest=welcome.php');
Re: [RESOLVED] 2 Questions (forms and images)