這樣就算會了PHP嗎?-6

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   os   ar   使用   for   

關於PHP與WEB表單互動的CASE,十多年前沒拾起來啊。

下一步進入JS與PHP的互動。。。

<form name="form1" method="post" action="info.php"><textarea name="a" cols="20" rows="3" wrap="soft">我使用的是軟斷行符號,我輸出後不換行!</textarea><br><textarea name="b" cols="20" rows="3" wrap="hard">我使用的是硬斷行符號,我輸出後自動換行!</textarea><br>sex:<input name="sex" type="radio" value="1" checked> 男<input name="sex" type="radio" value="0">女<br><table width="445" cellpadding="0" cellspacing="0">    <tr>        <td width="443" height="41" align="center" valign="top">            你喜歡的圖書類型:            <input type="checkbox" name="mrbook[]" value="入門類">入門類            <input type="checkbox" name="mrbook[]" value="安全類">安全類            <input type="checkbox" name="mrbook[]" value="專業類">專業類        </td>    </tr></table><br><input type="file" name="file" size="15"><br><input type="submit" name="Submit" value="提交"></form><a href="info.php?id=<?php echo urlencode("編程詞典");?>">PHP編程詞典</a><?php echo "您提交的查詢字串內容是:".urldecode($_GET[id]); ?><?php    echo nl2br($_POST[a])."<br>";    echo nl2br($_POST[b]);    echo "<br>";    if (($_POST[sex] != null)){        echo "你選擇的性別為:".$_POST["sex"];    }    if (($_POST[mrbook] != null)){        echo "你選擇的結果是:";        for ($i=0; $i<count($_POST[mrbook]); $i++)            echo $_POST[mrbook][$i]."&nbsp;&nbsp;";        }    echo "<br>";    if (($_POST[file] != null)){        $path = ‘./‘;        move_uploaded_file($_FILES[file],$path);        echo "你上傳的檔案為:".$_POST["file"];    }?>

這樣就算會了PHP嗎?-6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.