Re: Problem with apostrophes!!

From: Date: Tue, 13 Mar 2001 04:16:15 +0000
Subject: Re: Problem with apostrophes!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-43614@lists.php.net to get a copy of this message
On Tue, 13 Mar 2001 14:17, Kenneth R Zink II wrote: > Ok, I'm pretty sure I need to use the "addslashes" function, but I'm > not sure how to implement it. > > The 2 variables that I would need to addslashes are $sire and $dam. > > can someone please help me, this is new to me. > > Thanks. It's like any other PHP function - you assign the result of the function to a variable. So: $variable = addslashes($variable_to_add_slashes_to) and those variables can be the same; so $sire = addslashes($sire); $dam = addslashes($dam); would work in your case. Note that you are going to have to strip the slashes when displaying data from the DB - the command is not surprisingly called stripslashes. What has possibly happened is that you have different settings in the ini file on your current server for one of the magic-quotes settings. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#43614) next »