PHP ÖÆ×÷ͨѶ¼£¨Èý£©
ÉÏһƪÎÒÃǽ²µ½Á´½Óµ½ Edit.php?id= À´ÐÞ¸ÄÊý¾Ý£¬ºóÀ´ÎÒÏëÁËһϣ¬ÆäʵҲ¿ÉÒÔÖ±½ÓÀûÓà Input.php À´ÐÞ¸ÄÊý¾Ý£¬ÕâÑù¸üÈÝÒ×¹ÜÀí£¬½ÚÊ¡Á˲»±ØÒªµÄ¿Õ¼ä
Input.php¿ÉÒÔÕâÑùÁ´½Ó£ºInput.php?id=[Num]&action=[Num]
id¼´¼Ç¼ID£¬Ä¬ÈÏΪ-1
actionΪ¶¯×÷£¬Ä¬ÈÏΪ0 £¬ Ϊ0ʱ´ú±íÌí¼ÓеļǼ£¬Îª1ʱÔòÐ޸ļǼ
Input.phpÖвåÈëPHP´úÂ룺
<?php
//ÏÈÉ趨ĬÈÏÖµ
$id = -1; //-1´ú±íÊÇÌí¼ÓÊý¾Ý
$action = 0; //0´ú±íÌí¼ÓÊý¾Ý£¬1£ºÐÞ¸ÄÊý¾Ý
$formAction = "Post.php"; //±íµ¥µÄaction
if($_GET['id']!=null)
$id = $_GET['id'];
if($_GET['action']!=null)
$action = $_GET['action'];
if($id!=-1 && $action!=0)
{
$formAction = "Post.php?id=$id&action=$action";
$sql = "SELECT * from `AddrList` WHERE Id=$id";
require('conn.php');
$row = MySQL_fetch_row($result);
$name = $row[1];
$sex = $row[2];
$birthday = $row[3];
$qq = $row[4];
$mobile = $row[5];
$email = $row[6];
$address = $row[7];
}
?>
Post.phpÖмÓÈ룺
$action = 0; //´«À´µÄ¶¯×÷,ĬÈÏΪÌí¼Ó¼Ç¼£¬0£ºÌí¼Ó £» 1£ºÐÞ¸Ä
$id = $_GET['id'];
if($_GET['action']!=null)
$action = $_GET['action'];
....
else if($action==1)
{
$sql = "UPDATE `mydb`.`addrlist` SET
`Name` = '$name',
`Sex` = '$sex',
`Birthday` = '$birthday',
`QQ` = '$qq',
`Mobile` = '$mobile',
`Email` = '$email',
`Address` = '$address'
WHERE Id = $id";
}
½ñÌì¾Íµ½´ËΪֹ£¬¹ØÓÚ¸ü¶àÇë¿´Ô´Â룬ԴÂëÎÒÒѾ´ò°üÉÏ´«ÁË
AddressBook 2010-4-25ÐÞ¸Ä.rar
Ïà¹ØÎĵµ£º
Èç¹ûÄúÉÐδ´òËãÓà OO ÔÔò´´½¨Ó¦ÓóÌÐò£¬ÔòʹÓà PHP µÄÃæÏò¶ÔÏó£¨OO£©µÄÓïÑÔÌØÐÔ£¬Õâ 7 ¸öÏ°¹ß½«°ïÖúÄú¿ªÊ¼ÔÚ¹ý³Ì±à³ÌÓë OO ±à³ÌÖ®¼ä½øÐÐת»»¡£
ÔÚ PHP ±à³ÌÔçÆÚ£¬PHP ´úÂëÔÚ±¾ÖÊÉÏÊÇÏÞÓÚÃæÏò¹ý³ÌµÄ¡£¹ý³Ì´úÂë µÄÌØÕ÷ÔÚÓÚʹÓùý³Ì¹¹½¨Ó¦ÓóÌÐò¿é¡£¹ý³Ìͨ¹ýÔÊÐí¹ý³ÌÖ®¼äµÄµ÷ÓÃÌṩijÖ̶ֳȵÄÖØÓá£
µ«ÊÇ£¬Ã»ÓÐÃæÏò¶ÔÏóµÄÓï ......
ÓÐÖÖ˵·¨£ºPHPÊÇ×î¼òµ¥µÄÍøÕ¾¿ª·¢ÓïÑÔ£¬ÕâÖÖ¹ÛµãÊÇ´íµÄ¡£
ľͷ±È»ýľ¼òµ¥£¬µ«Ä¾½³ºÍº¢×ӵIJî±ðÊÇľ½³ÄÜ°ÑľͷºÍ»ýľ¶¼±ä³É·¿×Ó£¬º¢×ÓÖ»ÄÜ°Ñ»ýľ±ä³É·¿×Ó£¬¶ÔÓÚľͷËûÃÇÖ»ÄÜÔÚÉÏÃ滸ö·¿×Ó¶øÒÑ¡£
PHP¾ÍÏñľͷ£¬²ËÄñÖ»ÄÜÓÃËü×öµã¼òµ¥µÄÊÂÇ飬¸ßÊ־ͻá°ÑËü±ä³ÉÎÞËù²»ÄÜ¡£
¼ÈÈ»PHP¼òµ¥ÓÖÊǸßÊÖìÅÒ«µÄ¶«Î÷£¬ÄÇÔõôѧ²ÅÄܱä³É¸ ......
ÉÏһƪÖУ¬¼òµ¥Ð´Á˸öInput.php £¬ µ«ÉúÈÕÄÇÒ»À¸Òª×Ô¼ºÊÖ¶¯ÊäÈëд£¬±È½ÏÂé·³£¬ËùÒÔÕâÀïÓõ½Ò»¸öJSÎļþ£¬¿ÉÒÔÑ¡ÔñÈÕÆÚ
µã»÷ÏÂÔØÕâ¸öjsÎļþ
ÔÚInput.phpÎļþ×¶ËÒýÓÃÕâ¸öJSÎļþ
<script type="text/javascript" src="calenderJS.js"></script>
½«ÉúÈÕµÄÊäÈë¿ò¸Ä³É
<input name="birthday" type="text" ......
´úÂëÈçÏÂ:
<?php
/* ÍøÕ¾ÑéÖ¤Âë³ÌÐò
* ÔËÐл·¾³£º PHP5.0.18 ϵ÷ÊÔͨ¹ý
* ÐèÒª gd2 ͼÐοâÖ§³Ö£¨PHP.INIÖÐ php_gd2.dll¿ªÆ ......
ÈçÏÂphp´úÂë
<?php
$type='a';
$target='type';
$a=array(1,2,3);
a($target);
function a($type)
{
global $$type;
var_dump($$type);
}
?>
Ô¤¼ÆÊä³öµÄÊÇstring(1)”a”
¿ÉÊǽá¹ûÊÇ
Notice: Undefined variable: a in D:\web\global.php on ......