473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

text area used to edit homepage

1 New Member
A php newbie with a problem!

I have a form with a text area

<form name=edit_front_page_form action="/test.php?page=front_page_updated" method=get>
<p>Edit front page<br>
<textarea cols=30 rows=15 name='text_front_page'></textarea>
<input type=submit value="Submit">
</form>

It is blank initially - the user can enter html text e.g.
<p> Welcome to the homepage<p>

I want to save this to a mysql db. I also want to retrieve it from the db and display it when a user accesses the homepage.

I am using php. However when I submit the form using a 'get' the text field is not sent properly

i.e. "http://localhost/XYZ.php?text_front_page=%3Cp%3EWelcome+to+the+home page%3E%0D%0A" is the request message...

Any help would be great...
Jun 19 '06 #1
1 3348
Banfa
9,065 Recognized Expert Moderator Expert
Actually that is correct some characters are not valid in a URL, like space. To get round this they are converted to there ASCII code and the character is replaced with %<ASCIICodeInHex>, spaces are replaced with + (not quite sure what it would do with a + probably replace with ascii code.

So in the sur you provided

http://localhost/XYZ.php?text_front_...me+to+the+home page%3E%0D%0A

You have the following

%3C ASCII Code for <
%3E ASCII Code for >
%0D ASCII code for carridge return
%0A ASCII code for new line
+ replaces space

gives


http://localhost/XYZ.php?text_front_page=<p>Welcome to the home page>


And this is what php will receive.

Of course having decoded it a realise that you may be talking about the end of this line where you have > instead of </p>

I have to say that subbmitting html like that works on a site I run but I use the POST method rather than the GET method.
Jun 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2314
by: WindAndWaves | last post by:
Hi Gurus I have a PHP page that allows a user to preview an email and then send it if(s)he is happy with it. Otherwise, they can click on an edit button and edit the text of the message. The...
11
3465
by: Ed Suominen | last post by:
I'm thinking of implementing a real-time collaborative text editor in Python using Twisted. An initial plan is to use a Twisted PB server daemon that accepts user:password:file connections from...
3
4461
by: Daan | last post by:
Please have a look at the following site *with IE6*. When hovering over a link in the menu bar, all the text in the 'left' area of the site that is below the 'right' area of the site just...
1
3728
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
2
3783
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
3
4189
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
29
5062
by: Michael Bulatovich | last post by:
Is there a way to use CSS to format "plain" text in an html document. By plain I mean text which is not contained by <por <h#tags. Is there no way to control how this stuff is rendered? tia
16
4347
by: rite2vinoth | last post by:
HI I want to display the contents of a big XML inside a text area so that the user would be able to edit it. But the XML consists of characters such as &amp; &quot; which are interpreted by as & and "...
1
1888
by: adamprisa | last post by:
1. Go to http://webwag.com 2. On the left hand side upper corner there is an "Add new Content" button, Click on it. 3. Enter a URL(suppose www.yahoo.com) in New! Widget On DemandTM TextBox and...
0
7083
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
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
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,...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.