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.





Is It Possible To Read ASP.NET Web Page In PHP?


Is it possible to read another web page in PHP?
If is ASP.NET, the code would be
------------
WebRequest req=WebRequest.Create("http://www.microsoft.com");
WebResponse res=req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
String Output=sr.ReadToEnd();
Response.Write("The content is : " + Output);
--------




View Complete Forum Thread with Replies

Related Forum Messages:
Pass The Variable From 1st Page And Read It With Other Name On 2nd Page
I am new to this and learning slowly, but I was hoping someone could give me some quick advice on how to create a variable on one page and have it passed to another to be read as an ID for a mySQL database.

I want to pass the variable "varRevID" from one page and have it read as "reviews_id" on the other.

My database is pulling from just the first record and I would liek to designate from the pointing page which record to pull from.

View Replies !
Read A Web Page
i want to store(read) the contents of a "web page" into a file. how can i do it in PHP. Please help me. The web page contains a table. i want to fetch & store the contents of that table into a file.

View Replies !
Read A Web Page And Then Display
I'd like to read a webpage, the parse it and display a small part of
it. Here is what I've tired. It isn't working.

<?php
$handle = fopen("http://www.yahoo.com/", "r");
$contents = fread($handle, filesize($filename));
echo $contents;
?>

View Replies !
Q: Read Text With VBA From A PHP Web-page
I created a page on our intranet that shows a number and that
increases for every time the page is opened. It is similar to a
visitors-counter.
When I look at the page with Internet Explorer it works just fine.

Now I want to read this web-page from a MS-Word macro and include the
number as a company wide unique id in my MS-Word document.
Unfortunately, the PHP script doesn't update the counter when I call
it from my MS-Word macro.

How can I force PHP to update my counter when I call it from a VBA
macro?

I am using the following code:

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 !
Load Page Then Read
Is there a way to completely load the page of its HTML elements then read all those elements into a string? For example, I have a PHP page that get its HTML content from the database. I want that page to completely loads, ie., get the content from the database, then write all of that page's text and html elements into a string so I can modify it (ie. remove all the links) to display it in another page.

View Replies !
Read Previous Page Url
I have a query regarding browser url.Let me narrate the exact scenario which i need. I would like to expire my session when a person enters different url in the navigator bar other than my url and comes back to my url. For example if i visit example.com and then i type gmail in the same navigator bar and then move back to my url example.com through browserback button then i have to end the session of my client i mean he has no more access to my site. The same scenario is there for icicibank.com. I wanna the code using php and javascript.

View Replies !
Read Page To Variable
I have tried tons of functions but none works the way I want. I have a page foo.php. Then in that I set a couple of variables. Now, if I include foo.inc.php that file can use all of these variables. Code:

View Replies !
Code To Read A Web Page
How can I read another web page in php. I tried:

$url = 'http://www.yahoo.com'
$contents = file_get_contents($url);
echo $contents;

but I get an error: The specified CGI application misbehaved by not returning a complete set of HTTP headers.

View Replies !
Which Function Do I Need To Read The Page Through Http?
I need read the html page through http and extract the links from it. Which function is better to use for this purpose: fopen() + fread(), file_get_contents(), or fsockopen()?

View Replies !
Read Data From External Page?
I have tried to think of a solution to this problem, but i can't find it. My question is: If possible, how do you from your own page confirm that a form has been send from an external page?

View Replies !
Page Not Read By Conditional When In Sub Folder
I'm using some php conditionals in included footer.

I identify some pages at the top with -

$page='alt_footer'

then have a conditional in the footer.php, like -

if ($page!='alt_footer') {

All works great, but if I put the page in a sub directory (making path adjustments for the includes), it is not recognized as having $page='alt_footer'

All path relationships between the page (in sub folder) and the includes (in folder at same level as sub folder) work fine, just the conditional (from the include to the page) is not recognized.

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 !
Read The Page Of The Site & Rerturn The Contents Of MEMBERS_URL & MEMBERS_NUMBER
a line on my site reads MEMBERS_URL="my2ndsite.com" MEMBER_NUMBER="12345" . Im Trying to read the page of the site & rerturn the contents of MEMBERS_URL & MEMBERS_NUMBER, but i cant get it to work can anyone suggest where ive gone wrong please PHP Code:

$myfile = file("http://www.mysite.com");
foreach ($myfile as $row=>$data) {
if (preg_match('/MEMBERS_URL="(.*?)" MEMBERS_NUMBER="(.*?)"/',$data)) {
echo $data[1];
echo $data[2];
}
}

View Replies !
When A Search Engine Spiders A Page Does It Read The Raw Code Or The Parsed Html?
When a search engine spiders a page does it read the raw code or the parsed html? I ask as I want to confirm if any text retrieved from a database is 'read' not the php code that gets the data.

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 !
Fgetcsv Returns False In Dynamic Read Vs. Hard-coded Read ??
I am working with directories in PHP for the first time. I have code
that I've changed multiple times to try different things. I would think
this is pretty standard fare so I'm not sure why I can't seem to get it
right.

What I would like to see happen:

The code opens the directory and loops through the files, opening them
and processing them.

What is happening:

If I hard code the name of one particular file (it is always the same
file) in my test setting, fgetcsv does not return false and the code
runs fine. The file is parsed and all is well. However, if I let the
code open a directory and then loop through the files, this one
particular txt file does not work. For debug purposes, I have it
displaying each file name and it can display the name, it just won't
process it.

I've even tried setting a for loop and hard coding each file name
(since right now I know the names - I won't in the future) and the file
is processed. It is only when it is set to my $file var dynamically
rather than being hard coded.

Here is the code:
$handle_dir = opendir('../directory_name');
/* loop over the directory. */
$countfile=0;
while (false !== ($file = readdir($handle_dir))) {
$countfile++;
$filevalues = "";
//Skip the first two files that where found because they are
"." and ".."
if ($countfile 2) {
//echo $file;
//begin loop through each file name
$handle = fopen($file, "r");
echo "Filename is: $file<BR>";//at this point the
code can print the file name
if (false == ($filevalues =
fgetcsv($handle,6021,','))){
echo 'problems<br>'//for one particular file,
this always displays
}

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 !
Read Contents Of An External XML Page And Then Parse Its Contents
I have a URL that generates an XML page. I'm trying to read its contents and parse the information. But, I keep receiving these error messages: Code:

View Replies !
How To Read Up To A Point And Assign The Read Value To An Array.
Open a text file which will look something like this:

QuoteLink 1 http://www.blahblah.com/1651561
Link 2 http://www.etc.com/34324
Link 3 http://www.sdfkjsdf.com/12343423

basically its a "Link n" text followed by a URL text in the format of "http://www.page.com/random numbers"

What I would like the php script to do is to read "Link n" text and output it with the a http link to the URL which follows it. That is it should look something like this in the output:

Link 1
Link 2
Link 3

I have learned how to read a text file with php so far but I have no idea how to make it read up to a point and assign the read value to an array.

View Replies !
Set The Session Variable To Read The Session Variable In The Next Page.
I have a PHP web app, that runs with Register global off. It sets $_SESSION variables that are used in other pages. The script works fine on my server that runs Apache2 and PHP 5.0.1.

But when I move the scrip to my hosting company that runs , IIS and PHP5.0.2, they don't work. It seems that its not able to set the session variable to read the session variable in the next page. cvWhat should I be checking ? Has anybody faces this situation before ?

View Replies !
Can PHP Read Another Url
Is there a function in php that can get a url and not parse the php if it is a .php file?

Like:

$Capturedhtml = file_get_contents($GetURL);
will this work on a .php without parsing the php?

View Replies !
Php.ini Not Being Read
i have php/apache/mysql on freebsd. i specified the location of the php.ini file (./configure --with-config-file-path=/usr/local/php/blah/php.ini). i am trying to disable the default global vars definition. i looked at phpinfo() and it says the php config file is that path, yet after i turned register_globals to on, it still says off so i guess its not reading the file. so, basically i need to know if there is something with apache i need to do??? oh yea....php is installed as a dso module.

View Replies !
Read An Flv With Php?
I want to read an flv file with php. For example, determine the length
(time) of the movie. Or generate thumbnail images from it. Does such
a library exist?

View Replies !
Read XML In Php?
I have this feed:
http://www.slougheaz.org/xml2/feed_two.xml

Which is a pure XML feed (not an RSS one).  How can I go about reading it in a browser using php?  I was told of simplexml, but is that just not for parsing an RSS XML document when this is a pure XML document?  If so what other ways can I use to let php read the file?

View Replies !
Changes To Php.ini Not Being Read Through
PHP 5.1, Windows Server 2003, IIS 6, isapi

I changed a line in the php.ini file to
extension_dir = "c:phpext"
but when I load my phpinfo page it shows
extension_dirC:php5

It's like my change didn't take effect.

I restarted the world wide web publishing service, but still the same thing. What do I do to make the change take effect? I cannot simply reboot the server. It is remote and hangs on restart, so I have to do this without a reboot.

View Replies !
Read .bmp -> .jpg Or Anything Else
I'm trying to resample a bmp image, i don't control this format, it seems the gd lib doesn't support this one, wbmp is supported (wireless format), but not traditional .bmp files.

View Replies !
Read Only
I'm trying to figure out how to make the name files read only once they create it through php with an account maker. This is being made for a game called Open Tibia. When players die they will lose experience and equipment. I COULD do it manually but then i'd have to do it every 2 seconds because people will constantly make accounts.

View Replies !
Read XML
I want a .php script to read a XML file and list all the nodes ie:

<Header>test</Header>
<Job>Manager</Manager>

PHP Code:

echo $Header;
echo $Job;

View Replies !
Read Bookmarks (or Xml)
All right so I installed the latest APB and I wan't to import all my Mozilla bookmarks into it but the problem is that it would take almost an hour to do it manually. So instead i'll spend a few hours coding a script to do it in a second!

So I wan't something to read the bookmark file and end up with a structured something (object, array, etc). I decided to get my hands dirty with XML (really dirty) but SAX doesn't read attributes and expat developpement seems to be in alpha stage (and it returns giberish anyway).

I'm using moz 1.0 and the bookmark file is not strict xml/html/nothing really because there's not always an ending tag.

How could I do this? Is there any existing package/technology to do this or shall I roll my own with fopen and the like?

View Replies !
Htaccess To Read XML As PHP
I'm trying to write a RSS feed which will pull info from a mySQL DB. In order
for the server to read the XML file as PHP, I've uploaded a .htaccess file to my server with this code in it:

AddType application/x-httpd-php .php .xml

Then, my feed looks like this:

View Replies !
Read Log File With PHP?
It turns out that opendir and a number of other cool PHP features are disabled by my host. I've had to deal with similar issues before and have worked around them (that's part of the fun.)

What I am trying to do is create a PHP file which will delete specific files from a directory that are more than 24 hours old. My question is this:

Is this possible without readdir and opendir? Can I use fopen and fread as alternatives in my solution?

The key problem that I see is that I can read the log file but where do I begin to parse the log file into file names and dates?

Typical entries in my log file would look like this:

2007/05/02 2:00:31 :
File http://www.example.com/myFile.zip
Sent to someone@example.com

2007/05/02 2:08:31 :
File http://www.example.com/myPic.jpg
Sent to someone2@anotherexample.com

I guess I would have to somehow define the format of each entry? If so how would I do this. Is this idea even realistic with PHP?

View Replies !
If I Set Cookie Using CGI, Can I Read It Using Php ?
if i set cookie using CGI, can i read it using php ? i have a cgi file that sets this cookie.

#!/usr/bin/perl -w

use CGI;

my $query = new CGI;
my $value = "testcookie";

my $cookie_out = $query->cookie(-name=>"myval", -value=>$value);
print $query->header(-cookie=>$cookie_out);

at the same site/ domain , how do i check the value in the myval cookie using php ? whats the php code example to read a cgi cookie ?

View Replies !
Read A File Name?
Is it possible to read a file name from inside a file, then set that name to a variable?

View Replies !
How To Read MIME In Php?
Does anyone know if there is a class that handles e-mail MIME messages reading in php due to create a very simple webmail? If there aren't classes built for these purpose, how can I do it?

View Replies !
Read Out Of The Database
could someone please write the code for read out of the database...
here is my input code:

$Host = "localhost";
$User = "david";
$Password = "david";
$DBName = "hej";
$TableName = "text";

$Link = mysql_connect ($Host, $User, $Password );

//$db = mysql_select_db($DBName,$Link)
$Query = "INSERT into $TableName values (&#3911;',&#3922;',&#3933;')";

print ("The query is:<BR>$Query<P>");

if (mysql_db_query ($DBName, $Query, $Link))
{
print ("The query was successfully executed!<BR>");
}
else
{
print ("The query could not be executed!<BR>");
{
mysql_close ($Link);
}
}

View Replies !
Can't Get Php To Read Ini File.
My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d
PHP/5.0.4 on Solaris 10.

phpinfo() lists the location of php.ini as /usr/local/apache/conf and
my php.ini file is there but for some reason it does not appear to be
being read by php. I have defined things such as upload_tmp_dir in
that file yet even with restarting apache I am not seeing this
reflected in phpinfo().

View Replies !
Read An Xml File Using Php
i am trying to read an xml file using php and i am stuck at a place, below are my xml tags, i have to retrieve the attributes of the parent and the corresponding tags Code:

View Replies !
Read/Write
I have an admin page that adds events into a .dat file on the server as plain text. Code:

<?php
//format incoming form data
$content = $eventname."|".$eventdate."|".$eventabout."|".$url."|".$date."|".$author."|".$id."|".$email."|"."";

//rewrite data file with new data
//place newly submitted post at the beginning.
$eventsfile = "../events/events.dat";
$handle = fopen("$eventsfile", "r");
$contents = fread ($handle, filesize ("$eventsfile"));
fclose($handle);
$handle = fopen("$eventsfile", "w");
fputs($handle, $content.$contents);
fclose($handle);?>

The effect is to read the data from the file, put the new data at the beginning and rewrite the file. So I guess my Questions are:

1) If more than one person submit the form at the same time is there any chance for data loss? Does php que file requests?

2) Is there a better way to accomplish the task

3) Any and all suggestions on improvement are appreciated.

View Replies !
Php Read A File
I am using the following to read the contents of a file.

$Tp = fopen("./orders/T" . $oid , "r" );

This usually works, however the order directory is password protected making this code produce an error:

--Warning: file("./orders/T1166964955") - No such file or directory in...--

Is there any way whicj I can supply the usernameassword to this code : $Tp = fopen("./orders/T" . $oid , "r" ); or will I have to have the file T1166964955 in a non-secure area.

View Replies !
Cant Read Cookies
I'm doing a site that creates a cookie and then needs to read that
cookie later.
The cookie is created fin and I can see it in my browsers cookies but I
can't seem to read it. I've tried referring to the variable straight as
$cookie_var and as $_COOKIE['cookie_var'] but no luck.
if I var_dump($_COOKIE) I get
array(0) { }

Is there something silly I'm missing? I thought it may be my firewall so
I got someone else to check and same story...

View Replies !
Does PHP Read MP3 Tags?
I was wondering has been successful in reading mp3 tags out of file. Tags being Artist, Track Title, etc... I tried using fpassthru() on a file, but I was only successful in outputting a ton of binary data. Any thoughts?

View Replies !
Read Xml Attributes
i am trying to read the xml tag attributes in php but quite not getting it. If anyone have previously done it could you please help me out. I am including the xml code with the post. Code:

View Replies !
How To Read In Variables?
As in PERL, if you got a CGI you call CGL?var=value you can with cgi-lib.pl

$var="$in{'var'}"; so that $var will contain value. What is the PHP equilavent?

View Replies !
How To Read From Stdin Using PHP
In TCL it would be written this way:

Quote:

View Replies !
Set A Cookie And Then Read It
I would like to set a cookie and then to read it. Has anybody a example-script that shows how i can do this? I have seen in the Manual that cookies work different on various Browsers/Versions. Have anybody experience with this problem?

View Replies !
Read FROM Com1
I´m having trouble reading from COM1, writing works like a charm but I´d
like to be able to read the output from a switch or a router in order to
determine that the command was succesful and the configuration actually
went fine :-)

doin´:

$fp = fopen("COM1", "rwb");
fwrite($fp, $username . "
");
if($response == 'password')

works, using hyperterminal shows that I´m logged in and i can actually
config the device as I want, but if I try to do something like :

$fp = fopen("COM1", "rwb");
fwrite($fp, $username . "
");
$response = fread($fp, 4096);
if($response == 'password')
fwrite($fp, $password . "
");
else {
print "no response?";
exit;
}

this is where it ends. Anyone got an idea?

View Replies !
Want To Read In A 20mb .txt
im having trouble reading in a 20mb .txt file into a php script.

is ther some code workaround to buffer the data in?

View Replies !
PHP Read Device
I want to read device information from my hard disk, it's that a posible?

View Replies !
Read And Edit Xml With PHP
I'm trying to write some php that will read in some xml and then allow me to modify the tag and write back out to xml.

In the following example, I want to read in 'text_for_paragraph_1',
then allow it to be viewed, edited, and saved back to the xml... I
have absolutely no clue even where to start...

View Replies !
Open And Read Dir Over Web
what is the equiv. of opendir() and readdir() etc to read directories on another server, if poss? I want to make a little app where the user supplies a url and the app reads the files in it and does some processing...can I do this somehow?

View Replies !

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