Shadowing Posted December 17, 2011 Share Posted December 17, 2011 A week ago i thought i saw something about another way to display a form in the php manual but cant find it anymore. so im wondering is there another way to echo a form with out echoing every html line. Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/ Share on other sites More sharing options...
Pikachu2000 Posted December 17, 2011 Share Posted December 17, 2011 Maybe you saw HEREDOC syntax? Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298837 Share on other sites More sharing options...
Shadowing Posted December 17, 2011 Author Share Posted December 17, 2011 it was like something_FORM or FORM_something Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298845 Share on other sites More sharing options...
Pikachu2000 Posted December 17, 2011 Share Posted December 17, 2011 Certainly doesn't sound like a PHP function to me. Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298846 Share on other sites More sharing options...
Shadowing Posted December 17, 2011 Author Share Posted December 17, 2011 since im not trying to echo insert data into a form was wondering if there is another way to control the html with out echoing the form to control who can see the html or not. Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298862 Share on other sites More sharing options...
Pikachu2000 Posted December 17, 2011 Share Posted December 17, 2011 Can you clarify what you mean by that? Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298864 Share on other sites More sharing options...
Shadowing Posted December 17, 2011 Author Share Posted December 17, 2011 I have a page where I only want some users to see a html form on. and was wondering if their is a way to do it with out echoing it in line by line <?php $who3 = "SELECT monitor FROM users WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."'"; $who2 = mysql_query($who3) or die(mysql_error()); $who1 = mysql_fetch_array($who2); if ($who1['monitor'] == 'admin') { echo '<div class="containerc">'; echo '<div class="search">'; echo '<form method="post" action="">'; echo '<p>Add a Mod?</p>'; echo '<input type="text" name="name" id="name" onfocus="if(this.value=="Add a Mod?")this.value=" ";" value="Add a Mod?"/>'; echo '<p class="submit"><input type="submit" name="add" id="add" value="Add"></p> <br /><br />'; echo '</form>'; echo '</div>'; echo '</div>'; } ?> also just ran into a problem. I cant make the onfocus line work with the echo. echo '<input type="text" name="name" id="name" onfocus="if(this.value=="Add a Mod?")this.value=" ";" value="Add a Mod?"/>'; Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298868 Share on other sites More sharing options...
son.of.the.morning Posted December 17, 2011 Share Posted December 17, 2011 Echo the entire table in one rather than line by line, although either way it's going to have the same outcome. Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298870 Share on other sites More sharing options...
Pikachu2000 Posted December 17, 2011 Share Posted December 17, 2011 Or look at HEREDOC syntax again, as that's exactly what it's most useful for. Link to comment https://forums.phpfreaks.com/topic/253382-html-form-echo/#findComment-1298894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.