SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 30th, 2004, 03:28 AM
Pravin Dabhade Pravin Dabhade is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 Pravin Dabhade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Read the Html file From PHP

HI I am a new user

I stored a Script(HTML/PHP/Javascript Code) code That is Generated by my other PHP script into Text file . now i want to show that code to user as it is (including HTML tages) using PHP
How To do it?


I write a Following PHP code

<?php

$filename = "temp.txt";
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));
fclose($fp);
echo $contents;
?>

my txt file content are:
<?php
// Remember to copy files in misc/samples/xmlrpc/php to the same directory as your script

require('lib-xmlrpc-class.inc.php');
$xmlrpcbanner = new phpAds_XmlRpc('127.0.0.1', '/phpadsnew');
$xmlrpcbanner->view('', 11, '', '', '0');
?>


I get Following Output:
view(\'\', 11, \'\', \'\', \'0\'); ?>


I want to Get a complet file As it is How to do it?

PRavin Dabhade

Reply With Quote
  #2  
Old April 30th, 2004, 03:49 AM
Pravin Dabhade Pravin Dabhade is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 Pravin Dabhade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
this will solve u r problem

<?php

// Get a file into an array. In this example we'll go through HTTP to get
// the HTML source of a URL.
$lines = file('script.txt');

// Loop through our array, show HTML source as HTML source; and line numbers too.
foreach ($lines as $line_num => $line) {
echo htmlspecialchars($line) . "<br />\n";
}

// Another example, let's get a web page into a string. See also file_get_contents().
//$html = implode('', file('http://www.example.com/'));
?>

Reply With Quote
  #3  
Old June 1st, 2004, 11:25 PM
bala_kumar2k4 bala_kumar2k4 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 12 bala_kumar2k4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can we do the same thing to read the PHP file.....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Read the Html file From PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway