473,385 Members | 1,673 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,385 software developers and data experts.

Dynamische Website

Hallo,
ich programmiere gerade ein Website, wo die Seiten in der DB gespeichert
werden.
Ich habe es so gemacht, dass man auch PHP Codes in die DB speichern kann
und dann beim Lesen wird das ganze mit eval ausgewertet.

Ich habe ausserdem ein Formular mit einem Textarea gemacht, damit ich
das Code für die Seiten eingeben kann.

Mein Problem ist aber, wenn in meinem Code das Hochkomma steht, dann
muss ich das in \' umwandeln, damit das abgespeichert werden kann. Wieso
das ? aber bei " Zeichen geht das.

Gruss,

Donny
Aug 24 '06 #1
2 1403
Rik
Donny Riyadi wrote:
Hallo,
ich programmiere gerade ein Website, wo die Seiten in der DB
gespeichert werden.
Ich habe es so gemacht, dass man auch PHP Codes in die DB speichern
kann und dann beim Lesen wird das ganze mit eval ausgewertet.

Ich habe ausserdem ein Formular mit einem Textarea gemacht, damit ich
das Code für die Seiten eingeben kann.

Mein Problem ist aber, wenn in meinem Code das Hochkomma steht, dann
muss ich das in \' umwandeln, damit das abgespeichert werden kann.
Wieso das ? aber bei " Zeichen geht das.
When inserting text in a database, it has to be quoted. Quotes in the text
themselves have to be escaped, else it prematurely ends the string, and
you've got rogue characters in your query that will at the best give an
error, at the worst can damage the database because they change they query
in something else.

Check mysql_real_escape_string().

Grtz,
--
Rik Wasmus
Aug 24 '06 #2
Hi Rik,
thanks for your suggestion of the function mysql_real_escape_string. It
really helped.
Im sorry, that I wrote in German. I didn't recognize, that this is an
english NG.
Donny

Rik schrieb:
Donny Riyadi wrote:
>>Hallo,
ich programmiere gerade ein Website, wo die Seiten in der DB
gespeichert werden.
Ich habe es so gemacht, dass man auch PHP Codes in die DB speichern
kann und dann beim Lesen wird das ganze mit eval ausgewertet.

Ich habe ausserdem ein Formular mit einem Textarea gemacht, damit ich
das Code für die Seiten eingeben kann.

Mein Problem ist aber, wenn in meinem Code das Hochkomma steht, dann
muss ich das in \' umwandeln, damit das abgespeichert werden kann.
Wieso das ? aber bei " Zeichen geht das.


When inserting text in a database, it has to be quoted. Quotes in the text
themselves have to be escaped, else it prematurely ends the string, and
you've got rogue characters in your query that will at the best give an
error, at the worst can damage the database because they change they query
in something else.

Check mysql_real_escape_string().

Grtz,
Aug 24 '06 #3

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

Similar topics

0
by: ohaya | last post by:
Hi, I've been researching this, and I'm not sure if what I'm trying to do is possible, but I thought that I'd ask: I have two webservers/websites. The first webserver/website is running...
3
by: Newbie | last post by:
I have a C# asp.net webform with a Link Button to a website but it's not opening the website correctly. It's saying "The page cannot be found". But the website is loading when I use IE. Below is...
17
by: stubbsie | last post by:
Hi, I have redesigned our official public government website in .net and it has taken me a few months to redo. I have been the sole designer of the website from its humble beginnning a few years...
2
by: crferguson | last post by:
I'm having a really odd issue. Recently my company has upgraded our data server. For a couple of months I'm having to host two versions of the same website on our webserver until the new data...
19
by: cpnet | last post by:
I'm using VS2005, C#, ASP.NET 2.0. I'm trying to create a report using SQL Reporting Services (to be used in local mode so I don't have to deal with SQL Server). When I create a new report in my...
7
by: Atul | last post by:
Hi Theres a website that books hotels . user enters the information and according to that results are displayed to the user.Let it be website A. Now I want to create a new project with...
3
by: Mintyman | last post by:
Hi, I have 2 fields in a database: 'email' and 'website'. In the majority of cases, the website field is not populated even though the email address is. In 90% of cases, the website will be...
5
by: daveh551 | last post by:
What, from a high level point of view, is the difference (in Visual Studio 2005) between Website (accessed with Open Website or Create Website from the StartPage) that is an ASP.NET Website, and a...
2
by: Wayne Smith | last post by:
Applies to: Visual Studio 2008 Professional Hi everyone, I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.