Foser Posted July 4, 2007 Share Posted July 4, 2007 heres my error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\WAMP\www\Projects\LogiPlan\main\admin\user.php on line 21 part of code with problems. if (isset($_POST['delete'])){ echo "Are you sure you want to delete {$username}?<br>"; echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=""> <label> <input type=\"submit\" name=\"yes\" id=\"yes\" value=\"Yes\" /> </label> <label> <input type=\"submit\" name=\"no\" id=\"no\" value=\"No\" /> </label> </form>"; if(isset($_POST['yes'])) { echo "You have deleted this user. Click <p><a href=\"index.php\">here</a></p> to go back to the admin CP." mysql_query("DELETE * FROM user_info WHERE username = '$username'"); } if(isset($POST['no'])){ header("Location: user.php?user={$_GET['user']}"); exit; }} </form>"; that is the the line. Link to comment https://forums.phpfreaks.com/topic/58400-solved-html-within-an-echo-unexpected-expecting-or-i/ Share on other sites More sharing options...
Yesideez Posted July 4, 2007 Share Posted July 4, 2007 The line looks to be this as it gets treated as one line even though its is spread over more than one line: echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=""> <label> <input type=\"submit\" name=\"yes\" id=\"yes\" value=\"Yes\" /> </label> <label> <input type=\"submit\" name=\"no\" id=\"no\" value=\"No\" /> </label> </form>"; Looks like you forgot to escape the two quotes in action: echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"> <label> <input type=\"submit\" name=\"yes\" id=\"yes\" value=\"Yes\" /> </label> <label> <input type=\"submit\" name=\"no\" id=\"no\" value=\"No\" /> </label> </form>"; Link to comment https://forums.phpfreaks.com/topic/58400-solved-html-within-an-echo-unexpected-expecting-or-i/#findComment-289547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.