At the beginning of its development, by default the global registers in the set of On the
tujuang to give the user ease in learning PHP, so that users can take / call variable simply by mentioning the name variables, no matter whether the variable comes from GET, POST, COOKIE, or SESSION. An example script follows:
Scripts "globalon.php"
1: <? Php
2: echo "<form method=GET action=globalon.php>
3: Enter your name: <input type=text name='nama'>
4: <input type=submit name=oke value=kirim> </ form> ";
5: if ($ ok == 'send') {
6: echo "Your name is: <b> $ name </ b>";
7: }
8: ?>
However, since version 4.3.X and above, then the default value of global register = Off, so if globalon.php script is run, it will not produce anything. So for the script to run on register globals = Off, it is necessary variables to be adjusted as follows:
1: <? Php
2: echo "<form method=GET action=globalon.php>
3: Enter your name: <input type=text name='nama'>
4: <input type=submit name=oke value=kirim> </ form> ";
5: if ($ _GET [OK] == 'send') {
6: echo "Your name is: <b> $ _GET [name] </ b>";
7: }
8: ?>
Note the source of the variable, when using the method / POST parameters,
then calling the variables: $ _POST ['nama_varibel'].
If the source of the variables taken from the variables that brought the Address bar,
for example: http://localhost/modul/globalon.php?nama=Amikom, then writing
variables: $ _GET ['nama_variabel'].
The syntax of variables such as $ _ENV, $ _GET, $ _POST, $ _COOKIE, $ _SESSION,
$ _FILES And $ _SERVER is also often called superglobal or autoglobal,
means that these variables can walk anywhere, no matter whether the register
global On or Off.
Technorati Tags: Register,Global,development,user,users,POST,COOKIE,SESSION,example,script,Scripts,method,action,Enter,text,size,Consolas,Courier,Monospace,margin,width,version,_GET,Note,parameters,_POST,Amikom,syntax,_ENV,_COOKIE,_SESSION,_FILES,_SERVER,variables,whether,globalon,nama,kirim,csharpcode,ffffff,kwrd,preproc,html,attr,lnum
Windows Live Tags: Register,Global,development,user,users,POST,COOKIE,SESSION,example,script,Scripts,method,action,Enter,text,size,Consolas,Courier,Monospace,margin,width,version,_GET,Note,parameters,_POST,Amikom,syntax,_ENV,_COOKIE,_SESSION,_FILES,_SERVER,variables,whether,globalon,nama,kirim,csharpcode,ffffff,kwrd,preproc,html,attr,lnum
WordPress Tags: Register,Global,development,user,users,POST,COOKIE,SESSION,example,script,Scripts,method,action,Enter,text,size,Consolas,Courier,Monospace,margin,width,version,_GET,Note,parameters,_POST,Amikom,syntax,_ENV,_COOKIE,_SESSION,_FILES,_SERVER,variables,whether,globalon,nama,kirim,csharpcode,ffffff,kwrd,preproc,html,attr,lnum
Blogger Labels: Register,Global,development,user,users,POST,COOKIE,SESSION,example,script,Scripts,method,action,Enter,text,size,Consolas,Courier,Monospace,margin,width,version,_GET,Note,parameters,_POST,Amikom,syntax,_ENV,_COOKIE,_SESSION,_FILES,_SERVER,variables,whether,globalon,nama,kirim,csharpcode,ffffff,kwrd,preproc,html,attr,lnum
2 comments:
nice blog..
keep posting bro..
http://blajar-komputer.blogspot.com/
:D thanks bro
Post a Comment
thank you for visiting my blog and comment here. I hope the commentary contains a comment which intend to build and repair. criticism and suggestions I gladly accept.