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 ) Link to comment https://forums.phpfreaks.com/topic/240938-update-user-form-submit/ 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' Link to comment https://forums.phpfreaks.com/topic/240938-update-user-form-submit/#findComment-1237587 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>"; Link to comment https://forums.phpfreaks.com/topic/240938-update-user-form-submit/#findComment-1237612 Share on other sites More sharing options...
droidus Posted July 2, 2011 Author Share Posted July 2, 2011 LOL! Link to comment https://forums.phpfreaks.com/topic/240938-update-user-form-submit/#findComment-1237636 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.