Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Read Part/top Of A Remote Output Html File


I'm using file_get_contents{URI) to read/use data in my scripts.




View Complete Forum Thread with Replies

Related Forum Messages:
Part Of A Remote Txt File
the following code returns 2 different things, the correct $filesize (9425) from the header and only part of the text file into $data (2491 bytes)unfortunately, i cannot give out the user and pass. all i can say is that when i run it on my apache server locally, it reads the entire file properly. The split on the remote site occurs between the numbers 1 and 4 in "14", so i have no idea what trips it up.

$filename = 'http://user:pass@mysite.com/testfile.txt'
$ary_header = get_headers($filename, 1);
$filesize = $ary_header['Content-Length'];
$fh = fopen($filename, 'r');
$data = fread($fh, $filesize);
fclose($fh);
echo $filesize . "<br />";
echo strlen($data);

any ideas?

View Replies !
Get Only Part Of The Remote File?
Is there anyway that I can use curl to retrieve only n bytes/characters
of a file? I want to get some certain information on a remote site, and
the data I need stays somewhere at the middle of the page, so I dont
need to retrieve the whole page, which can save me lots of time.

View Replies !
Read Part Of A File
I'm reading this huge text file and I want to start reading from a specific point.
lets say a line in my file is like this
[11/20/2006 12:07:12 AM] abcdel defg0 msping (timeout - 2000 ms)

and i want to start reading from a specific date to a specific date. how would I go about doing that using php?

View Replies !
Read Contents Of Remote File
I'm currently using get_file_contents to read the contents of an html file on another server. Is this the best way or should i be using curl or something else.

View Replies !
Open/read A Remote Https File?
How can I do this? cURL isn't available. I have tried Code:

$filename = "https://friends.domain.com/file.aspx;
$handle = fopen($filename, "r");

But $handle doesn't seems to exists Any suggestions??

View Replies !
Reading In A Part Of A HTML File
I am working on a script at the moment, and I want to be able to include some HTML snippets that a user can update at any given time.

In most cases the snippets will be only a table, but I want to make allowances for the file if it is a full HTML file.

What I would like some help in working out, is what would be the best way to read in the file and take all the code after the <body> tag upto but not including the </body>. Is there an eay way of doing this? So that if all I want is the table that is inside the page, that is all I will get.

View Replies !
Including Part Of An HTML File
Is it possible to include part of a file without including the whole thing?

View Replies !
Read And Print The Contents A Text File Which Resides In A Remote Location Via PHP?
Is it possible to read and print the contents a text file which resides in a remote location via PHP? For instance, this is how I am currently reading a text file that is my local server (and it works great, but unfortunately the text file my client will need to have read is outputted to a remote location):

<?php
$currentSong = "/home/medusa/sun/accounts/username/public_html/ticker/current-song.txt";
$fh = fopen($currentSong, 'r');
$theData = fread($fh, filesize($currentSong));
fclose($fh);
echo "<p>".$theData."</p>";
?>

View Replies !
Read From A Text File, Output To Browser In Japanese
I am trying to store data in a text file and output it to the browser
using PHP. All very easy - if I was using English! the problem is, I
want to use Japanese and I'm finding it a tad difficult to get PHP to
understand. I have two files, a text file containing data to display
and a php file with a script to display the data. I can get the
contents of a text file displayed in English, no problemo, but in
Japanese, it's another story...

All the correct settings are enabled in the php.ini file for Japanese
language support (mb_string, input_encoding, output_encoding settings
etc..etc..) even if I save the text file, to be read from, in
Shift_JIS encoding - I still can't get it to display normally!

here's the script I'm using to read the text file :

<?
$filename="test.txt";
$fp = fopen($filename,'r');
while($line=fgets($fp))
{

//output text file line
print $line."<br>";

}
fclose($fp);
?>

View Replies !
Read HTML Or TXT File
Does anyone know if this is possible? Script reads a HTML file or a TXT file and output the data to MySQL database.

View Replies !
Read File With Html
I have a PHP program that throws some text into a file.

Later I display it using the code below (php and html).

But I'm trying to hop up the code a little and would like to bold/blink/underline just a few lines of the output.

I've inserted the
HTML Code:
<b> xx </b>
into the file along with the text at selected points.

When it reads it it just puts HTML Code:

</b> </i> </blink>

right onto the screen.

PHP Code: ....

View Replies !
Analyze And Read In Html File
what i want is something similar to th simple-xml extension of php, but for
html.

I have to analyze and read in certain tags from a html file in a comfortable
manner.
Is there a php extension/library which makes this possible?

View Replies !
Saving Output As An .html File
I have a script which takes about 20 or so fields as input and creates a big table out of all those. I want to log what happens and I was wondering if there's some way I can save each table as an .html file in my directory.

View Replies !
Setup My Htaccess File To Read My Html Files As Php.
I am trying to setup my htaccess file to read my html files as php. How would I do this, or where can I find how to do it?

View Replies !
Read Part Of String
I have this string :

C' EOF'

how many letters are inside the quotes?

View Replies !
Load The HTML Output Of A File Into A Variable?
How can i load the html output of a file into a variable.. Kind of like include()ing or require()ing a file.. but not echoing the content.. but saving it to a variable..

Can it be done? I dont want to use fgets because they are PHP files.. and i want to get the HTML as if a user opened with a browser..

View Replies !
Download Script - File Is The Html Output Sent To The Browser.
I have a script that pics up a requested downloadable file but instead of the file requested the file has the name its supposed to have but the file is the html output sent to the browser.

$filename = preg_replace( '@(..|/)@', '', $filename );
header('Cache-Control: maxage=360');
header('Content-type: binary/octet-stream');
header('Content-Disposition:attachment; filename="'.$filename.'"');
header('Content-transfer-encoding: binary');
header('Content-length: '.(string)(filesize($filename)));
readfile( $filename );

View Replies !
Validate The Username Password Than It Will Output A Html File.
the examples Ive seen online for php login scripts have the login form already built in to the php file. Is it possible to just have a normal html site with the <form action=""> set to a php file and this will validate the username password than it will output a html file.

View Replies !
Is It Possible To Modify Part Of A Text Field Output?
I am made a simple web site search function. I use MySql 4 and have a table that contains all text on a web site in a column type text.

I can search it, but I want to make the search term bold when I print out the text field content. PHP Code:

View Replies !
How Do U Code A Printable Output Of A Part Of Your Page?
im trying to develop a website and im wondring how to make a connection with a printer and make a printable version of the page

View Replies !
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another
host. I'm finding that...

echo file_get_contents( 'http://www.php.net' );

.... works fine if I upload the PHP script to my Web host, and run it
there. But if I run it on my PC, which is running Apache 1.3.33
(Win32) and PHP 5.0.5, then it always times out, and gives me the error
message...

[error] PHP Warning: file_get_contents(http://www.php.net) [<a
href='function.file-get-contents'>function.file-get-contents</a>]:
failed to open stream: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond.

I get the exact same results using...

$fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg );
while (! feof($fh)) {
$page .= fread($fh,1048576);
}
fclose($fh);
echo $page;

Anyone know what could cause this to happen?

View Replies !
Getting Part Of Another HTML Page
I'd like some help with writing a script that grabs part of another HTML page. For example : I want to grab the content of a HTML page that contains the following strings :

<!-- begin --> and <!-- end -->

Then I want to get all the content (including these two tags) that is in between the two tags.

View Replies !
Email With Attachment - Annot Be Accessed. The File May Be Read-only, Or You May Be Trying To Access A Read-only Location.
It is a basic email with an attachment. The email and attachment are getting sent and received ok. When the recipient tries to open the attachment, the right application opens (eg. Excel) but then throws up an error. I am using base64 encoding. For example:

.xls file with base64 encoding:
'testing.xls' cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding.

.pdf file with base64 encoding:
There was an error opening this document. The file is damaged and could not be repaired.
so the file isn't being decoded right. I have tested on Yahoo and Outlook. PHP Code:

View Replies !
Process And Read The Output Of Javascript?
Are there any PHP scripts that can process and read the output of javascript?

I know JS is a client side thing, but I'd like to load the output of an external script into a database or cache it locally for quicker display.

View Replies !
Read File - Limit The Number Of Lines To Read
How can I open a file and then limit the number of lines I want to read? say I have a text file and I only want to read line one to get the title of the text within?

View Replies !
Read (and ONLY Read) A Multi-sheets Excel File With PHP.
I want to read (and ONLY read) a multi-sheets Excel file with PHP.
I found so many scripts on the net that I finally don't know what to choose
so... could experimented users help me to directly find the one that I need
?

Here are the two obvious things the script must match :
- free
- can read multi-sheets Excel files

View Replies !
Php Function To Read Local Python Script Output, Not Code
On my server python has to run in the wwwroot/cgi-bin folder, but php can run anywhere. My site is going to be written in python but I don’t want my user to see the url as mysite/cgi-bin/... .

So for example my homepage, index.php should contain a simple php script that will get my python page from the cgi-bin directory and display it. However when I try to use SSI or fopen/file_get_contents/readlink and commands like these it just displays the python code. Where as when I visit the python page in my browser it runs it and displays the output for me.

My question is what php function can I use to execute my python page and return the output, not the code itself. (I think my hosting provider has disallowed certain powerful commands like system() etc. Does this make it impossible?). As the very least can’t my php script pretend to be a www user and ‘visit’ the python page to read the output?

View Replies !
Remote Html
How can i call the remote html page from php and get back the result of javascript which was calculated in that html remote.html

<html>
<body>
<script language="javascript">
document.write( "Hello World" );
</script>
</body>

View Replies !
Grab Html From Remote Webpage
I'm trying to create a webpage where I can input a URL to a form. The page will then grab the html of the URL and put it in a mysql database. I'de like to just make it clear that I am not at all trying to steal content. I'm trying to build a small searchable directory of websites. I need the html to search through. I'm doing this for a friend, and unfortunately his site is on a linus server, so this particular part of the site has to be done in php - which I do not know.

View Replies !
Get PART Of A File (via ID)
So I want to get part of a file, specifically everything WITHIN the div id="left". I have this code, but it gets the whole file. I want to use this to edit a remote file test.html). Code:

View Replies !
Php Form To Allow The User To Enter Part Of A Last Name And/or Part Of A First Name To Display The Data
I'm sure this is not a hard thing to do, but for some reason I can't get my mind to figure this out. I have a database with Name, Address, and Car Type tables. 

I'm just trying to do a simple php form to allow the user to enter part of a last name and/or part of a first name to display the data in the tables. My brain has twisted around this and I cannot figure it out.

View Replies !
Call Remote PHP Script On HTML Page
I have (almost) completed a php script. The client has an existing site and the pages have some graphical elements that need to be there. Hence whenever the htm page is called, i want the php script to run at a particular location on the page and insert the result there before sending the page back to the user.

I am trying to avoid having to copy and paste the php code onto every page and save all pages with the php extension.

Do I (I am Java-speaking here) declare it as a class and the procedure as a method with parameters? and place the script in the cgi-bin. Then make an instance of it on the page and call the method and pass the parameters to the phh script from there?? i was not able to locate an 'import' declaration to achieve this.

View Replies !
Reading Part Of A File
I would like to read say... ONLY the last 200 bytes of a REMOTE, BINARY file. How can i do this?

View Replies !
Searching For A File If I Only Part Of The Name
Using PHP 4.4.4.

What is the easiest way to return the full path of a file if I know
the directory it is in and the beginning part of the file (it will
begin with the word "header")?

View Replies !
Small Part Of Txt File
Im trying to get information from a txt file using two different arrays. I want to store line 1 of the txt file in one array and line 2 to 7 in another array. how i can get started on this?

View Replies !
Appending To A Certain Part In The File
$myFile = "testFile.html";
$fh = fopen($myFile, 'a');
$stringData = "$whatuwrote";
fwrite($fh, $stringData);
fclose($fh);

Something like that, Do you know how to put that into the middle of a file instead of writing it at the bottom of the page.

Example:
echo "hey";
echo "APPEND HERE";
echo "hey";

View Replies !
Read From A Html Site
I want to read a html site on the net. And the php script must catch (or better parse?) all the data between <td> </td> to put it in a txt file. Can anyone of you help me out?

<TABLE bgColor=#cccccc border=1 cols=5 width="100%">
<TBODY>
<TR>
<TD>Gabler Joachim</TD>
<TD>&nbsp;</TD>
<TD>Goethestr. 5, 14163 Berlin</TD>
<TD>&nbsp;030-809729-0</TD>
<TD>&nbsp;</TD></TR>
<TR>
<TD>Gabriel Christian</TD>
<TD>&nbsp;</TD>
<TD>Otto-Suhr-Allee 97, 10585 Berlin</TD>
<TD>030-3416024</TD>
<TD>030-3419042</TD></TR>.

View Replies !
How Can I Get Php To Read A Html Extention?
I would like to get php to parse a regular .html page. I just don't know where and which file I need to edit to add the html?

View Replies !
How To Get .html/.htm Extensions Read As .php
I have a site with a lot of preexsisiting links/pages that are of the .htm, .html extension but they need my basic php functions added to them.  Anyone know how i can get them read as .php without having to rename every page and link?

View Replies !
Read An HTML Page
It may sound kind of crazy, but I'm trying to see if there's a way php code can 'read' contents of a static HTML page and store the contents into a variable. Is it possible? If so, how?

View Replies !
Read Html Table With Php
how to read an html table with PHP and parse it. I have numerous web pages, each containing one html table and with one .gif graph.

I want to parse the html table and insert as a record into mysql. Unfortunately, it is not in XML which would make this easier.

View Replies !
Include Part Of A Text File
I have a text document that stores text for use in a flash movie. I'm
also using PHP to displace the same text on another page. However the
text document includes 2 tags for use by the flash movie... title= and
&content= ... see text file at end of post ....

when i use the php command <?php include ("info.txt"); ?> it also
displays those tags. Is there any way to use php to just display what
apprars after the &content= in my text file.

I can't remove the tag begause it is required for the flash file
elsewhere on the site.

"
title=CDN HOME &content=The COMPUTER DONATION NETWORK is a resource of
new, used and refurbished computer equipment, software, networking gear
and lab furnishings for "

View Replies !
Include Part Of The File Isn't Working
i have a menu.inc file that i want to use on multiple pages and one of the pages can be found at http://members.aol.com/itsjojofasho/home2.php but for some reason, the include part of the file isn't working when i upload it. but it works when i'm working offline on my computer.

View Replies !
How To Read HTML Email Text?
I've done a couple of hours web-searching without turning up many
answers so far, and I guess I could figure it out (eventually) from
the MIME format, but here goes with my question...

I don't have any problems reading text emails, but can anybody direct
me to some PHP source code that will read (the text inside) an HTML
email, specifically the "From", "Subject" and especially the message
body?

I would like the code to be able to differentiate between (i.e. know
that it is) a text or an HTML email, and I would like the code to
ignore any attachments.

I don't expect the incoming email to have any (or large) attachments,
but I hope that any code samples can handle the possible case of big
attachments coming along for the ride.

Incidentally, if I did (not this time) want to handle large
attachments, can PHP and/or servers handle megabytes of data being
read into a string variable through fread()? I'm just getting into
this stuff, and not sure of what areas would be a resource and/or
performance hog.

View Replies !
Output Without HTML
I'm making a comment system and I need to somehow stop users being able to mess up my page with PHP or HTML within their comment. I'm thinking of some complicated string replacement system when they input (Or output) to remove any kind of HTML.

View Replies !
HTML Output
I've set uo this form so that people can leave comments, which is working perfectly, but im having the problems with the output.

I want to output the comments in a table using HTML and eventually some CSS (i've had a go with HTML below) but i cant get it to display.

Can anyone suggest how i can embed HTML into my PHP Script so i can format the output??

Also, can someone help me with the loop, becauase the way it is now im sure it will only output the last record (comment) in the database. I need to print out all comments in the database. Code:

View Replies !
HTML Output From PHP
I'm just starting to build a site using OOP for the first time. Until now, I've only used procedural script. One difficulty I'm having is getting good looking HTML resulting from the scripts. It's all jumbled and very difficult to read. This is a problem when designing the site because it's hard to tell what's what.

My question is, is there a simple way of running a function on the text to be output to clean-up the html and format it? I know this isn't a huge deal in the grand scheme of things, but I would really like to have better looking HTML output.

View Replies !
Output To Html
I'm having some trouble with this concept of getting PHP output to HTML with in a HTML page. The data will help determine the images that are shown on the page.

. so have PHP output put in a file (image numbers). I can do the fopen in php but I can't seem to find the code/concepts that move the data between the to. Code:

View Replies !
Grab The ID From The DB And Pass It To Be Part Of The Renamed File
I have another file that copy a template from a folder (here for the example: footer.php
to another folder within that folder where now is the new copied "footer.php" I run the following script Which results in "No such file et..." The idea behind $ID is that the new file got to be have a different name than other similar files And got to be unique so I grab the ID from the DB and pass it to be part of the renamed file Well it does not work as planned.

<?
$rename=$id;
$file_name = footer.php;
$read_extension = explode(".", $file_name);
$ext = $read_extension[1];
$renamed = $rename.".".$ext;
rename($file_name, $renamed);

?>

View Replies !
Read Html/txt Mail From Postfix Queue
I'm looking for a php class script that display hmtl+txt mail from postfix queue.

View Replies !
Grab Output Html
I was wondering if I included something like "includes/encodepage.php" into mainfile.php ( Which gets included by almost every php file on my site ) If you could grab the output html into a variable so I can process it before it gets sent to the clients browser.

I want to make a script that encodes the pages with javascript before it gets sent to the client, but I need to figure this out first..

View Replies !
Display HTML Before PHP Output?
I have a menu that outputs an RSS newsfeed using a PHP script (CaRP -
however it ALWAYS displays the PHP
outputted HTML before the embedded HTML. This happens regardless of the
order; HTML first PHP second, or visa versa. I am assuming that the PHP
engine writes the PHP output first by default??

Is there a way to force the PHP to output in the order it is
"written"...at least, can I control it?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved