droidus Posted August 26, 2011 Share Posted August 26, 2011 i have a form, and if the form has not been sent, it shows the form. here is my code for the beginning: if($sent != true) { echo" ?> <div class='form'><form action='' method='post'> [b]!!![/b] <p class='form'>User ID: <br /><input name='memberID' type='hidden' value='<?php echo $row['id'] ?>' /> Your User ID will be logged for identity purposes. <br /><input type='checkbox' name='noIdentity' id='noIdentity' value='noIdentity' <?php if(isset($_POST['errors']) && isset($_POST[noIdentity])) { [b]!!![/b] echo ' checked='checked '"; } ?> /> and the end: <?php "; } ?> it doesn't like what i have the exclamations next to. also, am i doing this right? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted August 26, 2011 Share Posted August 26, 2011 and what exactly does "it doesn't like" meen? perhaps missing some single quotes here? isset($_POST[noIdentity][.php] Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted August 26, 2011 Share Posted August 26, 2011 Why do you start an echo, then immediately attempt to issue a closing ?> tag within the quotes? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 26, 2011 Share Posted August 26, 2011 $_POST[noIdentity] should be $_POST['noIdentity'] Quote Link to comment Share on other sites More sharing options...
droidus Posted August 26, 2011 Author Share Posted August 26, 2011 it still doesn't like the line, <p class='form'>User ID: <br /><input name='memberID' type='hidden' value='<?php echo $row['id'] ?>' /> and i am trying to close the entire echo statement. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 26, 2011 Share Posted August 26, 2011 <?php echo $row['id']; ?> what do you mean "it doesnt like the line?" what error do you get? Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted August 26, 2011 Share Posted August 26, 2011 and what exactly does "it doesn't like" meen? perhaps missing some single quotes here? isset($_POST[noIdentity][.php] [/quote][quote author=droidus link=topic=342474.msg1615651#msg1615651 date=1314366077] it still doesn't like the line, [code]<p class='form'>User ID: <br /><input name='memberID' type='hidden' value='<?php echo $row['id'] ?>' /> and i am trying to close the entire echo statement. <?php echo $row['id']; ?> what do you mean "it doesnt like the line?" what error do you get? :facewall: Quote Link to comment Share on other sites More sharing options...
droidus Posted August 26, 2011 Author Share Posted August 26, 2011 ok, but wouldn't the value "'" get confused with the row id "'"? value='<?php echo $row['id']; ?>' also, it still doesn't like that row. it gives off an error saying "unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING" Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted August 26, 2011 Share Posted August 26, 2011 Once again, I ask: Why do you start an echo, then immediately attempt to issue a closing ?> tag within the quotes? Quote Link to comment Share on other sites More sharing options...
droidus Posted August 26, 2011 Author Share Posted August 26, 2011 oh, right: if($sent != true) { echo" would i still close with this?: <?php "; } ?> Quote Link to comment Share on other sites More sharing options...
droidus Posted August 26, 2011 Author Share Posted August 26, 2011 ok, so here were some of the fixes: i guess if you use echo "$row['name']"; you can't use the single quotes. so i took those out, and it was happy. although now when i do value='<?php if(isset($errors)) { echo $_POST[otherEmail]; } ?>' i get in the text box, this php code. so i just put in $_POST[otherEmail]. 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.