Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-05-2007, 04:15 PM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

This make user data safe? (PHP)

Does this make user input reasonabely safe?

PHP Code:
function form_submit($key) {
    
$key htmlentities($keyENT_QUOTES);
      if (
get_magic_quotes_gpc()) { 
       
$key stripslashes($key); 
    }
      
$key mysql_real_escape_string(trim($key));
     
$key strip_tags($key);
    
$key str_replace("\r\n"""$key);

//Smily stuff Removed
//BB Code stuff Removed
     
return $key;

Reply With Quote
  #2  
Old 02-05-2007, 04:55 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,924

to be honest I think you went a little overboard.

What kinda data are you trying to filter?
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 02-05-2007, 05:21 PM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

Nothing out of the ordinary, im building up a sword database, basiclly the fields are things like Sword Name, Sword Smith, RRP, some varchar, some int, some text etc etc

There is a textarea down thebottom for added/general info...

The form does sit in the admin panel that only 1 other guy and myself have access too and i trust him not to screw things up, its more a case of better to be safe then sorry...
Reply With Quote
  #4  
Old 02-05-2007, 05:31 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
I usually just use base64 encoding for saving general input to the database. That's all I would use in your case


$encodedText = base64_encode("Some text");


$decodedText = base64_decode($encodedText);


IcI
Reply With Quote
  #5  
Old 02-05-2007, 05:52 PM
JonM is offline JonM
Registered User

Join Date: Jun 2004
Posts: 2,156

You've already done the work and that's pretty darn secure...i'd keep it like that .
Reply With Quote
  #6  
Old 02-05-2007, 06:05 PM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

I actually havent put it in yet, i wanted to get the thing up then tweak it...

ici, i plan on making the data searchable, would it be using too much resources to encode the search strings aswell as the actual data?
Reply With Quote
  #7  
Old 02-05-2007, 07:36 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
I don't know how that would work, since I haven't done any thing with searching. But it works pretty fast for babstats system....

babstats base64 encodes all the player names, yet you can still search them.

base64 may not be the best way. I am certainly not an expert in PHP lol
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it safe? Chrispy Tech Support 2 07-10-2007 11:35 AM
Is it safe? Grenademan General Chat 39 03-18-2007 08:39 PM
be safe bigsmellyfart Humor & Jokes 3 12-19-2005 01:15 PM
Drive safe! especially here -Tigger- Humor & Jokes 6 06-27-2005 09:05 AM


All times are GMT -5. The time now is 01:09 AM.




Powered by vBulletin®