中国网络水泥 发表于 2017-3-21 11:22:55

PHP的入门总结

  1.Apache2.2这是部署PHP的服务器,可是部署的时候还得配合例如php-5.2.5-Win32版本的配置。
  2.Zend Studio - 8.0.1是开发php的不错的一套软件。
  3.总结
  1)include用法
  <?php
include "from_city.php";
?>

  2)定义变量
  $valid_arg=false;

  3)读取数据库
  <?php
$conn=mysql_connect('localhost','root','root');
mysql_select_db('poti');
$sql="select * from flights where route_no <>0";
$result=mysql_query($sql);
?>

<select id="to_city" name="to_city">>
<option></option>
<?php
while($row=mysql_fetch_row($result)){
echo"<optionvalue=$row>$row</option>\n";
}
?>
</select>

  4)获取浏览器地址栏的参数的判断
  if ($_REQUEST['from_city'])

  {}
  5)提交post的过来的参数
  <?php echo $_POST["name"]; ?>

  6)onclick点击直接跳转的
  <input type="button" value="Book more Flights">

  

  

  
页: [1]
查看完整版本: PHP的入门总结