⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phpl.html

📁 黑客培训教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br><b>&lt;AZTEK> you need the $ before the variables</b>

<br><b>&lt;AZTEK> yep</b>

<br><b>&lt;vanished></b> ya

<br><b>&lt;vanished></b> oops

<br><b>&lt;AZTEK> so</b>

<br><font color="#FF0000">*** Sigma has joined #bsrf</font>

<br><b>&lt;Canticle></b> php have all the same variables that are in perl?

string,hash,array?

<br><font color="#FF0000">*** Mikkkeee sets mode: +v Sigma</font>

<br><b>&lt;AZTEK> for ($i=0;$i&lt;10;$i++)</b>

<br><b>&lt;AZTEK> {</b>

<br><b>&lt;Sigma></b> Thanks Mike

<br><b>&lt;AZTEK> echo "hello";</b>

<br><b>&lt;AZTEK> }</b>

<br><b>&lt;AZTEK> print aout hello untill the variable $i is ten</b>

<br><b>&lt;Sigma></b> php doesn't have a seperate data structure for associative

arrays (hashes). They just let you use strings as keys on any array

<br><b>&lt;AZTEK> yes php has all the same variable</b>

<br><b>&lt;AZTEK> thats correct</b>

<br><b>&lt;Sigma></b> So, @array could be a normal array, or a hash

<br><b>&lt;vanished></b> php is glorified perl basically

<br><b>&lt;Canticle></b> I see ok

<br><b>&lt;AZTEK> scice everytime the code is run the $i++ runs at the

end</b>

<br><b>&lt;Sigma></b> vanished: I agree, but it handles variables and input

so well =)

<br><b>&lt;AZTEK> the for loop will end after 10 times</b>

<br><b>&lt;vanished></b> ya

<br><b>&lt;Canticle></b> from what Ive heard php is basicaly streamlined

for serving content that perl does but faster

<br><b>&lt;Canticle></b> for web pages

<br><b>&lt;vanished></b> php is also a lot more secure :)

<br><b>&lt;AZTEK> yes</b>

<br><b>&lt;AZTEK> not so much</b>

<br><b>&lt;AZTEK> i might get to that later</b>

<br><b>&lt;Canticle></b> flexability = insecure :)

<br><b>&lt;vanished></b> true

<br><font color="#FF0000">*** Duff19 has joined #bsrf</font>

<br><b>&lt;vanished></b> better than straight perl though

<br><b>&lt;AZTEK> it also handles out put better</b>

<br><b>&lt;vanished></b> right

<br><b>&lt;Sigma></b> It's not all that hard to output with perl

<br><b>&lt;vanished></b> no

<br><b>&lt;AZTEK> instead of having to use ssi includes or writing your

whole page in perl</b>

<br><b>&lt;Sigma></b> SSI is slow =\

<br><b>&lt;AZTEK> you can just insert the php tags</b>

<br><b>&lt;AZTEK> example</b>

<br><font color="#FF0000">*** Mikkkeee sets mode: +v Duff19</font>

<br><b>&lt;AZTEK> &lt;title>&lt;?php echo $title; ?>&lt;/title></b>

<br><b>&lt;Canticle></b> curious tho for that page tho where would $title&nbsp;

be defined?

<br><b>&lt;AZTEK> the would put between the html title tags the value of

the variable $title</b>

<br><b>&lt;AZTEK> in an external file</b>

<br><b>&lt;AZTEK> i will get to that later</b>

<br><b>&lt;Canticle></b> ah cool

<br><b>&lt;Sigma></b> Canticle, it might've been in a file, or input from

another webpage

<br><b>&lt;Canticle></b> I see, variables in php pages are persistant from

one to another?

<br><b>&lt;AZTEK> now from the for loop to the while loop</b>

<br><b>&lt;Mikkkeee></b> so whats the output of the &lt;title> a normal

html title?

<br><b>&lt;Canticle></b> sorry :) I got off topic back to loop

<br><font color="#FF0000">* Sigma is afk</font>

<br><font color="#FF0000">*** Sigma is now known as Sigma[a]</font>

<br><b>&lt;AZTEK> &lt;title>Your title&lt;/title></b>

<br><b>&lt;AZTEK> now from the for loop to the while loop</b>

<br><b>&lt;vanished></b> gotta do homework

<br><b>&lt;AZTEK> the while loop folows the syntax of</b>

<br><b>&lt;vanished></b> bbl

<br><font color="#FF0000">*** vanished is now known as vanished[homework]</font>

<br><b>&lt;AZTEK> while(this is true) {</b>

<br><b>&lt;AZTEK> do this</b>

<br><b>&lt;AZTEK> }</b>

<br><b>&lt;AZTEK> so</b>

<br><font color="#FF0000">*** Duff19 has quit IRC (Quit: Leaving)</font>

<br><b>&lt;AZTEK> while($hello="Hi") {</b>

<br><b>&lt;AZTEK> echo "Loop";</b>

<br><b>&lt;AZTEK> }</b>

<br><b>&lt;AZTEK> this will of course never end</b>

<br><b>&lt;AZTEK> and will crash the browser eventully</b>

<br><b>&lt;AZTEK> which is bad</b>

<br><b>&lt;AZTEK> the do is esentilly the same it is</b>

<br><b>&lt;AZTEK> do {</b>

<br><b>&lt;AZTEK> always do this once</b>

<br><b>&lt;AZTEK> } while (do it agian if this is true)</b>

<br><b>&lt;AZTEK> i forgot the ; after the while</b>

<br><b>&lt;AZTEK> so</b>

<br><b>&lt;AZTEK> do {</b>

<br><b>&lt;AZTEK> echo "Hello";</b>

<br><font color="#FF0000">*** Kazzuyo has quit IRC (Quit: K2K)</font>

<br><b>&lt;AZTEK> } while($hello1&lt;4);</b>

<br><b>&lt;AZTEK> this will run once and then run untill the while statment

is false</b>

<br><b>&lt;AZTEK> everyone got it</b>

<br><b>&lt;Canticle></b> I know you did the if/else.. is there a case statement

as well? Case is usualy easier for me to read if there are 3+ choices

<br><b>&lt;AZTEK> yes</b>

<br><b>&lt;AZTEK>&nbsp; i belive</b>

<br><b>&lt;AZTEK> its is</b>

<br><b>&lt;AZTEK> switch($varable) {</b>

<br><b>&lt;AZTEK> case :</b>

<br><b>&lt;AZTEK> default :</b>

<br><b>&lt;AZTEK> }</b>

<br><b>&lt;AZTEK> you know how is goes</b>

<br><b>&lt;Canticle></b> ok cool. :)

<br><b>&lt;AZTEK> now i am going to my final and bigest section</b>

<br><b>&lt;AZTEK> drum roll please</b>

<br><b>&lt;AZTEK> dudududududud</b>

<br><b>&lt;AZTEK> file input/output</b>

<br><b>&lt;AZTEK> this is probly the biggest difference between php and

perl</b>

<br><b>&lt;Paya></b> finaly

<br><b>&lt;AZTEK> to open files in php you use the fopen command</b>

<br><b>&lt;AZTEK> so</b>

<br><b>&lt;AZTEK> the syntax is</b>

<br><b>&lt;Mikkkeee></b> finally

<br><b>&lt;Paya></b> k

<br><font color="#FF0000">*** _052_ has joined #bsrf</font>

<br><b>&lt;AZTEK> $filehandle=fopen("filename","");</b>

<br><b>&lt;AZTEK> sorry i had to get through the other stuff</b>

<br><font color="#FF0000">*** voodoochild has joined #bsrf</font>

<br><font color="#FF0000">*** Mikkkeee sets mode: +v voodoochild</font>

<br><b>&lt;AZTEK> the variable $filehandle contans the memory address of

the open file for easy access</b>

<br><b>&lt;AZTEK> the filename is of course the filename</b>

<br><b>&lt;AZTEK> where the double quotes are</b>

<br><b>&lt;AZTEK> in their there should be one of the following</b>

<br><b>&lt;AZTEK> 'r' - Open for reading only; place the file pointer at

the beginning of the file.</b>

<br><b>&lt;AZTEK> 'r+' - Open for reading and writing; place the file pointer

at the beginning of the file.</b>

<br><b>&lt;AZTEK> 'w' - Open for writing only; place the file pointer at

the beginning of the file and truncate the file to zero length. If the

file does not exist, attempt to create it.</b>

<br><b>&lt;AZTEK> 'w+' - Open for reading and writing; place the file pointer

at the beginning of the file and truncate the file to zero length. If the

file does not exist, attempt to create it.</b>

<br><b>&lt;AZTEK> 'a' - Open for writing only; place the file pointer at

the end of the file. If the file does not exist, attempt to create it.</b>

<br><b>&lt;AZTEK> 'a+' - Open for reading and writing; place the file pointer

at the end of the file. If the file does not exist, attempt to create it.</b>

<br><font color="#FF0000">*** Canticle has left #bsrf</font>

<br><b>&lt;AZTEK> so example</b>

<br><b>&lt;AZTEK> $fh=fopen("hello.txt","r");</b>

<br><b>&lt;AZTEK> would open the file hello.txt for reading</b>

<br><b>&lt;AZTEK> to get the data from that file you use the fread command</b>

<br><b>&lt;AZTEK> the synatx for that is</b>

<br><b>&lt;AZTEK> $store=fread($filehandle,lenght to read to);</b>

<br><font color="#FF0000">*** vanished[homework] is now known as vanished</font>

<br><b>&lt;vanished></b> back

<br><b>&lt;AZTEK> the $store varible is the varible to store the read value

in</b>

<br><font color="#FF0000">*** wishmaster has quit IRC (Quit: )</font>

<br><b>&lt;AZTEK> the file handle is what we defined when we opened the

file</b>

<br><b>&lt;AZTEK> now the length is special</b>

<br><b>&lt;AZTEK> to read the entire file you would put</b>

<br><b>&lt;AZTEK> filesize("hello.txt")</b>

<br><b>&lt;AZTEK> you CAN NOT put the file handle or it wont work</b>

<br><font color="#FF0000">* Mikkkeee says is everyone awake?</font>

<br><b>&lt;AZTEK> so</b>

<br><b>&lt;AZTEK> $hello=fread($fh, filesize("hello.txt"));</b>

<br><b>&lt;AZTEK> reads the entire file hello.txt into the varible $hello</b>

<br><b>&lt;AZTEK> now reading is no fun if we cant write to a file</b>

<br><b>&lt;AZTEK> but first we have to close the file as to not take pressious

ram memory</b>

<br><b>&lt;AZTEK> so we use fclose</b>

<br><b>&lt;AZTEK> the sytax is fclose($filehandle);</b>

<br><b>&lt;AZTEK> simple</b>

<br><font color="#FF0000">*** MANOWAR^ has quit IRC (Quit: Ping timeout)</font>

<br><font color="#FF0000">*** Mikkkeee has left #bsrf</font>

<br><font color="#FF0000">*** Mikkkeee has joined #bsrf</font>

<br><font color="#FF0000">*** ChanServ sets mode: +o Mikkkeee</font>

<br><font color="#FF0000">*** N0S01uti0n has joined #bsrf</font>

<br><b>&lt;AZTEK> now that we have the old file closed we can open the

same file for writing</b>

<br><font color="#FF0000">*** Mikkkeee sets mode: +v N0S01uti0n</font>

<br><b>&lt;AZTEK> so we</b>

<br><b>&lt;N0S01uti0n></b> hey i need a short naritive about drugs/narcotics

for my health class... anyone know where i can get one

<br><b>&lt;N0S01uti0n></b> thanks mike

<br><b>&lt;AZTEK> $fh=fopen("hello.txt","w");</b>

<br><font color="#FF0000">*** DockAlfer has quit IRC (Quit: Good night.)</font>

<br><font color="#FF0000">*** Paya sets mode: +v _medved-</font>

<br><font color="#FF0000">*** Mikkkeee sets mode: +v _052_</font>

<br><font color="#FF0000">*** BootError has quit IRC (Quit: BootError Bot

6.0 Gamma (Shutdown code 3.2 Beta))</font>

<br><b>&lt;AZTEK> then we use the fwrite command</b>

<br><font color="#FF0000">*** G0lD has joined #bsrf</font>

<br><font color="#FF0000">*** Mikkkeee sets mode: +v G0lD</font>

<br><b>&lt;AZTEK> the syntax is fwrite($fh,string to write to file,optional

value of the length to write);</b>

<br><b>&lt;AZTEK> so</b>

<br><b>&lt;AZTEK> fwrite=($fh,"Hello");</b>

<br><font color="#FF0000">* Balle[away] 0,12 Away 0,1 Balle 15is not here

11(0Im sleeping.. goddamit..11) (022:09:38 11)</font>

<br><b>&lt;AZTEK> now some people can see how you could write the contents

of an html form to a file</b>

<br><b>&lt;G0lD></b> does someone in here understand run levels ?

<br><b>&lt;HardW1r3></b> shhhhh lecture

<br><b>&lt;AZTEK> now i am going to write a short followup tut with code

example and i will cover more file i/o</b>

<br><b>&lt;AZTEK> but after you are done writing make sure to close the

file</b>

<br><b>&lt;AZTEK> with fclose($fh);</b>

<br><b>&lt;AZTEK> and that basicly condludes the php lecture</b>

<br><b>&lt;AZTEK> any questions</b>

<br><b>&lt;Mikkkeee></b> damn, i need the whole log

<br><font color="#FF0000">*** Serial_Killer has quit IRC (Quit: ALL FOR

ONE,ONE FOR ALL!!!!!!!)</font>

<br><b>&lt;AZTEK> i will write the follow up in a few days</b>

<br><b>&lt;Paya></b> I have it

<br><b>&lt;AZTEK> i got one</b>

<br><b>&lt;Mikkkeee></b> okay who will mail me the log

<br><b>&lt;Mikkkeee></b> the complete one

<br><font color="#FF0000">*** Mikkkeee sets mode: -m</font>

<br><b>&lt;Mikkkeee></b> okay cut log here

<p><b>&lt;--------------End of lecture------------></b>

<br>&nbsp;

<br>&nbsp;

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -