www.日本精品,久久中文视频,中文字幕第一页在线播放,香蕉视频免费网站,老湿机一区午夜精品免费福利,91久久综合精品国产丝袜长腿,欧美日韩视频精品一区二区

phpЦԒ

l(f)rg:2017-01-18 Դ: ĬЦԒ c

phpЦԒƪһPHPW(xu)(x)ęn

PHP http://phalanger.codeplex.com /1.ʲô PHP PHP ָ PHP:ıA(y)̎gעPHP: Hypertext Preprocessor fw? PHPһN(w)˵_Zԣ ASP ? PHP _ڷ(w)ψ(zh) ? PHP ֺ֧ܶ(sh)(j)죨MySQLInformixOracleSybaseSolid PostgreSQLGeneric ODBC ȵȣ ? PHP һ_Դܛopen source softwareOSS2.ļ ʲô PHP ļPHP ļɰıHTML ˺Լ_ PHP ļg[ؼ HTML PHP ļļY ".php"".php3" ".phtml"3ʲô MySQL  ? MySQL һN(sh)(j)(w) ? MySQL ֧֘˜ʵ SQL ? MySQL Sƽ_Ͼg4PHP+MySQL PHP c MySQL ĽMǿƽ_ ˼ Windows h(hun)M_l(f) Unix ƽ_ṩ (w)5ʲôҪʹ PHP ? PHP ڲͬƽ_\УWindowsLinuxUnix ? PHP cĿǰ׺еڱʹõķ(w)ݣApacheIIS ȣ

? PHP ڌW(xu)(x)ɸЧ\ڷ(w)6 PHP Z <?php ?> PHP _K <?php _ʼ ?> Y(ji)԰ PHP _KęnеκλȻֺ֧ķ(w)ϣʹ <? ?> _ʼͽY(ji)_K7 php ݔıPHP ļͨ HTML ˺һ HTML ļԼһЩ PHP_a҂ṩһκε PHP _g[ݔı "Hello World"ЃɷNͨ^ PHP ݔıĻA(ch)ָecho printУ҂ʹ echo Z ݔı "Hello World"<html> <body><?php echo "Hello World"; ?></body> </html>8 PHP ҂ʹ // עʹ /* */ עጉK9PHP е׃ ׃ڴ惦ֵ电(sh)֡ıַ(sh)MһO(sh)ij׃҂Ϳ_؏(f)ʹPHP е׃ $ ̖_ʼ

PHP O(sh)׃_ǣ$var_name = value;PHP Tӛ׃ǰ $ ̖ǘԒ׃ǟoЧ׌҂ԇ(chung)һַ׃һД(sh)ֵ׃<?php $txt = "Hello World!"; $number = 16; ?>10PHP һTɢ͵ZԣLoosely Typed Language  һTɢ͵Zԣ PHP ҪO(sh)׃֮ǰ•ԓ׃ˣ PHP •ԓ׃Ĕ(sh)(j)(j)׃O(sh)õķʽPHP Ԅӵذ׃D(zhun)Q_Ĕ(sh)(j)ڏ͵ľZУʹǰ•׃ͺQ PHP ׃ʹÕrԄ•11׃Ҏ(gu)t ׃Ҏ(gu)t? ׃ĸ„ "_" _^ ? ׃ֻܰĸ(sh)ַԼ„ ? ׃ܰո׃ɶ~Mô(yng)ԓʹ„Mзָ$my_stringԴĸ_^ $myString12PHP еַ ַ׃ڰֵַڱ̳҂Bׂ PHP ڲַõĺ(sh)\ڄ(chung)ַ֮҂ͿԌMвֱں(sh)ʹַ߰惦׃ 

13\Concatenation Operator \ PHP ֻһַ\\ (.) ڰуɂֵַBҪуɂ׃BһՈʹ@c\ (.) 14ʹ strlen() (sh) strlen() (sh)ӋַL׌҂ַ "Hello world!" LȣַLϢѭh(hun) (sh)УǕr_ַΕrY(ji)ǺҪģѭh(hun)У҂ Ҫַеһַ֮Y(ji)ѭh(hun)<?php echo strlen("Hello world!"); ?>15ʹ strpos() (sh) strpos() (sh)ַ(ni)zһַһַַҵƥԓ(sh)صһƥλδҵƥ䣬t FALSE׌҂ԇһDzַҵַ "world"<?php echo strpos("Hello world!","world"); ?>ϴaݔǣ6҂ַַ "world" λ 6 6 7ַе ׂλõ 0 1

16\fӽY(ji)+Additionx=2 x+24-Subtractionx=2 5-x3*Multiplicationx=4 x*520/Division15/5 5/23 2.5%Modulus (division remainder)5%2 10%8 10%21 2 0++Incrementx=5 x++x=6--Decrementx=5 x--x=4xֵ\\f=x=yx=y+=x+=yx=x+y-=x-=yx=x-y*=x*=yx=x*y/=x/=yx=x/y

phpЦԒƪphpԇ},(jng)phpPԇ}c

}

1 xmĴհ̎

PHP һN_______Z______PHP Á_l(f)ӑB(ti)______(ni)

ͬ߀ɱÁ______Լęn

AӑB(ti)PHP(sh)(j)HTML

BǶʽZendHTMLXML

C Perl PHPWeboB(ti)

DǶʽZendDocbook ęnMySQL

E Zend PHPDHTML

1 ΨһxĴ BPHP һN Zend _ZͨǶ HTML

aСҪÁ_l(f) HTML ęnҲ_l(f)͵ęn

XML

2ķN˺ PHP ʼ/Y(ji)

A<% %>

B//

C<?php ?>

D/* */

E

2 PHP ˂̫ʹ<% %>̓ɂ˺_ǺϷ PHP 綨

˺ǷǷ_Ĵ Dӛס(j) php.ini ļеòͬ@

еijЩ˺oضrʹá

3´aĂ PHP Z

A$_10

B${MyVar}

C&$something

D$10_somethings

E$aVaR

3 PHP ׃һԪ̖_^┵(sh)Ĕ(sh)ĸ„${MyVar}

һϷ׃ʹõ^ɢs&$something nj$something

Ȼ׃Ԕ(sh)֞_^$10_somethings ǷǷ˴ D

4\´a@ʾʲô

define(myvalue, "10");

$myarray[10] = "Dog";

$myarray[] = "Human";

$myarray['myvalue'] = "Cat";

$myarray["Dog"] = "Cat";

print "The value is: ";

print $myarray[myvalue]."\n";

?>

2

AThe Value is: Dog

BThe Value is: Cat

CThe Value is: Human

DThe Value is: 10

EDog

4 ע$myarray Iֵ]д̖LI myvalue ַ

dz myvalue ֵKL$myarray[10]ֵ Dog A

5 print() echo()ʲô^(q)e

Aprint()_ʽһecho()

Becho()_ʽһprint()

Cecho() CLIУ汾 PHP ʹprint()

Dprint() CLIУ汾 PHP ʹecho()

E]Ѕ^(q)eɂ(sh)ӡı

5 M print() echo()ڽ^(sh)r¿ԻQʹ֮g߀һ̎ͬ

print()Ǻ(sh)зֵecho()HһZԽY(ji)(gu)]зֵҲڱ

_ʽʹ A

6_ݔʲô

$a = 10;

$b = 20;

$c = 4;

$d = 8;

$e = 1.0;

$f = $c + $d * 2;

$g = $f % 20;

$h = $b - $a + $c + 2;

$i = $h << $c;

$j = $i * $e;

print $j;

?>

A128

B42

C242.0

D256

E342

6 %\ʾȡģ؃ɂ(sh)(sh)<<\ஔڳ 2

N ηĴ𰸳һc(sh)׃Ĕ(sh)(j)ǣС(sh)c

ݔĽY(ji)С(sh) 256D

7νo׃$a$b $c xֵʹ_@ʾַHello, World!? $string = "Hello, World!";

$a = ?;

3

$b = ?;

$c = ?;

if($a) {

if($b && !$c) {

echo "Goodbye Cruel World!";

} else if(!$b && !$c) {

echo "Nothing here";

}

}

else {

if(!$b) {

if(!$a && (!$b && $c)) {

echo "Hello, World!";

} else {

echo "Goodbye World!";

}

phpЦԒƪPhp+Accessεӛ䛲

WAMP5bɺyԇIIS+PHP5œyԇ_

1 ½access2003(sh)(j)ļdata.mdb(sh)(j)student:

Id(ԄӾ̖),xh,xm,xb,dh,bz

2g[ͨӍdata.mdb(sh)(j)µĔ(sh)(j)ļIndex.php

<?php

$conn=new com("adodb.connection");

$connstr="driver={microsoft access driver (*.mdb)};dbq=".realpath("data.mdb");

$conn->open($connstr);

$rs=new com("adodb.recordset");

$rs->open("select * from student ",$conn,1,1);

?>

<table width=600 align=center border=1>

<tr><td width=100>W(xu)̖ <td width=100><td width=40>Ԅe<td width=100>Ԓ<td>؞</td><td>h<td>݋</td>

<?php

while(!$rs->eof){

$id = $rs->Fields(0)->value;

?>

<tr>

<td><?php echo $rs["xh"];?>

<td><?php echo $rs["xm"];?>

<td><?php echo $rs["xb"];?>

<td><?php echo $rs["dh"];?>

<td><?php echo $rs["bz"];?>

<td><a onclick="return confirm('_Ҫhӛ䛆')" href="dele.php?id=<?php echo $rs["id"];?>">h</a></td>

<td><a href="edit.php?id=<?php echo $rs["id"];?>">݋</a></td>

<?php

$rs->movenext();

}

?>

<a href="add.php"></a>

3ӛļAdd.php

<form action="addins.php" name="myform" method="POST")>

W(xu)̖<input name="xh" id="mytitile" type="text"><br>

<input name="xm" id="mytitile" type="text"><br>

Ԅe<input name="xb" id="mytitile" type="text"><br>

Ԓ<input name="dh" id="mytitile" type="text"><br>

סַ<input name="bz" id="mytitile" type="text"><br>

<input name="mysubmit" id="mysubmit" type="submit" value="ύ" >

</form>

ӛ䛺_ļAddins.php

<?php

$conn = new com("ADODB.Connection");

$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("data.mdb"); $conn->Open($connstr);

$rs = new com("ADODB.RecordSet");

$rs->Open("select * from student",$conn,1,1);//_ӛ䛼

$xh1=$_POST["xh"];

$xm1=$_POST["xm"];

$xb1=$_POST["xb"];

$dh1=$_POST["dh"];

$bz1=$_POST["bz"];

if(empty($xh1)){

echo "<script>alert('W(xu)̖ܞգ');window.history.back(-1);</script>";

}

else{if(empty($xm1)){

echo "<script>alert('ܞ');window.history.back(-1);</script>";

}

}

$conn->execute("insert into [student] (xh,xm,xb,dh,bz)

('$xh1','$xm1','$xb1','$dh1','$bz1')");

echo "<script>alert('ӳɹ');window.location.href='index.php';</script>";

?>

4hӛļDele.php

<?php

$conn = new com("ADODB.Connection");

$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("db1.mdb"); $conn->Open($connstr);

$idh=$_GET['id'];

$query="deletefromtxl where id=$idh";

$result=$conn->Execute($query);

if($result)

echo "<script>alert('hɹ');window.location.href='index.php';</script>"; else

echo "<script>alert('hʧ');window.location.href='index.php';</script>";

?>

5݋ӛļ

(1)ļedit.php

<?php

$conn = new com("ADODB.Connection");

$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("data.mdb"); $conn->Open($connstr);

$rs = new com("ADODB.RecordSet");

$idh=$_GET['id'];

$rs->Open("select * from student where id=$idh",$conn,1,1);//_ӛ䛼 values

?>

<form action="save1.php" name="myform" method="POST")>

<input type="hidden" name="id" value=<?php echo $rs["id"];?>><br>

W(xu)̖<i

phpЦԒ

nput type="text" name="xh" value=<?php echo $rs["xh"];?>><br>

<input type="text" name="xm" value=<?php echo $rs["xm"];?>><br>

Ԅe<input type="text" name="xb" value=<?php echo $rs["xb"];?>><br>

Ԓ<input type="text" name="dh" value=<?php echo $rs["dh"];?>><br>

סַ<input type="text" name="bz" value=<?php echo $rs["bz"];?>><br>

<input name="mysubmit" id="mysubmit" type="submit" value="ύ" >

</form>݋޸ĺĺ_ļmodify.php

<?php

$conn = new com("ADODB.Connection");

$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=".realpath("data.mdb"); $conn->Open($connstr);

//$rs = new com("ADODB.RecordSet");

//$rs->Open("select * from student",$conn,3,3);//_ӛ䛼

$idh=$_POST["id"];

$xh1=$_POST["xh"];

$xm1=$_POST["xm"];

$xb1=$_POST["xb"];

$dh1=$_POST["dh"];

$bz1=$_POST["bz"];

$sql="update student set xh='$xh1',xm='$xm1',xb='$xb1',dh='$dh1',bz='$bz1' where id=".$idh; $resulte = $conn->Execute($sql);

if($resulte)

echo "<script>alert('޸ijɹ');window.location.href='index.php';</script>"; else

echo"hʧ";

header("location:index.php");

?>

P(gun)~ЦԒ php phpЦԒW(wng)վԴa ЦԒȫ Ц

cx

(qun) ѹӢժ m.newchangjing.com