ciao a tutti sto cercando di utilizzare la classe magicamente realizzata da andr3a ... però non capisco perchè a me non rimuove nulla, chiedo se c'è qualcuno che potrebbe copiare ed incollare il seguente codice e provare se funziona. Grazie mille a tutti!
codice:<?php // 5 /** * This class remove magic quotes from your scripts * . * EXAMPLE: * $removeMagicQuotes = &new RemoveMagicQuotes(); * // will remove automatically * @Compatibility >= PHP 5.0 * @Author Andrea Giammarchi * @Site http://www.devpro.it/ * @Mail andrea [ at ] 3site [ dot ] it * @Date 05/01/2004 * @LastModified 07/02/2005 * @Version 1.0b */ class RemoveMagicQuotes { /** * Public constructor: * checks if magic_quotes is active and if it is calls private method __removeSlashes * @Param no no params need */ final function __construct() { if( get_magic_quotes_gpc() ) { $this->__removeSlashes( $_GET ); $this->__removeSlashes( $_POST ); $this->__removeSlashes( $_COOKIE ); } } /** * Private method: * removes double slashes from strings * __removeSlashes( &$what:Array ):Void * @Param Array array with string variables */ private function __removeSlashes( &$what ) { while( list( $key ) = each( $what ) ) { if( is_Array( $what[$key] ) ) { $this->__removeSlashes( $what[$key] ); } else { $what[$key] = &stripslashes( $what[$key] ); } } } } ?> <?php if( isSet( $_POST['try'] ) ) { echo $_POST['try']."<hr />"; $removeMagicQuotes = &new RemoveMagicQuotes(); echo $_POST['try']; } ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="try" /> <input type="submit" /> </form> Write something like "asd'asda"asdasdasd'" and submit !