Jump to content

POST data adding slashes for no reason?


schilly

Recommended Posts

so i'm printing out some post data from a form and it already has slashes added to the data. i've never seen this before and is hence messing up all my queries when i use mysql_real_escape_string on the form data.

 

this is through the go daddy preview dns feature. we are upgrading a site so the dns hasn't been switched over yet. i'm fairly certain this preview dns thing has already broken some of my jquery code.

 

here's my code.

 

basic html

<form method="post" name="furniture_form" action="" enctype="multipart/form-data">

<table>

	<tr><td colspan="2" align="center"><?php echo isset($msg) ? $msg : " "; ?></td></tr>

	<tr>

		<td>Item Number:</td>
		<td><input type="text" name="item_num" value="<?php echo $item_num; ?>"></td>

	</tr>

	<tr>

		<td>Category:</td>
		<td><select name="category"><?php echo getCatMenu($category); ?></select></td>

	</tr>

	<tr>

		<td>Style:</td>
		<td><select name="style"><?php echo getStylesMenu($style); ?></select></td>

	</tr>

	<tr>

		<td>Dimensions:</td>
		<td><textarea name="dimensions" rows="2" cols="25"><?php echo $dimensions; ?></textarea></td>

	</tr>

	<tr>

		<td>Description:</td>
		<td><textarea name="description" rows="5" cols="50"><?php echo $description; ?></textarea></td>

	</tr>

	<tr>

		<td>Picture:</td>
		<td>
			<input type="file" name="file">
			<div style="float:right"><?php if($picture != "default.jpg") echo "<img src='/includes/makeThumb.php?name=$picture&type=0'>"; ?></div>

		</td>

	</tr>

	<tr>

		<td>Comments:</td>
		<td><input type="text" name="comments" value="<?php echo $comments; ?>"></td>

	</tr>

	<tr>

		<td> </td>
		<td><input type="submit" name="furniture_submit" value="<?php echo $button_name; ?>"><input type="hidden" name="furniture_id" value="<?php echo $_GET['id']; ?>"</td>

	</tr>

</table>

</form>

 

php code at the top of the page:

<?php print_r($_POST); 

//processing code

?>

 

so if i add some quotes and stuff in the fields and post here is what gets posted:

 

Array ( [item_num] => 15432a [category] => Dining Room [style] => Tapered Leg [dimensions] => asdfsdfasdf [description] => testing\'s [comments] => whooo whooo [furniture_submit] => Update Furniture [furniture_id] => 2 )

 

anyone seen this before?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.