SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there ANY WAY that I can use PHP to automatically fill in a form on another website than my own?

    Currently, the user submits data to me, which is stored in a DB. If they want the data to appear on another site, they must then type it into the other site.

    I was thinking of building a form where the user types the data into it, it runs off and submits it elsewhere and then the confirmation page of the other site pops up.

    Any ideas?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    It doesn't sound possible to me. php is a server side scripting language that operates on pages you serve to your clients. When you become a client of another site, php is not available for you to send pages to that site's server. That is going in the reverse direction.

    Furthermore, it seems to me that php requires a client to trigger something through a link or a submit button to execute a php script. So, let's say you go to another site, and the site displays the form. What would be your trigger to get your php script to start execution and fill in the form?
    Last edited by 7stud; Apr 30, 2001 at 04:35.

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well actually there is a fairly complicated way but it may not always work.
    You need to build a header in PHP that redirects you to the form handler on the other site, sends the variables properly (the same thing that would happen if a form is submitted). But it is pretty complicated and not guaranteed to work (depending on the setup of the otehr site)

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about opening a scoket connection to the server in question and simulating a post to the url in question?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Addict
    Join Date
    Jul 2000
    Location
    North Central AR
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually there is a easy way to do it, well with the help of a class called snoopy:

    http://sourceforge.net/projects/snoopy/

    The class simulates a browser. Among some of it's functions is filling in and submitting forms. So pass your first form's variables to this class, give it a submit URL and your set. It also will give you the results or response from the server you submitted to, with which you can maniplulate however you want.

    It even passes "basic" authorization for the submit pages that may require it. Other authorization, good luck. If you find out, PLEASE let me know.

    ronnie
    The largest selection of PLR Articles on the Planet!
    Many Private Label Rights Products.

  6. #6
    Feel my RewiredMind KMxRetro's Avatar
    Join Date
    Jan 2001
    Location
    Exeter, Devon, UK
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all!

    I'm basically building an auction manager for use with Ebay and I'm trying to code a tool that will submit auctions to Ebay based on our user's preferences/templates/information etc.

    I just tried Snoopy, but although it attempted to submit to Ebay, can pull Ebay's form items etc from Ebay's pages, it will not just jump straight to the "Confirm/Preview" screen on Ebay.co.uk.

    When I try it, it takes me to the "Photo Hosting Preferences" page, which would be defunct in this case as the user would store their images on our server, rather than the incredibly slow and unreliable IPix that Ebay currently uses.

    I think that the "Photo Hosting Preferences" are stored as a cookie. Might have to search around my HDD and see if I can find the variables that switch it off.

    Thanks for the help, gonna try some more tomorrow...must sleep now.......YAWN......

  7. #7
    SitePoint Addict
    Join Date
    Jul 2000
    Location
    North Central AR
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    KM,

    I don't know if this makes a difference, but I use snoppy a little different way. I Get the form elements ahead of time, instead of pulling them from the site. For each form input, I use $submit_vars["formelementname"] = "$value"; Of course $value could be static or a variable. Also make sure you put in a referer and even sometimes "submit" buttons have values.

    Maybe some of that elements are hidden? Just a thought.

    The only trouble I've had is where there is authorization that is not "basic", like validating against database with a cgi script. And no ones had a solution..

    ronnie
    The largest selection of PLR Articles on the Planet!
    Many Private Label Rights Products.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •