I just need a little advice (and code if possible) about the best way to personalize my sales page. The main website will have a Gateway type opt-in form which will then let the visitor access the sales page. I want to use the "first name" captured in the opt-in form to be passed to the sales page where I can address the visitor by name and increase my ROI. This product also has an affiliate program and I am currently using paydotcom.com as the payment processor and affiliate manager. What is the best way to accomplish the task above? I dont want to do anything that would take sales from my affiliates so it has to work with paydotcom. I was thinking an index.php which would just reload with the sales page after the opt-in is submited. Or should the user be redirected to a new page? and if redirected will the affiliate still get credit? thanks all Adam
After the visitor fills out a form, I would either set a session variable, or add them to a database where you can pull their info when needed. Either of these methods should be very efficient and invisible to the user.
Im not really familiar with session ID's. Would that be better than $_Post and $_GET? Ill do some research as well, but i woudl appreciate any links you have on session ID's. Im still new to PHP although I have coded quite a bit. Also, what do you think about getting IP and name in a mysql database that way, when they return "welcome back $name"? Adam
Do you automatically store the user's submitted info in a database when they submit it? As far as sessions go, you can use the session_start() tag at the beginning of each page. When you need to set a session variable, you can use the global variable $_SESSION to set a variable for your visitor. That variable is then available on any other page the visitor goes to on your website. Session is better than get or post in this case because it is with them as long as their session exists. Example: <?php //login page session_start(); //process login here ... ... ... //If user is authorized, or logged in -> $_SESSION['name]' = 'John Doe'; //do some more stuff //output some stuff ?> <p>Welcome <?php if(isset($_SESSION['name'])){echo $_SESSION['name'];}?>,<br> Thank you for visiting.</p> PHP:
Thank you so much for the help. I guess what my main issue is, is that i use getresponse autoresponder. So, I have a typical form setup which asks for name and email and on submit, those variables are posted to getresponse's cgi script which puts them into my email sequence and database. How do I get the name variable, which in this case is stored as name="category2" in the form field, to be written to the session ID when the submit button is pressed? I have researched how to make submit buttons do two things at once (with javascript), but I havent had any luck finding something that works. thanks again
What page are they redirected to after the cgi script processes their request? Can you make the cgi send them to a page with thei mane in a $_GET variable. EX: thankyou.html?user=John Doe
Yes they do. I never realised they had that setting. I have it set to pass the information via GET. Now with that being said does this look like the correct code: <?php //sales page session_start(); //process login here......... //If user is authorized, or logged in-> $name=$_GET['category2']; $_SESSION['name'] = $name; //do some more stuff //output some stuff ?> <p>Welcome <?php if(isset($_SESSION['name'])){echo $_SESSION['name'];}?>,<br>Thank you for Opting-in. You will need to verrify your email address before you can access the bonus material.</p> Im guessing that both pages can simply be .htm pages with the correct stuff in the .httaccess file? Or should I just make them php pages? Adam
You can leave them as htm or php, whatever your preference is. You will also now be able to use their name on any other page on the site, assuming that there are more, as long as a session is started for them.
Thanks again for all of your help. Did that code look correct? Also i forgot to ask, if they post the information in GET format what does that mean in terms of the way i setup my opt-in form. Here is the current redirect in ym opt-in form: <input type="hidden" name="confirmation" value="/thankyou.html"> Will i need to modify the value to be *** value="/thankyou.html?user=category2" *** ? Or do i just leave it alone and getresponse will automatically send the info? thanks
The code looks fine. Does the thankyou url end up with variables in it already? If it does, then your fields should show up automatically.
yea i just talked to their live support and they said the script automatically sends all of the information to the webpage. Unfortunately they couldnt give me any support on the PHP side of it. But I dont think i need any more support now that you have schooled me. I really appreciate it man, its hard to find people who are willing to help. Happy holidays, Adam