how do you add a html form in php? I have to check a condition from isset i.e if session has been set only then should the form be displayed. ECHO statement is not working because of ""
<pre>
<form action="index.php" method="post">
<br />
First Name: Last Name:<br/>
<input type="text" name="firstname" placeholder ="First Name"/>
<input type="text" name="lastname" placeholder ="Last Name"/><br />
Email-id:<br />
<input type="text" name="email-id" placeholder ="Your Email-id"/><br />
Password:<br />
<input type="password" name="password" placeholder ="Your Password"/>
<br />
Re-enter Password:<br />
<input type="password" name="password1" placeholder ="Re-enter Password"/>
<br /></form><pre>
<?php if( isset( $_SESSION['someValue'] ) ): ?>
<form action="index.php" method="post">
<p>Whatevs...</p>
</form>
<?php endif; ?>
echo "I want to echo \"quotes\""; // prints: I want to echo "quotes"
echo 'I want to echo "quotes"'; // prints: I want to echo "quotes"
choose one, it both works. Or alternately:
<?php if($something == $the_same_as_this): ?>
I want to print whatever I want, including "quotes"
<?php endif; ?>
Will output the string (as long as the expression evaluates true)
Try the following:
<?php if(your_condition_here): ?>
<form> your form here </form>
<?php endif; ?>
That way you don't have to use echo or print and make it complicated.