droidus Posted July 2, 2011 Share Posted July 2, 2011 i am trying to validate a form, but for some reason, my form tags must not be right, because when i click on submit, it does nothing. here is my code: <?php if (isset($_POST['submit'])) { echo "good!"; } ?> <?php mysql_select_db($database_uploader, $uploader); $query = "SELECT * FROM members WHERE id='" . mysql_real_escape_string($id) . "'"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result) or die(mysql_error()); echo "<p>You are working on " . ucfirst($row['name']) . "'s profile."; echo "<form action='' method='post' id='edit_user' name='edit_user' ><p>ID: <input name='id' type='text' value='$row[id]' disabled='disabled' style='width:1.25em;' />"; echo "<p>Name: <input name='name' type='text' value='$row[name]' />"; echo "<p>Username: <input name='username' type='text' value='$row[uname]' />"; echo "<p>Password: <input name='password' type='text' value='N/A' disabled='disabled' style='width:1.75em;' />"; echo "<p>E-mail Address: <input name='emailAddress' type='text' value='$row[email]' />"; echo "<p>Account Activation: <input name='acntActivation' type='text' value='$row[activated]' style='width:.75em;' /> Valid Value: 0, 1."; echo "<p>Account Type: <input name='accountType' type='text' value='$row[acntType]' style='width:.75em;' /> Valid Value: 0, 1,2,3."; echo "<p>Account Status: <input name='accountStatus' type='text' value='$row[acntStatus]' style='width:.75em;' /> Valid Value: 0, 1."; echo "<p>Bandwhitch Used: <input name='bandwhitch' type='text' value='$row[bandwhitch]' style='width:2em;' />"; echo "<p>Notes: <textarea name='id' type='notes'>$row[notes]</textarea>"; echo "<p><input name='submit' value='Update User Profile' id = 'submit' type='button' /></form>"; } ?> (sorry about all the echos... was late at night, and didn't think to combine 'em ) Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2011 Share Posted July 2, 2011 type='button' doesn't actually do anything by itself (requires a javascirpt event to be used.) Use type='submit' Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 2, 2011 Share Posted July 2, 2011 echo "<form action='' method='post' id='edit_user' name='edit_user' ><p>ID: <input name='id' type='text' value='$row[id]' disabled='disabled' style='width:1.25em;' />"; echo "<p>Name: <input name='name' type='text' value='".$row['name']."' />"; echo "<p>Username: <input name='username' type='text' value='".$row['uname']."' />"; echo "<p>Password: <input name='password' type='text' value='N/A' disabled='disabled' style='width:1.75em;' />"; echo "<p>E-mail Address: <input name='emailAddress' type='text' value='".$row['email']."' />"; echo "<p>Account Activation: <input name='acntActivation' type='text' value='".$row['activated']."' style='width:.75em;' /> Valid Value: 0, 1."; echo "<p>Account Type: <input name='accountType' type='text' value='".$row['acntType']."' style='width:.75em;' /> Valid Value: 0, 1,2,3."; echo "<p>Account Status: <input name='accountStatus' type='text' value='".$row['acntStatus']."' style='width:.75em;' /> Valid Value: 0, 1."; echo "<p>Bandwhitch Used: <input name='bandwhitch' type='text' value='".$row['bandwhitch']."' style='width:2em;' />"; echo "<p>Notes: <textarea name='id' type='notes'>".$row['notes']."</textarea>"; echo "<p><input type='submit' value='Update User Profile' id = 'submit' name='submit' /></form>"; Quote Link to comment Share on other sites More sharing options...
droidus Posted July 2, 2011 Author Share Posted July 2, 2011 LOL! Quote Link to comment 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.