|
-
May 31st, 2007, 08:35 PM
#1
Thread Starter
Addicted Member
[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?
Last edited by iamme2007; Jun 4th, 2007 at 07:05 PM.
-
Jun 1st, 2007, 01:37 AM
#2
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']).
-
Jun 4th, 2007, 07:08 PM
#3
Thread Starter
Addicted Member
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).
-
Jun 5th, 2007, 05:23 PM
#4
Re: 2 Questions (forms and images)
you are going to want to get the form action from the form on the site.
My usual boring signature: Something
-
Jun 5th, 2007, 07:09 PM
#5
Thread Starter
Addicted Member
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?
-
Jun 5th, 2007, 07:21 PM
#6
Re: 2 Questions (forms and images)
can you copy/paste the form from the website for me?
My usual boring signature: Something
-
Jun 7th, 2007, 04:02 PM
#7
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');
-
Jun 9th, 2007, 02:57 PM
#8
Thread Starter
Addicted Member
Re: [RESOLVED] 2 Questions (forms and images)
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|