PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I escape data that is going into a database?


There are various ways to do this. If you know for sure that you need to escape your data, one way is through using the addslashes function, like this:
<?php
$mydata 
"hello I'm great"
$mydata addslashes($mydata);
//now contains: hello I\'m great
?>



ASK A QUESTION

More forms PHP Questions

I have a form that I need to do two things: send all the input values to a confirmation/pay page, and send to me via email. Payment is based on what the customer picks (naturally). The way I have it set up is the form action goes to the confirmat

Hello, I an trying to figure out how to pass a variable email address to the contact form where you see the send-to-me@me.com. My contact page In a php file uses the following iframe embed: The contact script in feedback/contact. php

Hello: I receive two error messages when I try to submit a form. The messages are: Warning: mysqli_query() [function.mysqli-query]: Empty query in /home/content/PRIVATE/html/riskyjobs_riskybusiness_Database_TableSetup_riskyjobs_Table_Chapter9_Page5

How do I make a website field mandatory?

I am using mail()to process a form. I can only get part of the form to be sent. The $message part only picks up one field in the form.



Custom Search