[Help] register.php

04/04/2010 23:55 Knight^Hawk#1
why would my register script not insert the ip of the registured user. this and one more thing stats.php is preventing me from opening =/


04/05/2010 01:04 .Ash#2
i thought you got someone to help you...?
04/05/2010 01:12 PraDevil[ELITE]#3
that was nothing to do with main register page:facepalm:
go to register.php in pages folder..edit from there..

if i remember this the code to get the ip..
Code:
$SERVER[REMOTE_HOST]
04/05/2010 04:27 Knight^Hawk#4
Quote:
Originally Posted by SpongeBox View Post
i thought you got someone to help you...?
i did but he only knew how to set it up. hes learning himself.

Quote:
Originally Posted by PraDevil View Post
that was nothing to do with main register page:facepalm:
go to register.php in pages folder..edit from there..

if i remember this the code to get the ip..
Code:
$SERVER[REMOTE_HOST]
where do i put this? on what line?
04/05/2010 08:01 Knight^Hawk#5
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...
04/05/2010 08:04 PraDevil[ELITE]#6
put your register.php in pages folder here..
04/05/2010 16:01 King_Arthur#7
@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 View Post
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 View Post
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!
04/05/2010 17:15 PraDevil[ELITE]#8
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:D

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>";
                                                }
                                        }
                                }
                        ?>
04/05/2010 17:25 .Ash#9
Do you have IP column in your Account table?
04/05/2010 17:31 PraDevil[ELITE]#10
no:D
04/05/2010 18:47 ~WARNING~#11
you should make one :P i have one in mine so that's extremely weird that you don't