i have the following code:
and the thing is, i have NO clue whats going on, but what im trying to do is add a $_SERVER['REMOTE_ADDR'] into 'ip'. i have it on the form page as
Code:
<? $u = $_POST['u']; $p = $_POST['p']; $e = $_POST['e']; $country = $_POST['country']; $g = $_POST['gender']; $a = $_POST['age']; $ref = $_POST['ref']; $u = htmlspecialchars($u); $p = htmlspecialchars($p); $e = htmlspecialchars($e); $g = htmlspecialchars($g); $d = htmlspecialchars($d); $ref = htmlspecialchars($ref); if($u && $p && $e && $a && $g) { $check = mysql_num_rows(mysql_query("SELECT * FROM `members` WHERE `username`=\"$u\"")); if($check==0) { $month = $_POST['month']; $day = $_POST['day']; $year = $_POST['year']; $sign = $_POST['sign']; $month = htmlspecialchars($month); $day = htmlspecialchars($day); $year = htmlspecialchars($year); $sign = htmlspecialchars($sign); $date = date("m/d/y"); // remove spaces // $uu = str_replace (" ", '$u', $uu); // echo $uu; // echo $u; // die; $insert = mysql_query("INSERT INTO `members` (`country`, `gender`, `age`, `date`, `dob`, `username`, `password`, `email`, `ref`) VALUES('$country', '$g', '$a', '$date', '$month/$day/$year', \"$u\", \"$p\", \"$e\", \"$ref\")"); $msg = mysql_query("INSERT INTO `messages` (`to`, `from`, `subject`, `message`, `status`, `date`) VALUES(\"$u\", 'admin', 'Welcome', '$mess', 'unread', '$date')"); $_SESSION['Board'] = $u; if (session_register('Board')) { print "You have been registered. You are now able to access all of the features on this site.<p> <a href=\"index.php\">Click here to continue</a>"; print ""; } else { print "Cant set session!"; }
Code:
<tr> <td bgcolor="#10d305"><input type="hidden" name="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" size="10" /></td> </tr>
Comment