Jump to content

Grabbing ipaddress


Jon12345

Recommended Posts

Oh that's good to know, although it brings up a fresh problem. The following code is intended to lookup my database to see if there is a matching ipaddress and if there is, set action=1 in the records action field. But instead, I just get a blank screen and no redirect. If I eliminate the database code section, it redirects. What is wrong with my code?

[code]$ipaddress=$_SERVER['REMOTE_ADDR']
$db1=mysql_connect("localhost","user","pw"); 
mysql_select_db("affiliatelog",$db1);
$query1="UPDATE visitor_log SET action = '1' WHERE ipaddress='$ipaddress'";
mysql_query($query1) or die('Database Query Error: '.mysql_error());
mysql_close($db1)


$sub=$_GET['sub'];
$offer=$_GET['offer'];

if ($offer == "xxx") {$product = "http://site1.com?sub=$sub";} // Default link
if ($offer == "bbb") {$product = "http://site2.com/?sub=$sub";} // Default link

//some javascript redirect code goes here but this forum won't let me post it for some strange reason![/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.