Solved

PHP - Speach Marks in Form Problem

Posted on 2009-05-20
2
337 Views
Last Modified: 2012-05-07
I have a form and somebody entered 8" by 15" into it and it stopped my function working.

How can I clean up the posted text before I send it to my function for processing?
0
Comment
Question by:lwfuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
Chris Harte earned 125 total points
ID: 24430402
Use the addslashes function.
If you are writing the content to a database use the mysqli_real_escape_string() instead to prevent injection attacks.
<?php
$str = "Is your name O'reilly?";
 
// Outputs: Is your name O\'reilly?
echo addslashes($str);
?>

Open in new window

0
 

Author Closing Comment

by:lwfuk
ID: 31583444
Many thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question