Head First PHP & MySQl first chapter of the code

HTML:

<! DOCTYPE HTML > 
< HTML lang = "zh-CN" > 
< head > 
  < Meta charset = "UTF-8" > 
  < title > aliens abducted me - reported kidnapping </ title > 
  < Link rel = "stylesheet" href = "the style.css"  /> 
</ head > 
< body > 
  < h2 > aliens abducted me - kidnapping reported in </ h2 > 

  < the p- >Share your story about being abducted by aliens: </ the p- > 
  <form method="post" action="report.php">
    <label for="name">名字:</label>
    <input type="text" id="tname" name="name" /><br />

    <label for="email">邮箱地址:</label>
    <input type="text" id="email" name="email" /><br />

    <label for="whenithappened">发生的时间:</label>
    <input type="text" id="whenithappened" name="whenithappened" /><br />

    <label for="howlong">你消失了多久:</label>
    <input type="text" id="howlong" name="howlong" /><br />

    <label for="howmany"><>label</Do you see how many aliens:
    input type="text" id="howmany" name="howmany" /><br />

    <label for="aliendescription">描述一下它们:</label>
    <input type="text" id="aliendescription" name="aliendescription" size="32" /><br />

    <label for="whattheydid">他们对你做了什么:</label>
    <input type="text" id="whattheydid" name="whattheydid" size="32" /><br />

    <label for="fangspotted">你看见过我的狗Fang吗?</label>
    见过 <input id="fangspotted" name="fangspotted" type="radio" value="见过" />
    没有 <input id="fangspotted" name="fangspotted" type="radio" value="No "  IMG</>br/> <

    src = "fang.jpg" width = "100" height = "175" 
      alt = "My Dog Fang abducted."  /> < br /> 

    < label for = "OTHER" > If you can say there are other write: </ label > 
    < TextArea ID = "OTHER" name = "OTHER" > </ TextArea > < br /> 


    < INPUT type = "Submit" value = "submit" name = "Submit"  /> 
  </form>
</body>
</html>

 

CSS:

form label {
  display: inline-block;
  width: 225px;
  font-weight: bold;
}

PHP:

<HTML> 
<head> 
    <title> aliens abducted me - reported kidnapped together </ title> 
</ head> 

<body> 
    <h2> aliens abducted me - reported kidnapping </ h2> 

    < ? PHP
     $ name = $ _POST [ 'name'] ;
     $ when_it_happened = $ _POST [ 'whenithappened' ];
     $ how_long = $ _POST [ 'Howlong' ];
     $ how_many = $ _POST [ 'howmany' ];
     $ alien_description = $ _POST [ 'aliendescription' ];
     $ what_they_did = $ _POST [ 'whattheydid'];
    fang_spotted $ = $ _POST [ 'fangspotted' ];
     $ In Email = $ _POST [ 'In Email' ];
     $ OTHER = $ _POST [ 'OTHER' ]; 

    $ to = '@ ** ********** .com ' ;
     $ Subject =' aliens abducted me - kidnapping reports' ;
     $ msg = " $ name was kidnapped at $ when_it_happened and lasted $ how_long \ the n-.." 
        "alien number: how_many $ \ the n-. " 
        alien appearance": $ alien_description . "\ the n- 
        " what they are doing: $ what_they_did \ the n-. "
        "Fang to be seen whether:fang_spotted $ \ the n-. " 
        else": $ OTHER " ; 
  // needs to be installed before you can use sendmail mail () function
mail ( $ to , $ Subject , $ msg , 'the From:'. $ Email ); echo 'Thank you very much the spreadsheet you submitted the ' ; echo ' you were kidnapped at what time of the? '$ when_it_happened..' ' ; echo ' How long will you be away? '. $ how_long .' the ' ; echo ' alien number is how much? '. $ how_many the.' ' ; echo ' alien appearance is what '?.$alien_description.'<br/>'; echo'Aliens did what? '. $ What_they_did .' A ' ; echo ' in Fang not there? '. $ Fang_spotted .' The ' ; echo ' else: '. $ OTHER .' The ' ; echo ' Your e-mail address is: '. $ Email the'. ' ; ? > </ body> </ HTML>

 

Guess you like

Origin www.cnblogs.com/lyd575/p/11105918.html