Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
mysql_real_escape_string removing all quoted text
Old 07-24-2009, 02:20 AM mysql_real_escape_string removing all quoted text
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
I filter all my input as such

PHP Code:
 function format_input($input$html_entities=1) {
  
//Escape Codes
  
$input mysql_real_escape_string($input);
  
  
//Trim
  
$input trim($input);
  
  
//If Html Entities
  
if ($html_entities==1$input htmlentities($input);
  
  return 
$input;
 } 
but if there is an error the information gets outputted right away through

[PHP]
function format_output($output, $html_entities=0) {
//Strip Slashes
$output = stripslashes($output);

//Trim
$output = trim($output);

//If Html Entities
if ($html_entities==1) $output = htmlentities($output);

return $output;
}
[PHP]

but if I input something like: good "work"... the "work" will all disappear altogether... but if it submits through it shows up in the database... anyclues why this is happening

magic_quotes is off
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-24-2009, 08:05 PM Re: mysql_real_escape_string removing all quoted text
Novice Talker

Posts: 9
Trades: 0
echo format_input("good work");
echo format_output("good work");

both display "good work" fine

How are you passing your variables through the function?
__________________

Please login or register to view this content. Registration is FREE

Free Pay Per Click for Webmasters
sc_king is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mysql_real_escape_string removing all quoted text
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09864 seconds with 12 queries