Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHP°²×°³ÌÐòÖÆ×÷

<?php
header("Content-type:text/html;charset=gb2312"); //¿´ÄãÓõÄÊÇʲô±àÂ룬Ҫ±£³ÖÒ»Ö¡£
$files="config.php"; //ҪдÈëµÄÅäÖÃÎļþ¡£
if(!is_writable($files)){ //ÅжÏÊÇ·ñÓпÉдµÄȨÏÞ£¬linux²Ù×÷ϵͳҪעÒâÕâÒ»µã£¬windows²»±Ø×¢Òâ¡£
echo "<font color=red>Îļþ²»¿Éд</font>";
exit();
}
if($_POST['install']){ //»ñÈ¡Óû§Ìá½»µÄÊý¾Ý¡£
$host=$_POST['host'];
$user=$_POST['user'];
$password=$_POST['password'];
$dbname=$_POST['dbname'];

$config="<?php "; //$configµÄÄÚÈݾÍÊÇҪдÈëÅäÖÃÎļþµÄÄÚÈÝ¡£
$config.="\n"; // \nÊÇÓÃÀ´»»Ðеġ£
$config.="\$host='".$host."';";
$config.="\n";
$config.="\$user='".$user."';";
$config.="\n";
$config.="\$password='".$password."';";
$config.="\n";
$config.="\$dbname='".$dbname."';";
$config.="\n";
$config.="?>";

$file = fopen($files, "w"); //ÒÔдÈëµÄ·½Ê½´ò¿ªconfig.phpÕâ¸öÎļþ¡£
fwrite($file,$config); //½«ÅäÖÃÐÅϢдÈëconfig.phpÎļþ¡£
fclose($file);
include_once("config.php"); //µ¼ÈëÅäÖÃÐÅÏ¢.
if(!$conn=@mysql_connect($host,$user,$password)){
echo "Á¬½ÓÊý¾Ý¿âʧ°Ü£¡Çë·µ»ØÉÏÒ»Ò³¼ì²éÁ¬½Ó²ÎÊý <a href="javascript:history.go(-1)" mce_href="javascript:history.go(-1)"><font color=#ff0000>·µ»ØÐÞ¸Ä</font></a>";
exit();
}else{
mysql_query("set names gb2312"); //ÉèÖÃÊý¾Ý¿âµÄ±àÂ룬עÒâÒªÓëÇ°ÃæÒ»Ö¡£
if(!mysql_select_db($dbname,$conn)){ //Èç¹ûÊý¾Ý¿â²»´æÔÚ£¬ÎÒÃǾͽøÐд´½¨¡£
$dbsql="CREATE DATABASE `$dbname`";
if(!mysql_query($dbsql)){
echo "´´½¨Êý¾Ý¿âʧ°Ü£¬ÇëÈ·ÈÏÊÇ·ñÓÐ×ã¹»µÄȨÏÞ£¡<a href="javascript:history.go(-1)" mce_href="javascript:history.go(-1)"><font color=#ff0000>·µ»ØÐÞ¸Ä</font></a>";
exit();
}
}
//ÏÂÃæ¸ù¾ÝÄãʵ¼ÊµÄ±íµÄ½á¹¹¸ú³õʼ»¯±íµÄÊý¾ÝÀ´Ð´£¬ÕâЩsqlÓï¾ä£¬ÎÒÃÇÔÚµ¼³öʱ¿ÉÒÔÕÒµ½¡£
//н¨Ò»¸ö±ítest1
$sql_query[] = "CREATE TABLE `test1` (
`id` int(4) NOT NULL auto_increment,
`name` varchar(


Ïà¹ØÎĵµ£º

PHPÖлùÓÚMVCģʽµÄСÐÍÏîÄ¿×ܽá

×î½ü×öÁ˼¸¸öСÐ͵ÄÏîÄ¿£¬±È½Ï¼òµ¥£¬Ö»ÊÇÐèҪϸÐÄ£¬¶¼¿ÉÒÔÍê³É£¬Ö÷ÒªÊǶÔMVCģʽµÄÊìÁ·Ó¦Ó㬶ÔWEBÀ࿪·¢»¹ÊǺÜÓаïÖúµÄ¡£
¸Õ¿ªÊ¼µÄµÚÒ»¸öСÏîÄ¿£¬ÓÃÀ´Á·ÊÖ£¬È»ºóÎÒÈ«²¿ÊÇÁ÷³Ì»¯µÄ±à³Ì¡£´úÂëÒ²¾Í400ÐÐ×óÓÒ¡£½á¹ûÎҵĵ¼Ê¦£¬¾õµÃ´úÂë½á¹¹²»ÇåÎú£¬²»ÈÝÒ×
ά»¤£¬ÐèÒªÐ޸ġ£ÐèÒªÎÒ²ÉÓÃOOÀàµÄ±à³Ì·½Ê½½øÐиÄд¡£ÎÒÒÔǰдPHP£¬¼¸ ......

phpÖÐ__FILE__³£Á¿Ó÷¨¼ò½é

1.phpÖеÄ__FILE__³£Á¿·µ»ØÎļþµÄÍêÕû·¾¶ºÍÎļþÃû.
2.dirname(__FILE___) º¯Êý·µ»ØµÄÊǽű¾ËùÔÚÔڵķ¾¶¡£
±ÈÈçÎļþ b.php °üº¬ÈçÏÂÄÚÈÝ£º
<?php
$basedir = dirname(__FILE__);
?>
Èç¹ûb.php±»ÆäËûĿ¼ÀïµÄa.phpÎļþrequire »òÕß include È¥ÒýÓõĻ°¡£
±äÁ¿?$basedir µÄÄÚÈÝ»¹ÊÇb.phpËùÔÚµÄÄǸöÎļþ¼Ð ......

php soap


Ô­ÎÄת×Ô £ºhttp://home.phpchina.com/space.php?uid=49655&do=blog&id=182488
Ò»£® ±Ø±¸ÖªÊ¶
1.wsdl(web·þÎñ±ê¼ÇÓïÑÔ)
       WSDL£¨ÍøÂç·þÎñÃèÊöÓïÑÔ£¬Web Services Description Language£©ÊÇÒ»ÃÅ»ùÓÚ XML
µÄÓïÑÔ£¬ÓÃÓÚÃèÊö Web Services ÒÔ¼°ÈçºÎ¶ÔËüÃǽøÐзÃÎÊ¡£
  ......

php ×Ö·û´®²Ù×÷º¯ÊýÏê½â

×Ö·û´®µÄ²Ù×÷ÔÚPHP±à³ÌÖÐÕ¼ÓÐÖØÒªµÄµØ룬¼¸ºõËùÓÐPHP½Å±¾µÄÊäÈëºÍÊä³ö¶¼Óõ½×Ö·û´®¡£ÓÈÆäÔÚPHPÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÎªÁËʵÏÖijÏÄÜ£¬¾©³ÇÐèÒª¶ÔijЩ×Ö·û´®½øÐÐÌØÊâ´¦Àí£¬Èç»ñÈ¡×Ö·û´®µÄ³¤¶È¡¢½ØÈ¡×Ö·û´®¡¢Ìæ»»×Ö·û´®µÈ¡£ËùÒÔÕâÒ²ÊÇÎÒÃǽñÌì¿Î³ÌµÄÖ÷ÒªÄÚÈÝ£¬Ï£ÍûѧԱ¿ÉÒÔÈÏÕæѧϰ£¬ÇÚ¼ÓÁ·Ï°¡£
8.3.1 È¥³ý×Ö·û´®Ê×λ¿Õ¸ñºÍÌØÊ ......

PHPÓÃÓʼþÈ¡»ØÍü¼ÇÃÜÂ빦ÄÜ£¿

wangjimima.php
<form id="form1" name="form1" method="post" action="mailto.php" onSubmit="return CheckForm()">
<input name="username" type="text" class="in" id="username" size="30" onmouseover="fEvent('mouseover',this)" onfocus="fEvent('focus',this)" onblur="fEvent('blur',this)" onmouseout ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ