PHP Programming Classic 300 cases, 第1-5 example

Source: Internet
Author: User

First example
<?php

$s _html= "<b> text bold it1994.cn</b>";
echo $s _html;
?>
second Case
<?php

$s _javascript=<<<start
<script type= "Text/javascript" >
alert ("it1994.cn");
</script>
start;
echo $s _javascript;
?>
third column
<?php

$a = "name";
$ $a = "Hello php";
echo $name;
?>
Fourth Case
<?php

$color = "";
echo "<ul>";
For ($i =1; $i <=10; $i + +)
{
if ($i%2==0)
       {
$color = "Red";
}else
          {
$color = "Yellow";
          }
echo "<li style= ' background:". $color. "; width:200px ' > ". $i." Line </li></ul> ";
}
?>
Fifth Case
index.php page:

<form action= "check.php" method= "POST" >
User name: <input type= "text" name= "user"/><br/>
Password: <input type= "password" name= "pass"/><br/>
<input type= "Submit" value= "Submission"/>
<input type= " reset" value= "reset"/>
</form>

check.php page:
<?php

if (Isseet ($_post))
{
if ($_post[' name ']== ' admin ' && $_post[' pass ']== ' admin ')
    {
echo "User login successful";
}else{
echo "User login failed";
    }
    
}

?>

This article is from the "Zhongze" blog, make sure to keep this source http://8281493.blog.51cto.com/8271493/1622515

PHP Programming Classic 300 cases, 第1-5 example

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.