[Working with PHP3 on a shared NT server. No access to php.ini. ODBC
connection to an MS SQL Server 7 database]
I was having problems with single quotes. The magic_quotes setup in the
ISP's php.ini was driving my SQL Server 7 nuts. The following two lines
took care of all the insert display problems I was having:
$sql = str_replace("\'","''",$sql);
$sql = stripslashes($sql);
The first allowed me to insert the singles and the second the doubles.
My next big challenge concerns xhtml compliance and inserting clickable
URLS in the article in my database.
I initally searched for the double quotes and replaced them with ". (if that displays a double quote I meant the HTML &quot)
Worked fine for stuff like "I love PHP," he said.
Where I'm still having problems is making my URLs clickable and
compliant and SQL friendly.
<a href="/pageonmysite.html">A page</a> hangs up the insert form.
<a href="/pageonmysite.html">A page</a> creates a link but the
" throws off the address in the browser and makes it
http://www.site.com/"pageonmysite.html" instead of
http://www.site.com/pageonmysite.html (That should read quotes around the pageonmysite.html of the first)
Any advice would be appreciated.