beansandsausages Posted July 31, 2007 Share Posted July 31, 2007 Can any one see any reason this isnt working ? doesnt seem to change any thing or ot its got me stumped echo " <Tr><Td>Username <td>:<td>$info[username] <a href=cont.php?action=name>Edit</a></td> "; if ($_GET[action] == "name"){ if(!$_GET[change]){ echo "<br><form action=cont.php method=post>"; echo "<input type=hidden name=action value=name>"; echo "New Name: <input type=text size=30 name=change value=\"$info[username]\"><br>"; echo "<input type=submit value=Update></form><p>"; echo "<br><br><center>[<a href=cont.php>Back</a>]</center>"; }else{ $change = trim($change); $first = ord(substr($change,0,1)); if((strlen($change) > 20) || (strlen($change) < 4)){ echo "Username must be between 4 and 20 characters."; echo "<br><br><center>[<a href=cont.php?action=name>Back</a>]</center>"; }elseif(substr($change,0,1) == " "){ echo "Username can not start with a space."; echo "<br><br><center>[<a href=cont.php?action=name>Back</a>]</center>"; }elseif(substr($change,0,1) == "."){ echo "Username can not start with a dot."; echo "<br><br><center>[<a href=cont.php?action=name>Back</a>]</center>"; }elseif(($first >= 48 && $first <= 57) || ($first >= 65 && $first <= 90) || ($first >= 97 && $first <= 122) || ($first = 126)){ $change = eregi_replace(".com","...",$change); $change = eregi_replace("www.",".",$change); $change = eregi_replace(".tk",".",$change); $change = eregi_replace(".net","...",$change); $usercheck = mysql_query("SELECT * FROM users WHERE username like '$change'"); if(@mysql_num_rows($usercheck) > 0){ echo "Username already taken"; echo "<br><br><center>[<a href=cont.php?action=name>Back</a>]</center>"; /* }else{ $checkip = mysql_query("SELECT * FROM users WHERE ip = '$info[ip]'"); if((@mysql_num_rows($checkip) > 1) && ($info[status] == "Member")){ echo "Cannot change username while two users are on the same IP"; echo "<br><br><center>[<a href=cont.php>Back</a>]</center>"; */ }else{ $change = htmlspecialchars($change); $change = eregi_replace("admin","loser",$change); $change = eregi_replace("manager","loser",$change); $change = eregi_replace(".com","...",$change); $change = eregi_replace(".net","...",$change); $change = eregi_replace(" "," ",$change); $change = eregi_replace("adm1n","loser",$change); echo "Name successfully changed from $info[username] to $change"; mysql_query("UPDATE users SET username = '$change' WHERE id = '$info[id]'"); echo "<br><br>[<a href=account.php>Back</a>]</center>"; // } } }else{ echo "Username MUST start with a letter or number."; echo "<br>*$change*<br>"; echo "<br>*$first*<br>"; echo "<br><br><center>[<a href=cont.php?action=name>Back</a>]</center>"; } } } Quote Link to comment https://forums.phpfreaks.com/topic/62708-change-a-name/ Share on other sites More sharing options...
GingerRobot Posted July 31, 2007 Share Posted July 31, 2007 Do you think you could tell us what you mean when you say, its not working? What does it do at the moment? What is it supposed to do? Without that, it's going to be hard for someone to know where to look within your code. Quote Link to comment https://forums.phpfreaks.com/topic/62708-change-a-name/#findComment-312112 Share on other sites More sharing options...
beansandsausages Posted July 31, 2007 Author Share Posted July 31, 2007 Sorry, My bad new to all this, when i click the link to edit the details the name apears in the text box, but when i edit the name and click update nothing happens it should post name changed the change the name in the database but it does nothing when i click update just takes me back the the cont.php file. Sorry not much help. Quote Link to comment https://forums.phpfreaks.com/topic/62708-change-a-name/#findComment-312115 Share on other sites More sharing options...
beansandsausages Posted August 1, 2007 Author Share Posted August 1, 2007 So can any one give me any hints please? Quote Link to comment https://forums.phpfreaks.com/topic/62708-change-a-name/#findComment-313084 Share on other sites More sharing options...
DeepakJ Posted August 1, 2007 Share Posted August 1, 2007 echo "Name successfully changed from $info[username] to $change"; mysql_query("UPDATE users SET username = '$change' WHERE id = '$info[username]'"); maybe? Quote Link to comment https://forums.phpfreaks.com/topic/62708-change-a-name/#findComment-313092 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.