|
|
Taking web design to the next extreme By Red Squirrel In a typical script that POSTs data, if there is any quotes or slashes that are typed, they will be formatted for php. For example, " will end up like \" and \ will end up like \\ and same with single quotes. To fix that problem, you need to use the stripslashes() function to the variable. To do this, you simply need to go like this: $myvariable = stripslashes("this is data with \"quotes\" and slashes\\ and \'single quotes\'"); That string of text could be a variable as well. A $_POST variable that has posted data will always end up like that. This is because in order to write a string with quotes, it has to be in that format. For example, this: Echo("this is data with \"quotes\" and slashes\\ and \'single quotes\'"); Would show up as this: this is data with "quotes" and slashes\ and 'single quotes' If you did not type it that way in the echo function, you'd get a parse error. A parse error is whenever there is a problem with the script. Thankfully, it usually gives you good information and what line it's on, so you can go fix it. Something as simple as a missing semi colon can result in a parse error. From here, you should be ready to start making simple scripts with php, and move on to more advanced functions. Red Squirrel / Ryan Owner, IceTeks.com
|
![]() |
This site best viewed in a W3C standard browser at 800*600 or higher Site design by Red Squirrel | Contact © Copyright 2012 Ryan Auclair/IceTeks, All rights reserved |