Jump to content

Problem with stripslashes


affordit

Recommended Posts

Give us $stepd's contents? Stripslashes only removes the escape character '\' once. This should replace all and be UTF safe..

<?php
  preg_replace(array('/\x5C(?!\x5C)/u', '/\x5C\x5C/u'), array('','\\'), $string);
?>

You can use str_replace() as well alongside without much effort.

 

This is the form

<script src="addInput.js" language="Javascript" type="text/javascript"></script>
<form method="POST" action="inputresult.php">
     <div id="dynamicInput">
          Step 1<br><textarea name="mysteps[]"></textarea>
     </div>
     <input type="button" value="Add another Step" onClick="addInput('dynamicInput');">
 <input type="submit" value="Do It">
</form>

It goes here for them to confirm

<?php
echo "<form method='post' action='except.php'>";
$mysteps = $_POST["mysteps"];
$i=1;
foreach ($mysteps as $eachInput) {
echo "<textarea value='".$eachInput . "' name='step".$i." cols='50'>$eachInput</textarea><br>";
$i++;
}
print "<input type='submit' value='Publish Now'><br></form>";
?>

and I have this page set up to test the output

<?php
include("bdinfo.php");
$stepa=$_POST['stepa'];
$stepb=$_POST['stepb'];
$stepc=$_POST['stepc'];
$stepd=$_POST['stepd'];
$stepe=$_POST['stepe'];
$step6=$_POST['step6'];
$step7=$_POST['step7'];
$step8=$_POST['step8'];
$step9=$_POST['step9'];
$step10=$_POST['step10'];
echo $name."<br>";
echo $password."<br>";
echo $database."<br>";
echo $stepa."<br>";
echo $stepb."<br>";
echo $stepc."<br>";
echo $stepd."<br>";
echo stripslashes($stepe)."<br>";
?>

Thank you

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.