Jump to content

Apostraphe Problem


ArizonaJohn

Recommended Posts

Hi,

 

If I enter an apostraphe into the form below, it comes out as \\\\\\\' after it runs through all the code below.  That's right, seven backslashes in front of the apostraphe.  Is there an easy way to solve this?

 

Thanks in advance,

 

John

 

 

<div class="searchbox">
  <form action="search.php" method="post">
  <label>Enter Topic:
  <input type="text" name="find" size="55"/>
  <input type="hidden" name="searching" value="yes" />
  <input type="submit" name="search" value="Search" />
  </label>
  </form>
  </div>

 

On search.php:

 

<?php

ob_start();
session_start();
$find = strip_tags($_POST['find']);
$find = trim ($find);
$find = strtolower($find);
$_SESSION['find'] = $find;
?>

<?

$find = mysql_real_escape_string($find);
$find = htmlentities($find);

$anymatches=mysql_num_rows($result);
if ($anymatches == 0)
{

$_SESSION['find'] = $find;

session_write_close();
header("Location:search2.php?find=$find");
exit;
   
}


}
?>

 

 

On search2.php:

 

<?

$_GET['find'] = $find;
print "<p class=\"topic2\">The topic \"{$_GET['find']}\" has not been added.</p>\n";
?>

Link to comment
https://forums.phpfreaks.com/topic/161398-apostraphe-problem/
Share on other sites

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.