易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP获取radio值,并用作参数查询数据库,同一页面显示

/***************************by garcon1986************************************/
<?php
error_reporting(E_ALL ^ E_NOTICE);
//create database test
//create table php_radio(id int(10) NOT NULL AUTO_INCREMENT, name varchar(100), description varchar(1000), primary key(id));
//insert php_radio values(1, 'eat','you have eaten ...');
//insert php_radio values(2, 'drink', 'you have drank ...');
//insert php_radio values(3, 'sleep', 'you have sleep ...');
echo "<html><head></head>";
echo "<body>";
echo "<form action='use_radio.php' method='GET'>";
echo "<input type='radio' name='radio' value='eat'>Eat</input>";
echo "<input type='radio' name='radio' value='drink'>Drink</input>";
echo "<input type='radio' name='radio' value='sleep'>Sleep</input>";
echo "<input type='submit' name='search_radio' value='Button' />";
echo "</form>";
$radio_name = $_GET['radio'];
//echo $radio_name;
mysql_connect("localhost","charles","charles");
mysql_select_db("test");
$query = 'select * from php_radio where name = "'.$radio_name.'"';
//echo $query;
$result = mysql_query($query) or die("query error: ".mysql_error());
while($aa = mysql_fetch_assoc($result)){
echo $aa['id']." ";
echo $aa['name']." ";
echo $aa['description']."<br>";
}
//mysql_free_result($result);
echo "</body>";
echo "</html>"
?>


相关文档:

Linux安装apache、php和mysql方法

apache的源码安装 
将压缩包解压之后进入相应的目录
./configure \   #--------------------预编译命令
"--prefix=/usr/local/apache" \  #--------------------安装路径为“/usr/local/apache”
"--with-included-apr" \
"--enable-so" \ #--------------------开启相应的扩展模块 ......

PHP常用函数(1)

原文链接:http://www.phpdo.net/index.php/2010/02/11/1-14/
PHP中获得日期时间信息的函数——Getdate
时间戳:包含了从unix新纪元(1970年1月1 日零时)到给定时间的秒数,是一个长整数。
Getdate函数就是用来获得当前时间,或者用来分析时间戳的具体意义。语法:
Array getdate([int timestamp])
含义:ti ......

PHP分页程序源码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>PHP分页</tit ......

php 基础笔记 functions

/***************************by
garcon1986********************************/
<?php
//example1
$makefoo = true;
bar();
if($makefoo){
function foo(){
echo "doesn't exist.<br>";
}
}
if($makefoo)foo();
function bar(){
echo "exist<br>";
}
//example2
funct ......

php 基础笔记 string

/***************************by
garcon1986********************************/
<?php
// example for strings, single quoted, double quoted
echo 'display a string!<br>';
echo ' this displays
a splitted
string<br>';
echo 'i\'ll be "back"<br>';
echo 'she said:"i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号