Questions tagged [stripslashes]

A PHP library function for un-quoting a quoted string or paraphrased stripping slashes from a string. Questions are about the workings or issues with the stripslashes function.

Un-quotes a quoted string. The function returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\) are made into a single backslash ().

Example (from PHP manual)

<?php
$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>

Links

108 questions
0
votes
1 answer

preg_match not working with single quotes

i'm having a problem to escape the single quotes on the preg_match function. I want to make a function that matches all kinds of names, also the likes of O'Neill etc. if(preg_match("/^(\w){1,12}\s(\w){2,15}\D$/", stripslashes($name))) { …
Jack
  • 31
  • 5
0
votes
1 answer

Allow HTML in TextArea

I'm building a custom options panel in Wordpress. One of the options I'd like to offer is the ability to add text and html to the footer. I can enter simple tags like, bold - but when you add a URL crazy stuff happens. I did some googling and found…
Greg
  • 193
  • 1
  • 4
  • 13
0
votes
1 answer

mysqli_real_escape_string and stripslashes returning blank variables

I am using the following code to clean any variables that get returned from forms. I recently swapped over from mysql to mysqli but as a result the function below is now stripping my variables back to being blank. //Start…
Chris
  • 105
  • 4
  • 14
0
votes
3 answers

Function escaping quote is not working correctly

I'm trying to figure out why this function does not work correctly. It's adding an extra \ every time I edit my entries. Online server has these settings: magic_quotes_gpc On magic_quotes_runtime Off magic_quotes_sybase Off Here is the…
lena
  • 119
  • 1
  • 12
0
votes
1 answer

Pass hexdata to an externam program from PHP

here is my issue: I wish to pass some hexadecimal data to an external app from PHP: exec('echo "'.$message.'" | /usr/bin/gateway'); and $message comes from user input: test'"/'\'/"\""// addslashes(), stripslashes() doesn't solve my…
Tom
  • 143
  • 2
  • 8
0
votes
1 answer

PHP: Stripslashes of Yahoo finance .CSV array

Im trying to delete the slashes of a array output. I am using the .csv file from yahoo finance. Somehow i can't get it work, the slashes don't strip. The output i get is "Google .inc" with slashes.
Edwin
  • 67
  • 1
  • 5
0
votes
1 answer

Stripslashes not working

I am using this code in one of my 2 step form, Here i am validating the form inputs at step 2.php and saving it in session, then in step 3.php page I am fetching the form inputs from the session. Also I am assing them to $formData array because I…
Asnexplore
  • 363
  • 1
  • 7
  • 25
0
votes
0 answers

PHP stripslashes variable encoding from contact form

In my PHP contact form script, I'm using _POST to submit a PHP variable containing quotation marks that have to be escaped, and upon arrival, its value becomes the value of the $formSubject variable in the form, and has its slashes removed with…
popsicle
  • 419
  • 1
  • 5
  • 15
0
votes
2 answers

Strip slahes in url

I am using regexp in php I want to use use in regexp like thatI can use it but error is popupHow can solve this problem.please guide me.suppose here $url is dinamically changed like that $preg_wurl = '/^'.$url.'/i'; $wurl =…
user1752627
  • 2,527
  • 2
  • 15
  • 10
0
votes
1 answer

Best order between stripslashes, utf8_decode, mysql_real_escape_string?

What is the best order if I need to use these functions in PHP: stripslashes, utf8_decode and mysql_real_escape_string. Actually somme \\ appears for example: Francois\'s Farm. Thanks.
F__M
  • 1,518
  • 1
  • 19
  • 34
0
votes
1 answer

PHP/Mysql - Add form data HTML elements with line breaks

Basically, I have an administration area where users are to be able to add information to a MySQL database using a form textarea. The users have little or no HTML knowledge so I'd like them to be able to use their return key to create line breaks…
JoeP
  • 856
  • 4
  • 15
  • 29
0
votes
1 answer

PHP: Incorrect JSON decoding and stripslashes \t \n

I think in server that I'm working, magic_quotes are active and when receive a json from jquery.ajax I do this: alcancesP = stripslashes($_POST['alcances']); After I decode alcancesP: $dataAlcances = json_decode(alcancesP,true); But when I pass…
SoldierCorp
  • 7,610
  • 16
  • 60
  • 100
0
votes
1 answer

PHP stripslashes eating too many backslashes

I'm trying to strip some slashes with the traditional stripslashes function and am getting odd results: echo stripslashes('\\\\'); This gives me: \ echo stripslashes('\\\\\\\\\\\\'); // there should be 12 slashes above This gives me: \\\ (there…
Bilal Akil
  • 4,716
  • 5
  • 32
  • 52
0
votes
1 answer

magic-quotes is ON && usage of stripslashes AND mysql-real-escape-string TOGETHER

Possible Duplicate: How to prevent SQL injection in PHP? i am on a free php server, I don't have access to php.ini file and magic_quotes is ON. so while I add records into mysql via my form page, my php code is…
0
votes
1 answer

How to prevent strip plus sign with codeigniter url_title function?

I am using that function in order to prevent wrong URL structure:
mirza
  • 5,685
  • 10
  • 43
  • 73