![]() |
|
#1
|
|||
|
|||
including html help last time!Arrg this is really getting to me.
I am trying to include html into a textarea but am still having problems. Would I need to encode the html before including it? Pls can someone help me out. PHP Code:
So everything works fine until a <textarea> tag is found in the html being displayed. I use file_get_contents($whichpage); which doesn't encode the html before including it. To fix my error would I need to encode the html? Thanx in advance Rich |
|||
|
#2
|
|||
|
|||
|
Well this seems to be a habbit of mine...
I did need to encode the html and now it works 100% and finally i've gotten over this html inclusion hurdle. I was trying to encode the full string variable (IE from an include_once function) but found the only way to do this was to encode the html line by line. Here's my encode code to display html in a textarea: PHP Code:
And here's my code to decode it before saving back to the original file name. PHP Code:
I have now officially completed my first simple admin cp! Thanx to gidforums for helping sort out my problems. |
|
#3
|
||||
|
||||
|
Rich,
I didn't actually go through the code you pasted inside this thread but I can quickly tell you a couple of things about this subject. When you want to DISPLAY code, you pass the example code through htmlentities( $code, ENT_QUOTES ). Then if it was displayed inside a textarea and you POST it to a script to save the example code it's NOT necessary to undo the htmlentities. Try it... __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
|||
|
|||
|
Quote:
Yes I remember now from my past trial and errors the server automatically decodes the text (this is set in php.ini?) when it is sent via POST. I guess I just decoded the text manually for testing purposes in development of the script offline. Thanx for the reply JdS |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| working with html HELP | dopee | MySQL / PHP Forum | 10 | 18-Jan-2005 04:31 |
| saving html text | dopee | MySQL / PHP Forum | 1 | 17-Jan-2005 04:15 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 09-Mar-2004 23:56 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The