<< < 6 7 8 9 10 11 12 13 14 15 16 > >>   Sort: Rank

Submitting Values without Using a Form in PHP
How To Submit Values without Using a Form in PHP? If you know the values you want to submit, you can code the values in a hyper link at the end of the URL. The additional values provided at the end of a URL is called query string. There are two suggestions on how to use query strings to submit value...
2016-11-08, 612👍, 0💬

Removing Slashes on Submitted Input Values in PHP
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted to the PHP engine, it will add slashes to protect single quotes and double quotes. You should remove those slashes to get the original values by applying the stripslashes() function. Note that PHP eng...
2016-11-08, 548👍, 0💬

Generating and Processing Form with the Same Script in PHP
How To Generate and Process a Form with the Same Script in PHP? In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the form generation script in the "acti...
2016-11-08, 487👍, 0💬

Supporting Multiple Submit Buttons in PHP
How To Support Multiple Submit Buttons in PHP? Sometimes, you may need to give visitors multiple submit buttons on a single form to allow them to submit the form for different purposes. For example, when you show your customer a purchase order in a Web form, you may give your customer 3 submit butto...
2016-11-08, 315👍, 0💬

Supporting Hidden Form Fields in PHP
How To Support Hidden Form Fields in PHP? Hidden fields are special fields in a form that are not shown on the Web page. But when the form is submitted, values specified in the hidden fields are also submitted to the Web server. A hidden field can be specified with the <INPUT TYPE=HIDDEN ...> ...
2016-11-08, 302👍, 0💬

Supporting a Multiple-Page Form in PHP
How To Support Multiple-Page Forms in PHP? If you have a long form with a lots of fields, you may want to divide the fields into multiple groups and present multiple pages with one group of fields on one page. This makes the a long form more user-friendly. However, this requires you to write good sc...
2016-11-05, 492👍, 0💬

Retrieving the Original Query String in PHP
How To Retrieve the Original Query String in PHP? If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version of processing_forms.php which pri...
2016-11-05, 303👍, 0💬

Protecting Special Characters in Query String in PHP
How To Protect Special Characters in Query String in PHP? If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode(): <?php print("<html>"); print("<p&...
2016-11-05, 297👍, 0💬

Understanding and Managing Cookies in PHP
Where to find tutorials on how to manage Cookies in PHP? A collection of tutorials to answer many frequently asked questions how to manage Cookies in PHP. Clear explanations and tutorial exercises are provided on setting and receiving cookies, creating and removing persistent cookies, specifying dom...
2016-11-05, 295👍, 0💬

What Is a Cookie in PHP
What Is a Cookie in PHP? A cookie is a small amount of information sent by a Web server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating, tracking, and maintaining specific information about users, such as site p...
2016-11-05, 269👍, 0💬

What Is a Persistent Cookie in PHP
What Is a Persistent Cookie in PHP? A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. Yo...
2016-11-04, 306👍, 0💬

Sending a Cookie to the Browser in PHP
How To Send a Cookie to the Browser in PHP? If you want to sent a cookie to the browser when it comes to request your PHP page, you can use the setcookie( ) function. Note that you should call setcookie() function before any output statements. The following script shows you how to set cookies: <?...
2016-11-04, 278👍, 0💬

Testing Cookies on a Web Server in PHP
How To Test Cookies on a Web Server in PHP? If you want to test cookies with a browser, you need to run a Web server locally, or have access to a Web server remotely. Then you can copy the following PHP cookie test page, setting_receiving_cookies.php, to the Web server: <?php setcookie("LoginName...
2016-11-04, 271👍, 0💬

Receiving a Cookie from the Browser in PHP
How To Receive a Cookie from the Browser in PHP? If you know that a cookie has been sent to the browser when it was visiting the server previously, you can check the built-in $_COOKIE array, which contains all cookies that were sent by the server previously. The script below shows you how to pickup ...
2016-11-04, 265👍, 0💬

Setting a Persistent Cookie in PHP
How To Set a Persistent Cookie in PHP? If you want to set a persistent cookie, you can use the setcookie() function with an extra parameter to specify its expiration time. To follow sample script sets 2 persistent cookies to be expired within 7 days: setcookie("LoginName","FYICent er");setcookie("Pr...
2016-11-04, 263👍, 0💬

Removing a Cookie in PHP
How To Remove a Cookie in PHP? Once a cookie is sent from the server to the browser, there is no direct way for the server to ask the browser to remove the cookie. But you can use the setcookie() function to send the same cookie to browser with a negative expiration time, which will cause the browse...
2016-11-03, 297👍, 0💬

Testing Persistent Cookies in PHP
How To Test Persistent Cookies in PHP? If you want to test persistent cookies, you can copy the following PHP script, setting_persistent_cookies.php ,to your Web server: <?php setcookie("LoginName","FYICent er");setcookie("PreferredColor","Bl ue");setcookie("CouponNumber","0747 0433",time()+60*60*...
2016-11-03, 285👍, 0💬

Domain and Path Attributes for Cookies in PHP
What Are Domain and Path Attributes for Cookies in PHP? Cookies can also be defined with two other attributes: Domain - A cookie attribute that defines the domain name of Web servers where this cookie is valid. Web browsers holding this cookie should not sent it back to any Web server outside the sp...
2016-11-03, 272👍, 0💬

Mistake on Setting Cookie Path and Domain in PHP
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies in PHP? A common mistake made by many PHP developers is using an empty string for the expiration time parameter when setting path and domain for temporary cookies. The PHP script below shows an example of this mistake: <...
2016-11-03, 267👍, 0💬

Specifying Domain and Path for a Cookie in PHP
How To Specify Domain and Path for a Cookie in PHP? If you want to specify domain and path for cookie, you can use the setcookie() function with two extra parameters. The sample PHP script below shows you how to set the domain and path attributes for temporary and persistent cookies: <?php setcoo...
2016-11-03, 264👍, 0💬

Cookies Transported from Servers to Browsers in PHP
How Cookies Are Transported from Servers to Browsers in PHP? Cookies are transported from a Web server to a Web browser in the header area of the HTTP response message. Each cookie will be included in a separate "Set-Cookie:" header line in the following format: Set-Cookie: name=value; expires=time;...
2016-11-02, 263👍, 0💬

Deleting Cookie Files in PHP
How To Delete Cookie Files on Your Computer in PHP? A simple way to delete cookie files on your computer is to use the function offered by the IE browser. The following tutorial exercise shows you how to delete cookie files created by IE: Open IE (Internet Explorer) Go to Options/Internet Options Cl...
2016-11-02, 262👍, 0💬

Cookie Files Stored on Your Computer in PHP
Where Are the Persistent Cookies Stored on Your Computer in PHP? The location and file names where persistent cookies are stored on your computer depend on which browser you are using. If you using Microsoft Internet Explorer, persistent cookies are stored in the \Documents and Settings\$user\Cookie...
2016-11-02, 260👍, 0💬

Cookies Transported from Browsers to Servers in PHP
How Cookies Are Transported from Browsers to Servers in PHP? Cookies are transported from a Web browser to a Web server in the header area of the HTTP request message. Each cookie will be included in a separate "Cookie:" header line in the following format: GET / HTTP/1.1 Cookie: name1=value1 Cookie...
2016-11-02, 260👍, 0💬

<< < 6 7 8 9 10 11 12 13 14 15 16 > >>   Sort: Rank