Guys I downloaded and installed visitor tracking system from following site: http://www.roscripts.com/Track_visitors_with_PHP-62.html This script has 3 files only 1. visitors_connections.php > Connects with database 2. visitor_tracking.php > Tracks visitor and add into table 3. display_visits.php > Displays the visitors records The only thing we need to do is to add "visitor_tracking.php" at start of page which page is need to be monitored. This script is working fine and adding visitors record to database exactly. In short I have few pages of my site like HOME & REGISTER & SERVICE & COST & CONTACT. For example if any visitor comes from abc.com site at HOME page then normally this tracking script will add visitor record to database. In this case "abc.com" site will be as referral site. Fine, well, no problem. But if users visitors other pages like contact us, services, costs and then come back to home page then this script will add another record with "shahbazqadri.com" as referral because visitor came from Cost page of same site. I also deal this and fix my site name in script that if referral is from this site means "shahbazqadri.com then script don't add record in database. Up to this I worked and every thing is working fine. Now what I want is "I want to add referral site name in user registration table." I want that when user comes from any site script save "referral site name" in any such variable that I can retrieve in "registration page" and then add to table. I am poor in variables as I am not professional PhP programmer, I learned small things of programming from Internet. So please let me know how to store and pass variable from HOME page to SIGNUP page so I may access it in signup page. When any users comes from abc.com site to my site home page, I should need to save referral site name in variable and then it should not change, no matter visitor visits other pages and then come back again to home page. So this variable will be saved once and first time only and available to access in registration page. I know this is very small thing for a programmer but for big who don't know it. Please help me. GCS
The easiest way would be to set a session variable on the home page, and then read it on the signup page. On the home page: session_start(); $_SESSION['my_variable'] = 'REFERING WEBSITE'; PHP: On the Signup page: session_start(); echo $_SESSION['my_variable']; PHP: I'm not sure how you're getting the referring site, but this should get you on the right track...
Didn't understand what you had asked for completely. You could easily use this: $ref=$_SERVER['HTTP_REFERER'] PHP: Then within the INSERT query you would put $ref where it's needed; For example: mysql_query("INSERT INTO `refs` (`id`, `site_ref`) VALUES ('', '$ref');") or die (mysql_error()); PHP: Hope this is useful for you. Regards, NateJ