Jump to content

Why Code Shows-Up in Block-Text Box ?


phpsane

Recommended Posts

Folks,

 

What is wrong with the block text with the label "Description" ?

All html after or below it in the file shows-up inside the block-text box when you check the page in the browser!

	<form name "link_submission_form" method = "post" action="" enctype = "multipart/form-data"> 
    <div class="form-group"> 
        <p align="left"><label>Url:</label> 
        <select> 
        <option value="<?php echo "$primary_domain";?>"><?php echo "$primary_domain";?></option>
        </select> 
        <input type="url" placeholder="<?php echo '/directory/page.html';?>" name="primary_website_url" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_url'])) { echo htmlentities($_POST['primary_website_url']); }?>">
        <label>; Anchor Text:</label> 
        <input type="text" placeholder="Enter Link Text" name="anchor_text" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['anchor_text'])) { echo htmlentities($_POST['anchor_text']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Page Title:</label> 
        <input type="text" placeholder="Enter Page Title" name="page_title" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['page_title'])) { echo htmlentities($_POST['page_title']); }?>"> 
        </p>     
    </div> 
    <div class="form-group">     
        <p align="left"><label>Page Description:</label> 
        <textarea rows="10" cols="100" placeholder="Page Description" name="page description" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['page_description'])) { echo htmlentities($_POST['page_description']); }?>"> 
        </p> 
    </div>     
    <div class="form-group"> 
        <p align="left"><label>Primary Website Email (To receive Visitor Entry Alerts):</label> 
        <input type="text" placeholder="Email to receive Visitor Entry Notice" name="primary_website_email_for_visitor_entry_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_for_visitor_entry_notice'])) { echo htmlentities($_POST['primary_website_email_for_visitor_entry_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Repeat Primary Website Email (To receive Visitor Entry Alerts):</label> 
        <input type="text" placeholder="Repeat Email to receive Visitor Entry Notice" name="primary_website_email_confirmation_for_visitor_entry_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_confirmation_for_visitor_entry_notice'])) { echo htmlentities($_POST['primary_website_email_confirmation_for_visitor_entry_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Primary Website Email (To receive Visitor Exit Alerts):</label> 
        <input type="text" placeholder="Email to receive Visitor Exit notice" name="primary_website_email_for_visitor_exit_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_for_visitor_exit_notice'])) { echo htmlentities($_POST['primary_website_email_for_visitor_exit_notice']); }?>">
        </p> 
    </div> 
    <div class="form-group"> 
        <p align="left"><label>Repeat Primary Website Email (To receive Visitor Exit Alerts):</label> 
        <input type="text" placeholder="Repeat Email to receive Visitor Exit notice" name="primary_website_email_confirmation_for_visitor_exit_notice" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['primary_website_email_confirmation_for_visitor_exit_notice'])) { echo htmlentities($_POST['primary_website_email_confirmation_for_visitor_exit_notice']); }?>">
        </p> 
    </div>     
    <div class="form-group"> 
        <p align="left"><label>Agree To Our Terms & Conditions ? :</label> 
        <input type="radio" name="fb_tos_agreement_reply" value="Yes" <?php if(isset($_POST['fb_tos_agreement_reply'])) { echo 'checked'; }?> required>Yes  
        <input type="radio" name="fb_tos_agreement_reply" value="No" <?php if(isset($_POST['fb_tos_agreement_reply'])) { echo 'checked'; }?> required>No
        </p>  
    </div> 
<p align="left"><input type="submit" class="btn btn-default" name="submit" value="Submit"></p> 
<p align="left"><input type="reset" class="btn btn-default" name="reset" value="Reset"></p>     
</form> 
	

Notice each input field's requirement. Have I got any wrong ? Example:

	<input type="text" placeholder="Enter Link Text" name="anchor_text" required [A-Za-z0-9] autocorrect=off value="<?php if(isset($_POST['anchor_text'])) { echo htmlentities($_POST['anchor_text']); }?>">
	
Link to comment
Share on other sites

Text areas do not have a value attribute. EG

<textarea rows="10" cols="100" name="page_description" >Text area content goes here</textarea>

The text content goes between the <textarea> and </textarea> tags.

As you don't have the closing </textarea> it assumes everything following is still part of the text content.

Edited by Barand
  • Like 1
  • Great Answer 1
Link to comment
Share on other sites

35 minutes ago, Barand said:

Text areas do not have a value attribute. EG


<textarea rows="10" cols="100" name="page_description" >Text area content goes here</textarea>

The text content goes between the <textarea> and </textarea> tags.

As you don't have the closing </textarea> it assumes everything following is still part of the text content.

Oops! Thanks!

I need blocktext box input to remain should user get php echoing error due to any incorrect inputs in any fields of the form.

And so, I coded it like this now:

	<div class="form-group">     
        <p align="left"><label>Page Description:</label> 
        <textarea rows="10" cols="100" name="page description" required [A-Za-z0-9] autocorrect=off><?php if(isset($_POST['page_description'])) { echo htmlentities($_POST['page_description']); }?> </textarea> 
        </p> 
    </div> 
	

What do you think now ? Any good ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.