PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Inserting inform in the database

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTML
View previous topic :: View next topic  
Author Message
adpaster79



Joined: 30 Apr 2007
Posts: 15

PostPosted: Wed Nov 11, 2009 9:43 am    Post subject: Inserting inform in the database Reply with quote

The below information is being inserted in the database(&amp,&quot). When I display the information, it is also being displayed (&amp,&quot).

'&' (ampersand) becomes '&'
'"' (double quote) becomes '"'

Code:

// set input validation rules

//Validation Process
$form->applyFilter('__ALL__','trim');

if($form->validate()) {

   //post-validate filters comes here
   $form->applyFilter('__All__', 'addslashes'); //apply it to all elements
   $form->applyFilter('__All__', 'htmlentities');//apply it to all elements
   //$form->applyFilter('b','nl2br');

   //invoke the store_address_info function to store the user information
   // in the database
   //$form->freeze();
   $form->process('store_address_info',false);

}

Note: magic_quotes_gpc is disabled per the phpinfo().

Should addslashes be replaced with mysql_real_escape_string()?

Is htmlentities required when inserting data in the database?

Is htmlentities used by QF internally?

Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTML All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement