Jump to content
MakeWebGames

Recommended Posts

Posted

ok i was working on the referal for my site, and the first time it wouldnt add the information into the database, then when i got it to work it wouldnt add the ips properly, any idea why?

first code

 

$db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')");

 

new code

 

$refer= sprintf("INSERT INTO referals VALUES ('', %u, %u, %u, %u, %u)", $_POST['ref'], $i, $time, $r['lastip'], $IP);
$db->query($refer);

 

the second code inputs the info into the database

but for some reason when it inputs the info the ip is wrong

e.g. users ip is 99.88.77.66

it saves it as only 99 not the rest

any ideas?

thanks :mrgreen:

Posted

Re: Need help with some referal coding

 

$refer= sprintf("INSERT INTO referals VALUES ('', %u, %u, %u, '%s', '%s')", $_POST['ref'], $i, $time, $r['lastip'], $IP);
$db->query($refer);

There :)

Posted

Re: Need help with some referal coding

hahaha thanks alot, had a feeling it was something simple and silly i was forgeting :) thanks :-D

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.   Paste as plain text instead

  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...