|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Web Coding | |
[PHP] Globals Help
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#2 (permalink) | |||||||||||
|
PC Gamer
|
I *think* you have to iterate over it, like this:
__________________foreach ($_POST as &$v) $v=mysql_real_escape_string($v); (edit: damn. If you put tags around PHP code [that can be evaluated] here, it'll get executed.)
Last edited by Coma : 03-18-08 at 09:18 PM. |
|||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||||
|
Programmer
|
Quote:
PHP Code:
|
||||||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
AMD Overclocker
|
This is what I use for my scripts
![]() <?php //include into your mysql script if($_POST) $_POST = array_map('mysql_real_escape_string',array_map('ht mlspecialchars',$_POST)); if($_GET) $_GET = array_map('mysql_real_escape_string',array_map('ht mlspecialchars',$_GET)); if($_COOKIE) $_COOKIE = array_map('mysql_real_escape_string',array_map('ht mlspecialchars',$_COOKIE)); ?> Of course this forum screws up the "htmlspecialchars" it's actually all one word.
__________________
My s939 rig build log thread - 4600+ @ 2.8Ghz stable ![]() Aumotocnic "An unfortunate member of the overclock.net insomnia club" Quebec Overclockers - 8019 in 3dMark06s939 Manny 4600+ @ 2809Mhz @ 1.425V (9 hours Orthos blend test stable - 24/7 Usage) - http://valid.x86-secret.com/show_oc.php?id=289741 @ 2945Mhz @ 1.45V (YAY! - Not stable, doh!) - http://valid.x86-secret.com/show_oc.php?id=276669
Last edited by Starholdest : 03-21-08 at 12:28 AM. |
|||||||||||||
|
|
|
|
#6 (permalink) | |||||||||||||
|
Programmer
|
If you're just going through an array, using foreach will be slightly faster.
__________________
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|