#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    PHP Mysql Script


    I need help. I need to find a script that will do this: An email is sent to a prospect, in the email has marketing message and leads them to click on a button/link for more info, the link sends them to a landing page. (ie http://mysite/jim) the jim at the end is the username in our database. So what I need to do is have this link sent to a php page where i can take the username and match it to our affiliate member and send them to a page with the correct affiliate landing page. So the prospect clicks on the link goes to our php page our php page will look into the data base and sends the prospect to (http://mysite/jim), I need this dynamic because i dont want to have to create the same landing page for each affiliate member. Also in the landing page there is a submit button to take them to the actual affiliate order page, so i need php landing page to also be dynamic, get the username from the data base and append it to (http://mysite/jimoffer, or if its another affiliate http://mysite/johnoffer, etc). I am new to php so could use some major help, if you have written script or downloadable script, i could really use it. thanks.
  2. #2
  3. Put a potato on it!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Location
    Maryland
    Posts
    304
    Rep Power
    970
    If you have your database ready to go, you'll need to retrieve the correct member's username - how are you determining that by the way?

    Once you have that information, create the URL with the username on the end:

    PHP Code:
    $url "http://mysite.com/".$username
    From there use something like this to send out nicely formatted emails: PHP Mailer

    Alternatively you can use PHP's native mail() function - [PHPNET="mail"]mail()[/PHPNET]

    PHP Code:
    $to 'prospective@example.com';
    $subject 'subject';
    $message 'your message here with the link and username';
    $headers 'From: no-reply@mysite.com';

    mail($to$subject$message$headers); 
    Then once the prospective person gets to the member's landing page, you can print out an HTML button with the correct order form value:

    PHP Code:
    print "<input type='submit' value='".$username."' />"
    This is all very bare bones but you should be able to build upon it. I didn't see any pre-built scripts from a quick Google but these tutorials should help you further

    Selecting from a database with PHP
    Sending mail with PHP

    Try out some of the stuff I wrote here and if you get stuck ask questions, people here are very knowledgable and willing to help.
    "Those who can make you believe absurdities can make you commit atrocities."
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    PHP5 - PHP Mysql Script


    Thank you for responding. I don't need the email part of the php. I am using aweber as the email, what i really need is a the php script page to collect the data from the email button. The email button will have (h t t p: //mysite/username). When it is clicked it should go to the php page and then read from the database and put the information into the button of the landing page. So the landing page button will have this (h t t p: //mysite/username/username, putting the correct username that came from the link from the email. hope this makes sense.
    Any one can help, thanks.

IMN logo majestic logo threadwatch logo seochat tools logo