Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

PHP: SQL Injections


  • Please log in to reply
17 replies to this topic

#13 Ricardo-san

Ricardo-san

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 50 posts

Posted 08 April 2009 - 03:05 PM

Thanks, excellent article. Learned quite a lot.
  • 0

#14 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 08 April 2009 - 04:30 PM

I am glad you liked it. :)
  • 0

#15 kailas

kailas

    CC Newcomer

  • Just Joined
  • PipPip
  • 15 posts

Posted 12 February 2010 - 12:34 PM

thanks for the clear tutorial
  • 0

#16 fyhring4

fyhring4

    CC Newcomer

  • Just Joined
  • PipPip
  • 12 posts

Posted 24 October 2010 - 01:43 AM

Instant of using the function array_map can't you use the foreach function?
Like this:

foreach($_GET as $key => $value){
if(get_magic_quotes_gpc()){
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}else{
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}
}


Or is it better without get_magic_quotes_gpc()?


foreach($_GET as $key => $value){
$_GET[$key] = stripslashes($value);
$_GET[$key] = mysql_real_escape_string($value);
}

  • 0

#17 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 24 October 2010 - 01:54 AM

@fyhring4: You can use foreach, but array_map relies on slightly more internal principles, atleast in development less code is often better, especially if it is more efficient. Your code makes not very much sense though, you may wish to wrap that reusable code in a function.
  • 0

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#18 freshfish70

freshfish70

    CC Lurker

  • New Member
  • Pip
  • 6 posts
  • Learning:C

Posted 25 November 2012 - 03:26 PM

Very basic and good tutorial, helps allot of people.
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download