Jump to content

Html Form echo


Shadowing

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.