PHP Learning notes (i) PHP templates and controllers
Source: Internet
Author: User
<span id="Label3"></p><p><p>/welcome/index.php<br></p></p><pre class="brush:php;toolbar:false"><pre class="brush:php;toolbar:false"><?php if (!isset ($_request[' fn ')) {include ' from.html.php ';} Else{$firstname = $_request[' fn ']; $lastname = $_request[' LastName '];if ($firstname = = ' Sun ' and $lastname = = ' elder brother ') {$aa = ' Welcome to login ' , My king! ‘;} ELSE{$AA = ' Welcome login '. Htmlspecialchars ($firstname, ent_quotes, ' UTF-8 '). Htmlspecialchars ($lastname, ent_quotes, ' UTF-8 '). '! ‘;} Include ' welcome.html.php ';}? ></pre></pre><p><p>Notes:</p></p> <ul class="list-paddingleft-2" style="list-style-type:disc;"> <ul class="list-paddingleft-2" style="list-style-type:disc;"> <li><p>Isset is a PHP built-in function that determines whether a particular variable has been assigned a value, is true, does not have a false.</p></li> <li><p>! is a non-operator and is Negative.</p></li> <li><p>$_request[' LastName ') is the array to Get.</p></li> <li><p>Htmlspecialchars converts special HTML characters into entities for PHP built-in Functions.</p></li> <li><p>ent_quotes PHP constants, telling Htmlspecialchars to convert single and double quotes in addition to other special Characters.</p></li> <li><p>UTF-8 tells PHP what character to interpret the text passed to Him.<br></p></li> </ul> </ul><p><p><br></p></p><p><p>/welcome/from.html.php</p></p><pre class="brush:php;toolbar:false"><pre class="brush:php;toolbar:false"><body><form action= "" method= "post" ><div><label for= "firstname" >first name:<input type= " Text "name=" fn "id=" fn "></label></div><div><label for=" lastname ">last name:<input Type= "text" name= "lastname" id= "lastname" ></label></div><div><input type= "submit" value= " Submit "/></div></form></body></pre></pre><p><p>The Action property is empty, telling the browser to submit the form to the same URL that accepts the FORM.</p></p><p><p><br></p></p><p><p>/welcome/welcome.html.php</p></p><pre class="brush:php;toolbar:false"><pre class="brush:php;toolbar:false"><body><?php Echo $aa;? ></body></pre></pre><p><p><br></p></p><p><p>This article is from the "cocoa sauce data collection room" blog, reproduced please contact the author!</p></p><p><p>PHP Learning notes (i) PHP templates and controllers</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.