PDA

View Full Version : Definition needed?


Crash1hd
05-10-2003, 11:01 PM
Ok can someone explain what the following line is doing

pass = Replace(Request.Form("pass"), "'", "''")

whammy
05-10-2003, 11:29 PM
That comments out any single quotes you might pass to the SQL Statement with another (so you don't get any errors - also helps to prevent some SQL injection attacks)... see the sticky thread at the top of the forums! :)

whammy
05-10-2003, 11:30 PM
P.S. That really shouldn't be used that way, though... if I did it then the variable isn't used anywhere but in a SQL statement; otherwise I would only replace that stuff WHEN inserting a variable into a SQL statement.

If you're using my login.zip, I'd recommend downloading register.zip instead from

http://www.solidscripts.com/downloads/register.zip

since it was written _much_ more recently!