Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
php includes the htmlspecialchars function

Php includes the htmlspe-cialchars function

636

LESSON 21: Taking Advantage of the Server

<form action=”post.php” method=”post”>
Enter your name: <input type=”text” name=”yourname” /><br /> <input type=”submit” />
</form>

When the user submits the form, the value of the yourname field will be available in $_POST and $_REQUEST. You could return it to the user like this:

Processing Forms 637

them as markup. Or if you prefer, you can use htmlentities(), which encodes all the characters that are encoded by htmlspecialchars() plus any other characters that can be represented as entities. In the preceding example, you really want to write the script that displays the user’s name like this:

<p>Hello <?= htmlspecialchars($_POST[‘yourname’]) ?>. Thanks for visiting.</p>

Handling Parameters with Multiple Values

Most form fields are easy to deal with; they’re simple name and value pairs. If you have a text field or radio button group, for example, you can access the value submitted using $_REQUEST, like this:

21

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Jamie Rowe

PageId: ELIF3CECA1