SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Ap0s7le's Avatar
    Join Date
    Jul 2003
    Location
    Lousiville, KY
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Populate form on other domain

    I've been asked to populate a form on an unrelated website.

    What this means is not submit the form, but click a link that will somehow enter data in the form from our DB on this other domain and allow our visitor to fill in the rest of their information (Besides the name, zip etc. That we populated for them)

    I don't recall there being a way to do this, but if there is a new way to handle this situation than I'd like to know.

    I understand we can submit their data via curl and the like, but we just need the form itself populated.

    I've also posted this on the Javascript forum.

    Thank you for your time.

  2. #2
    SitePoint Zealot krt's Avatar
    Join Date
    Sep 2005
    Location
    Australia
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice to know you know about cURL, makes explaining this much easier.

    To do this, use cURL to get the contents (HTML) of the page with the form on it then use regular expressions and preg_replace() to add the data into the value attributes or body of the input fields. Then output the result. Note that it will appear to the user that they are still on the same site so you may need to work with the form's action attribute so that an absolute path is used otherwise the form data will be submitted to anywhere on your site.


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
  •