PGTibs Posted March 20, 2009 Share Posted March 20, 2009 The form on this page wont submit, its found just under the if submit statement and no matter what i try, the action wont happen after i press the post button. Whats the problem??? <? session_start(); include "config.php"; ?> <head> <link REL="STYLESHEET" TYPE="text/css" HREF="css.css"> </head> <body> <? $user = $_GET["user"]; $comment = $_GET["comment"]; $query = mysql_query("SELECT * FROM `members`"); while($result = mysql_fetch_array($query)) { $id = $result["id"]; $name = $result["name"]; $age = $result["age"]; $location = $result["location"]; $aboutme = $result["aboutme"]; $music = $result["music"]; $films = $result["films"]; $books = $result["books"]; $buddy = $result["bestbuddy"]; $photo = $result["photo"]; $IDF = "$id f"; $IDC = "$id C"; if($user == "$name") { echo "<center>"; include "nav.php"; echo " <div class='box'> <div class='image'> <img src='$image' width='200px' border='0'> <div class='friends' align='left'> <h2>Friends</h2> "; $queryy = mysql_query("SELECT * FROM `$IDF`"); while($resultt = mysql_fetch_array($queryy)) { $maten = $resultt["maten"]; $matep = $resultt["matep"]; $matec = $resultt["matec"]; echo " <div style='padding-left: 5px;'> - <a href='profile.php?user=$maten'>$maten</a></div>"; }; echo " </div> </div> <div class='content' align='left'> <h2>$name</h2> <div class='info'> <b>Location</b>:<br> - $location<br> <b>Age</b>:<br> - $age<br> <b>About Me</b>:<br> - $aboutme<br> <b>Music</b>:<br> - $music<br> <b>Films</b>:<br> - $films<br> <b>Books</b>:<br> - $books<br> <b>Best Buddy</b>:<br> - $buddy<br> </div> <div class='contentt' align='left'> <h2>Comment - <a href='profile.php?user=$name&comment=add'>Add Comment</a></h2>"; $queryyy = mysql_query("SELECT * FROM `$IDC` WHERE `ID` <> 1 ORDER BY `ID` DESC"); while($resulttt = mysql_fetch_array($queryyy)) { $comn = $resulttt["comn"]; $comm = $resulttt["comm"]; if($comment == "sub") { $comnn = "Username Failed"; $ccomm = $_POST["ccom"]; $add = mysql_query("INSERT INTO `$IDC` ( `comn`, `comm`) VALUES ('$comnn', '$ccomm')"); } if($comment == "add") { echo " <div style='padding: 10px;><form method='POST' action='profile.php?user=$name&comment=sub'> <textarea style='width: 100%;' id='ccom'>Add comment here...</textarea><br> <div align='right' style='padding-bottom: 10px; border-bottom: #41A317 2px solid;'> <input type='submit' name='submit' value='Post'></div></form>"; }; echo "<div style='margin-top: 2px; background-color:#52D017'> <div style='padding-left: 5px;'> - <a href='profile.php?user=$comn'>$comn</a></div> <div style='padding-left: 15px;'> $comm</a></div></div>"; }; echo " </div> </div> </div> </div> "; include "footer.php"; echo "</center>"; }; }; mysql_close($ms); ?> </body> Link to comment https://forums.phpfreaks.com/topic/150350-solved-form-not-submitting/ Share on other sites More sharing options...
jlhaslip Posted March 20, 2009 Share Posted March 20, 2009 have you tried double quotes around the method="POST" and action= string? Link to comment https://forums.phpfreaks.com/topic/150350-solved-form-not-submitting/#findComment-789607 Share on other sites More sharing options...
PGTibs Posted March 20, 2009 Author Share Posted March 20, 2009 That just causes a parse error and solving the parse error then gives either the same problem or the textbox dissappears.. Link to comment https://forums.phpfreaks.com/topic/150350-solved-form-not-submitting/#findComment-789610 Share on other sites More sharing options...
rhodesa Posted March 20, 2009 Share Posted March 20, 2009 in your first DIV tag, you need a close quote on style attribute: echo " <div style='padding: 10px;'><form method='POST' action='profile.php?user=$name&comment=sub'> <textarea style='width: 100%;' id='ccom'>Add comment here...</textarea><br> <div align='right' style='padding-bottom: 10px; border-bottom: #41A317 2px solid;'> <input type='submit' name='submit' value='Post'></div></form>"; Link to comment https://forums.phpfreaks.com/topic/150350-solved-form-not-submitting/#findComment-789613 Share on other sites More sharing options...
PGTibs Posted March 20, 2009 Author Share Posted March 20, 2009 Thanks Link to comment https://forums.phpfreaks.com/topic/150350-solved-form-not-submitting/#findComment-789619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.