![]() Topic awaiting preservation: PHP/MySQL Code Check... (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() This code is suposed to grab the host and then store it in the database if there is no listing of it yet. And increment hits if it is listed. This is used when I am checking which parked domain names are delivering the most hits to the site. code: <? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() The following code should work (I haven't tested it, because I don't have time): |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() The code you sugest should make my result resemble: code: $database = "****";
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() Oops... code: <? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() Ahhhhhhhhhhhhhh, I didn't see 'id' field (and therefore my code won't work correctly). Anyway, IMHO You don't need 'id' filed at all... This is how I would do this (I've tested this and it works fine): |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() Here is a problem. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() The last version of my script from above works fine. I have tested it locally and it worked without problems. I even added two bogus domains like you said - with www.x.com and www.y.com that point to the same server. After that I've called the script from both domains (i.e. www.x.com/log.php & www.y.com/log.php ) and domains were added to the database. When I tried to access them again counter was incremented correctly (duplicate entry wasn't created). So, I really don't know what's wrong in your case. Did you include the script in all your pages? Also, did you modify SQL table according to SQL scheme that I posted above? |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() I am running it simply on the index.php page. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() If it increments main domain counter when you access parked domain, then something is probably wrong with HTTP_HOST variable (it is probably set to the same value). You can easily check this by doing an "echo $HTTP_HOST" from both domains... |