TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-05-2010, 05:26 PM   #1 (permalink)
The Wanderer
 
JayGarland's Avatar
 
Join Date: Feb 2010
Location: London, England.
Posts: 7
Thanks: 5
JayGarland is on a distinguished road
Book Display PHP code in text area help.

Hi, I have a text area, and I would like to display data from example.php into it, for example.

I want this to show in the text area, but obviously with my own.

<?php
$var = "var";
$var2 = "var";
?>

So basically, the PHP code from the file.
If anyone could help me with this, it would be greatly appreciated.
JayGarland is offline  
Reply With Quote
Old 03-05-2010, 07:45 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Just echo what you need inside the form, someting like this

Code:
<textarea>
<?php echo "Hello World"; ?>
</textarea>
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
JayGarland (03-05-2010)
Old 03-06-2010, 09:22 AM   #3 (permalink)
The Wanderer
 
JayGarland's Avatar
 
Join Date: Feb 2010
Location: London, England.
Posts: 7
Thanks: 5
JayGarland is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
Just echo what you need inside the form, someting like this

Code:
<textarea>
<?php echo "Hello World"; ?>
</textarea>
That would work but I mean display the variables from an existing file, so when you update the code, the file is updated, therefore the text inside the text area is updated.

I have an alternative for now, just useful if anyone can help with the displaying of a complete php file.
JayGarland is offline  
Reply With Quote
Old 03-06-2010, 10:41 AM   #4 (permalink)
The Acquainted
 
EyeDentify's Avatar
 
Join Date: Nov 2007
Location: Sweden
Posts: 106
Thanks: 13
EyeDentify is on a distinguished road
Default

Perhaps you could get some use out of these PHP functions:

highlight_file():
http://se.php.net/manual/en/function.highlight-file.php

highlight_string():
http://se.php.net/manual/en/function...ght-string.php

Good luck :)
__________________
Of course the whole point of a doomsday machine, would have been lost if you keep it a secret.
EyeDentify is offline  
Reply With Quote
The Following User Says Thank You to EyeDentify For This Useful Post:
JayGarland (03-06-2010)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i display on a php file the content of a text document chikooo Absolute Beginners 13 01-29-2013 11:44 AM
Writing Clean Code Village Idiot Tips & Tricks 10 06-25-2012 12:35 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
Display pages php code? Aaron General 16 01-31-2008 11:29 AM


All times are GMT. The time now is 07:39 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design