Results 1 to 8 of 8

Thread: [RESOLVED] 2 Questions (forms and images)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    Resolved [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.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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']).

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    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).

  4. #4
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    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?

  6. #6
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: 2 Questions (forms and images)

    can you copy/paste the form from the website for me?
    My usual boring signature: Something

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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'); 

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    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
  •  



Click Here to Expand Forum to Full Width