astralaaron Posted February 2, 2008 Share Posted February 2, 2008 can anyone see any errors in this? <?php if ($_GET['mode'] == "edit") { echo "<form action=\"edit.php\" enctype=\"multipart/form-data\" method=\"post\">"; echo "<table class=\"news_arch\" border=\"0px\">"; echo "<tr>"; echo "<td width=\"15%\"><p class=\"date_b\">Picture:</p></td>"; echo "<td><input type=\"file\" id=\"mpic\" name=\"mpic\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">Name:</p></td>"; echo "<td><input type=\"text\" id=\"mname\" name=\"mname\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">birth date:</p></td>"; echo "<td><input type=\"text\" id=\"mdate\" name=\"mdate\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">height:</p></td>"; echo "<td><input type=\"text\" id=\"mheight\" name=\"mheight\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">weight:</p></td>"; echo "<td><input type=\"text\" id=\"mwieght\" name=\"mwieght\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">location:</p></td>"; echo "<td><input type=\"text\" id=\"mlocation\" name=\"mlocation\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">martial arts trained:</p></td>"; echo "<td><input type=\"text\" id=\"marts\" name=\"marts\" size=\"50\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><p class=\"date_b\">about me:</p></td>"; echo "<td><textarea id=\"mabout\" name=\"mabout\" rows=\"10\" cols=\"60\"></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td> </td>"; echo "<td colspan=\"2\"><input type=\"submit\" value=\"add\"><input type=\"hidden\" id=\"mode\" name=\"mode\" value=\"edits2\"></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } if ($_POST['post'] == "edits2") { if ($HTTP_POST_FILES['mpic']['name'] OR $_POST['mname'] OR $_POST['mdate'] OR $_POST['mheight'] OR $_POST['mweight'] OR $_POST['mlocation'] OR $_POST['marts'] OR $_POST['mabout']) { include('safe.php'); mysql_select_db("sb_members"); if (isset($HTTP_POST_FILES['mpic']['name'])){ echo "test"; if ((($HTTP_POST_FILES["mpic"]["type"] == "image/gif") || ($HTTP_POST_FILES["mpic"]["type"] == "image/jpeg") || ($HTTP_POST_FILES["mpic"]["type"] == "image/pjpeg")) && ($HTTP_POST_FILES["mpic"]["size"] < 100000)) { if ($HTTP_POST_FILES["file"]["error"] > 0) { echo "<p class=\"error\">Error: " . $HTTP_POST_FILES["file"]["error"] . "</p><br />"; } else { $picname = $HTTP_POST_FILES['mpic']['name']; $sql0 = mysql_query("UPDATE ".$_SESSION['id']." SET picture = '$picname'"); $result2 = mysql_query($sql0); if ($result2){ $path= "container/".$_SESSION['id']."/". $HTTP_POST_FILES['mpic']['name']; if($mpic !=none) { if(copy($HTTP_POST_FILES['mpic']['tmp_name'], $path)) { echo "<p class=\"sucess\">Profile successfully updated.</p><br />"; } } } } } } if (isset($_POST['mname'])){ $memname = safe($_POST['mname']); $sql1 = mysql_query("UPDATE ".$_SESSION['id']." SET name = '$memname'"); if (!$sql1){ echo "error sql1"; } } if (isset($_POST['mdate'])){ $memdate = safe($_POST['mdate']); $sql2 = mysql_query("UPDATE ".$_SESSION['id']." SET date = '$memdate'"); if (!$sql2){ echo "error sql2"; } } if (isset($_POST['mheight'])){ $memheight = safe($_POST['mheght']); $sql3 = mysql_query("UPDATE ".$_SESSION['id']." SET height = '$memheight'"); if (!$sql3){ echo "error sql3"; } } if (isset($_POST['mweight'])){ $memweight = safe($_POST['mweight']); $sql4 = mysql_query("UPDATE ".$_SESSION['id']." SET weight = '$memweight'"); if (!$sql4){ echo "error sql4"; } } if (isset($_POST['mlocation'])){ $memlocation = safe($_POST['mlocation']); $sql5 = mysql_query("UPDATE ".$_SESSION['id']." SET location = '$memlocation'"); if (!$sql5){ echo "error sql5"; } } if (isset($_POST['mart'])){ $memart = safe($_POST['mart']); $sql6 = mysql_query("UPDATE ".$_SESSION['id']." SET art = '$memart'"); if (!$sql6){ echo "error sql6"; } } if (isset($_POST['mabout'])){ $memabout = safe($_POST['mname']); $sql7 = mysql_query("UPDATE ".$_SESSION['id']." SET about = '$memabout'"); if (!$sql7){ echo "error sql7"; } } echo "<p class=\"success\">Profile updated successfully.<br /></p>"; echo "<a href=\"/siteb/profile/view.php?usr=".$_SESSION['id']."\">view my profile<br /></p>"; } else { echo "<p class=\"error\">An error has occured please try again.</p><br />"; echo "<a href=\"edit.php?mode=edit\">click here to edit profile.</a>"; } } when i submit the form i get no echo'sim being rushed to get this site done by monday! please help----sorry it was something really stupid:} if ($_POST['post'] == "edits2") { was supposed to be } if ($_POST['mode'] == "edits2") { Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.