SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing mysql database info from 1 url to another

    Can someone please point me in the right direction.

    Here is my scenario: I have a page where people input info into form fields. That info is then stored into mysql database. Is there any way to pull info from the database to populate form variables on a different url?


    Example:

    You visit my website "mysite.com". Sign up to my site and enter basic variables into form. FirstName,LastName,ZipCode,Email. I now have that info stored in a database. Now I want to offer a you a chance to sign up to a similar site (a different url that I have no access to) that requires the same form variables to filled in in order to sign up. Instead of entering info to the new website, is there a way to pull that info from my database?

    I hope I am not confusing.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,251
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    do you understand the concept of a primary key?

    that's all you would need in order to "pull" the stored info
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the problem "pulling that info from your database" or entering the data automatically in the form of the other website?

    If the former: that seems pretty basic (what use is a database if you can't get data from it??), if the latter: that is in general possible but not a database question.

  4. #4
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A primary key uniquely identifies each record of the table. I understand that but I guess where I really get confused is how to pass the database info from "my site" to another form on a different website.

    The concept I've seen work was from the couponmom website. After signing up you would be offered several opt ins. The forms were prepopulated with the info you originally used to sign up. I just went back to that site only to find out that it appears that they are currently not using this feature at the moment so.... I cannot research it anymore.

  5. #5
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rblon,

    Can you point me to where i need to be looking for the "latter"? That is the issue. Automatically filling in a form on another website.

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The other site will most likely on form submission make a http request with the form parameters as POST or GET variables. So, you need to make this request with the data which is submitted on your website.

    You can use many programming languages to do this, eg PHP.

  7. #7
    SitePoint Guru
    Join Date
    Sep 2008
    Posts
    977
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by matt79 View Post
    I now have that info stored in a database. Now I want to offer a you a chance to sign up to a similar site (a different url that I have no access to) ...... that requires the same form variables to filled in in order to sign up. Instead of entering info to the new website, is there a way to pull that info from my database?
    As far as I know, if you are trying to make a 3rd party website get data from your db, you need to have control of thier page scripting. Either that or, have some arrangement with that external site do that tney use your db.

    I maybe wrong but I don't know of any other way(s) for security reasons.

    Even if you had an API wirtten, that code would have to sit on their web page just as if you were using a google API on your site to interact with thier db.

    bazz

  8. #8
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it might be that the other website has taken security measures to prevent automated form submisson (eg a captcha), but in general: if you can use your browser to input a form, then you can also do it in an automated fashion. In both cases it is a matter of sending http requests.

  9. #9
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I can't guarantee this will work, but the second form should still be on the first site, populated by php immediately after the first insert (while you still have the original variables to play with), but the ACTION of the second form uses a php script on the second site.
    But I've never tried anything like this myself
    And, if you have no access to the second site, then why would you want to help someone subscribe to that site???
    It is likely that the example you previously saw was a case where the same people operated both sites.


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
  •