2012-12-12 26 views
-6

你如何在PHP中添加HTML表单?我如果会议已定才应该的形式显示,以检查isset即一个条件。 ECHO语句不工作,因为 “”如何添加HTML表单在PHP?

<pre> 
<form action="index.php" method="post"> 
<br /> 
&nbsp;First Name: Last Name:<br/> 
<input type="text" name="firstname" placeholder ="First Name"/> 
<input type="text" name="lastname" placeholder ="Last Name"/><br /> 

&nbsp;Email-id:<br /> 
<input type="text" name="email-id" placeholder ="Your Email-id"/><br /> 

&nbsp;Password:<br /> 
<input type="password" name="password" placeholder ="Your Password"/> 
<br /> 
&nbsp;Re-enter Password:<br /> 
<input type="password" name="password1" placeholder ="Re-enter Password"/> 
<br /></form><pre> 

回答

2
<?php if(isset($_SESSION['someValue'])): ?> 
<form action="index.php" method="post"> 
    <p>Whatevs...</p> 
</form> 
<?php endif; ?> 
+0

为U确定吗?将这项工作 – user1780467

+0

最绝的,看看http://nl3.php.net/html – giorgio

+0

感谢很多UR帮助 – user1780467

0
echo "I want to echo \"quotes\""; // prints: I want to echo "quotes" 
echo 'I want to echo "quotes"'; // prints: I want to echo "quotes" 

选择之一,它既作品。或交替:

<?php if($something == $the_same_as_this): ?> 
    I want to print whatever I want, including "quotes" 
<?php endif; ?> 

将输出字符串(只要真正表达评估)

+0

感谢乌拉圭回合的帮助 – user1780467

0

尝试以下操作:

<?php if(your_condition_here): ?> 
<form> your form here </form> 
<?php endif; ?> 

这样,你就不必用echo或print并使其复杂化。

+0

thnks很多关于UR帮助 – user1780467