note 88633 added to control-structures.switch
| From: | alper at bacombilgisayar dot com | Date: | Sun, 01 Feb 2009 23:30:48 +0000 |
| Subject: | note 88633 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150077@lists.php.net to get a copy of this message | ||
you may use the safe list for form variables.. like that,
switch($_GET['filename']) {
case "mainpage":
case "blabla":
case "blahbla":
break;
default:
$_GET['filename'] = "mainpage";
}
now we can use safety
$file=fopen("pages/".$_GET['filename'].".html", "w");
....
..
----
Server IP: 139.179.10.17
Probable Submitter: 78.173.219.222
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/88633
Del: integrated -- https://master.php.net/note/delete/88633/integrated
Del: useless -- https://master.php.net/note/delete/88633/useless
Del: bad code -- https://master.php.net/note/delete/88633/bad+code
Del: spam -- https://master.php.net/note/delete/88633/spam
Del: non-english -- https://master.php.net/note/delete/88633/non-english
Del: in docs -- https://master.php.net/note/delete/88633/in+docs
Del: other reasons-- https://master.php.net/note/delete/88633
Reject -- https://master.php.net/note/reject/88633
Search -- https://master.php.net/manage/user-notes.php