GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 21-Nov-2003, 08:52
Antinaris Antinaris is offline
Awaiting Email Confirmation
 
Join Date: Nov 2003
Location: Europe
Posts: 1
Antinaris is an unknown quantity at this point

Textarea and PHP.


I want to know if it's possible to show PHP code in a textarea without the code being interpreted and then stock it in a MySQL table.

Thanks.
  #2  
Old 21-Nov-2003, 09:06
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello Antinaris,

Yes, it's possible....

If you want to simply display the PHP code in a textarea:
PHP Code:

<?php
// assume that $php_code is the var that holds the text/code from the db
$display_code = htmlentities( $php_code, ENT_QUOTES );
echo '<textarea>'.$display_code.'</textarea>';
?>


I think that's it!
Last edited by JdS : 16-Jan-2004 at 11:00.
  #3  
Old 21-Nov-2003, 09:09
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Well, it would be very easy to display the code in a textarea, you would have to use I think javascript though so it does not count the php code as code itself, and think it is page of the page.

Storing it then into MySQL Table, heh, I dunno. I would think it would be hard to do because you would have to have the code changed if you used javascript to display the code in a textarea.

View the source code for: mrbobdouglas[dot]com/dev/errorpage_gen.php

You will notice that I have to use a / in a lot of areas making a note not ti accept this as a PHP tag.

Your script would have to be able to modify the /'s that would be added to your code in order to display them in a textarea.

JdS might have an easier way to display the code inside a textarea without adding any changes to it, and without allowing it work as php code inside the page.

If you can do that, I think a simple script to store the information from a textarea to a MySQL table would be easy to do.

<edit>JdS beat me to the post... pfff!</edit>
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
textarea width problem zuzupus Web Design Forum 2 23-Jul-2003 03:06

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:38.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.