2012-12-12 27 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