Phpfr3ak Posted December 24, 2011 Share Posted December 24, 2011 The alias form isn't being read for some reason, with having $alias = $_POST['alias']; i don't quiet understand why this isn't it isn't being picked up as a variable below, any clues? cheers <?php include("header.php"); if(isset($_POST['formAlias']) && $_POST['formAlias'] == 'Yes') { $alias = $_POST['alias']; $alias = preg_replace("/[^a-zA-Z0-9_]/", "", $alias); $namelength = strlen($alias); if($namelength < 3){ $error1="Your alias must be at least 3 characters!</span></div>"; echo $error1; }else{ } $query = sprintf("SELECT COUNT(id) FROM players WHERE UPPER(alias) = UPPER('$alias')", mysql_real_escape_string($alias)); $result = mysql_query($query); list($count) = mysql_fetch_row($result); if($count >= 1) { $error1="$alias is already taken."; echo $error1; }else{ } $sql = "updatehereble"; mysql_query($sql) or die(mysql_error()); }else{ } ?> </p> <p> <input name="alias" type="text" id="alias"> </p> <form action="alias.php" method="post"> Do you wish to use an alias? <input type="checkbox" name="formAlias" value="Yes" /> <input type="submit" name="formSubmit" value="Submit" /> </form> Link to comment https://forums.phpfreaks.com/topic/253802-probably-simple-but-kinda-baffled/ Share on other sites More sharing options...
AGuyWithAthing Posted December 24, 2011 Share Posted December 24, 2011 put <input name="alias" type="text" id="alias"> inside your form tags as the form submit will only send the values within your form e.g. <form action="alias.php" method="post"> <p> <input name="alias" type="text" id="alias"> </p> Do you wish to use an alias? <input type="checkbox" name="formAlias" value="Yes" /> <input type="submit" name="formSubmit" value="Submit" /> </form> Link to comment https://forums.phpfreaks.com/topic/253802-probably-simple-but-kinda-baffled/#findComment-1301168 Share on other sites More sharing options...
Phpfr3ak Posted December 24, 2011 Author Share Posted December 24, 2011 Cheers fixed it Link to comment https://forums.phpfreaks.com/topic/253802-probably-simple-but-kinda-baffled/#findComment-1301170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.