Try using the addslashes function.

Magic Quotes may need to be turned on in the php.ini file, but I'm not
sure.

$newloginname=addslashes($loginname);

This should allow for the apostrophe in the variable.






-----Original Message-----
From: Herhuth, Ron [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, February 12, 2003 8:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Apostrophe in login causes error


I have built a typical login form where a user enters their last name as
the user name and the last four digits of their SSN as their password.
The following page checks to see if the user exists in the database and
either allows access or denies access based on the findings.  This has
worked fine for 500+ partners...but we have three people whose last name
is O'Conner in the database (I can't change their HR record in the DB)
and the apostrophe in their name is causing the script to fail.  Without
changing settings in the ini file is there a way I can quickly make the
script accept the apostrophe in the name?

Thanks,
Ron

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to