473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

using mysql_real_escape_string

being prudent, and listeng to ng members I am now using
mysql_real_escape_string on my user uploaded data.

I give the user a form to fill in, including some text areas.
I then save them in a mysql database. When the user returns
to the form, I fill in the data from mysql.

The problem is that each time the user returns to the form
additional \r\n are appended to the entry.

I tried using stripslashes() on the data before I put it into the
textarea, with no improvement.

suggestions please.

bill
Dec 24 '06 #1
2 1667

bill wrote:
The problem is that each time the user returns to the form
additional \r\n are appended to the entry.

I tried using stripslashes() on the data before I put it into the
textarea, with no improvement.
dunno where your linefeeds are comming from, but give trim() a shot.

Dec 25 '06 #2
BKDotCom wrote:
bill wrote:
>The problem is that each time the user returns to the form
additional \r\n are appended to the entry.

I tried using stripslashes() on the data before I put it into the
textarea, with no improvement.

dunno where your linefeeds are comming from, but give trim() a shot.
thanks
found them, I had used a PHP indent on my development system and
it put two spaces before everything, including the </textareaso
the prior line's linefeed and those spaces got included in the
textarea = like it or not.

Seems stupid, but when I took them out, no further problem.

bill
Dec 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marcus | last post by:
Hello, My php.ini file currently has magic quotes set to On, but I have read that it is better to code with it off. Currently with magic quotes on, I only use stripslashes() to properly...
9
by: frizzle | last post by:
Hi groupies, I have 2 small questions, which i really want to be sure about: - does mysql_real_escape_string() prevent any kind of mysq-injection? - can it put escaped quotes etc in the DB, or...
8
by: mantrid | last post by:
Hello Im having problems working out why the following code does not work. I dont think its the sql as the error occurs on the first update which ever one is put there ($q1 or $q2). Ive swapped...
2
by: matthud | last post by:
<?php //MAKE IT SAFE $chunk = $_POST; $title = $_POST; $url = $_POST; $tags = $_POST; $user = $_POST; $safe_chunk = mysql_real_escape_string(htmlentities($chunk)); $safe_title =...
11
by: zach | last post by:
I created a comment form which will inserts the comments into a database and displays them immediately. I want to make sure that its safe from users inserting unwanted data into the database or...
2
by: Pugi! | last post by:
It is by accident that I noticed that I forgot to use mysql_real_escape_string in part of my webapp. I tested input with following text : Hélène 51°56'12'' http://www.mysite.org/folder 3 functions...
1
George Lft
by: George Lft | last post by:
ok, first of all, i built my register page using dreamweaver tool which the codes haven been out of control. Now i'm thinking that turning over everything - by using this another set of codes. And...
13
by: ndlarsen | last post by:
Hello. It's been a while since I used php. Since then magic quotes has been deprecated and will be removed when php 6.0 hits. My question is, what should I be using when submitting data to a...
4
ddtpmyra
by: ddtpmyra | last post by:
Im having trouble on updating the file inside mysql database using the php. Should I use <form> or im wrong on how I called the variable from previous page? FORM 1 - that accepts the file pointer...
7
by: roseple | last post by:
Hi, can anyone please help me why I got this error every I uploaded files. Error: Here is the code on the said warning message: # Gather all required data $name =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.