Re: user input killing code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can use the function addslash() before you insert the input in the
database.
When you read data from de database, you can use the function
stripslashes(), to display the text correctly.

see also:
http://www.php.net/manual/nl/function.addslashes.php
and
http://www.php.net/manual/nl/function.stripslashes.php

Peter

"Redhat" <redhat@xxxxxxxxxxxxxxx> schreef in bericht
news:1070380141.2095.20.camel@xxxxxxxxxxxxxx
> I am still working on this DB entry page.  I have a sort of content mgt
> page that I have built where certain company people input data to be
> displayed on a web page to be viewed by the public.  Everything is
> working great except, when someone enters an ' or " into the form field
> it will not update the database.  I figured out that if you escape the '
> or " with \ it will go through.  I would like to know what I can do to
> my code to keep users from having to remember this.  Any suggestions?
> thanks,
> DF

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux