@Knight^Hawk I can see you know how to use the edit button. So I must ask you to discontinue double posting. If no one makes a reply to your post you must edit it to add additional information, not make a post after it.
Quote:
Originally Posted by Knight^Hawk
why would my register script not insert the ip of the registured user.
Your register script would not insert the ip of the registered user if your register script never asks for the ip or passes it along to mysql.
Quote:
Originally Posted by Knight^Hawk
i get this error when i put $SERVER[REMOTE_HOST]
Code:
Parse error: syntax error, unexpected T_IF in /home/knight/public_html/pages/register.php on line 69
fixed first post aswell...
I don't see "$SERVER[REMOTE_HOST]" in the first post spoiler.
It's been a long time since I've done anything in PHP but I assume it would look something like below. FOR REFERENCE ONLY!
if(PhpCaptcha::Validate($_POST['CheckCode']))
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
$ip=$_SERVER[REMOTE_HOST]; // Define $ip with remote ip address
if(!ereg("^[0-9a-z]{4,12}$",$userid))
{
echo "Only letters from \"a\" to \"z\" and numbers, lenght of 4 to 12 characters";
}
else
{
if($password == $passretype)
{
if(!ereg("^[0-9a-zA-Z]{4,12}$",$password))
{
echo "Only letters or numbers, lenght of 4 to 12 characters";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
// add the ip address to netbar_ip in our mysql statement passed to the server
mysql_query("insert into account (name,Password,Reg_date,netbar_ip) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."','".$ip."')");
echo "Account registered successfully.";
huhu..im not sure if u like register page without capcha..u can take my register.php then put in pages folder..u can see what are im modified here..learn with it how to add email..php is fun
after u put the new register.php then u will need to design your database account table..go to netbar_ip column then set default to EMPTY STRING
Code:
<?php
include('config.php');
?>
<script type="text/javascript" src="./inc/md5.js"></script>
<form method='post' action='register.php?act=register'>
<b><strong>Please make sure you remember your Account ID and Password</strong></b><hr>
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="64" valign="top"></td>
<td valign="top">
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr><td><strong>Account ID:</strong></td>
<td width="66%"><input type="text" size="30" maxlength="15" name="id" id="id" title="* Only 4-15 Words/number"></td></tr>
<tr><td><strong>Password:</strong></td>
<td><input class=it id="ipassword" type="password" size="30" maxlength="15" name=pass title="* Only 4-15 Words/number"></td></tr>
<tr><td><strong>Retype Password:</strong></td>
<td><input class=it1 id="ipassword" type="password" size="30" maxlength="15" name=retpass title="* Only 4-15 Words/number"></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<br /><br />
<TABLE align="center">
<tr><td align="center"><input type="hidden" name="hash"><input class=Butt type=submit onclick="hash.value = login(pass.value)" value='register' name=B1></td></tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php
if($_GET['act'] == "register")
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
[COLOR="Red"]$_SERVER['REMOTE_ADDR'];[/COLOR]
if($userid=="" || $password=="" || $passretype=="" )
{
echo "<center>You must fill all information in the Required Field!</center>";
}
else
{
if($password == $passretype)
{
if(!ereg("^[0-9a-z]{4,15}$",$userid))
{
echo "<center>Only letters and numbers only are allowed.Long 4 to 15 words</center>";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
mysql_query("insert into account (name,Password,Reg_date,[COLOR="Red"]netbar_ip[/COLOR]) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."',[COLOR="Red"]'".$_SERVER['REMOTE_ADDR']."'[/COLOR])");
echo "<center>Account successfully registered!</center>";
}
else
{
echo "<center>This account has been registered, please select another!</center>";
}
}
}
else
{
echo "<center>Password authentication is not the same as your Password</center>";
}
}
}
?>
SRO- where i register? 05/04/2010 - SRO Private Server - 0 Replies title says it all.
EDIT: how i make it english
can not register me 09/11/2008 - SRO Private Server - 1 Replies have someone a account for me?
register help 07/14/2008 - EO PServer Hosting - 1 Replies i have a problem with my register script it keeps saying invalid id/password idk what to do
CAN SOME ONE HELP ME REGISTER 04/20/2008 - Dekaron Private Server - 1 Replies HELP :( WHEN I TRY TO REGISTER AT DEKARON PSERVER I GET AN ERROR :(
PLEASE HELP MEEE