file reading trouble

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

bobnabob
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Dec 23, 2002 3:50 pm

file reading trouble

Postby bobnabob » Mon Dec 23, 2002 3:51 pm

hey i have been having trouble with reading the word of the day html file from dictionary.com when I run he script from a remote server. If i run it from my own server it works fine. here's the script:

$count=0;
$fp = @fopen("http://dictionary.reference.com/wordoftheday/index.html", "r");
$data = "";

while($data!="<!-- SECBR -->\n")
{
$data = fgets($fp, 4096);
$count++;
if ($count>=139) {
echo "$data";
}
}
fclose($fp);


if you guys could tell me how to fix this id be very appreciative ^^ thanks

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Tue Dec 24, 2002 2:38 am

fopen as URL denied ai php.ini

bobnabob
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Dec 23, 2002 3:50 pm

Postby bobnabob » Tue Dec 24, 2002 10:05 am

is there any way i can get around it without changing hosts?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Tue Dec 24, 2002 11:59 pm

if have paid hosting you can ask your support to change that directive in php.ini

if you have free hosting, it is imposible... =(

bobnabob
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Dec 23, 2002 3:50 pm

Postby bobnabob » Wed Dec 25, 2002 9:56 am

hmm ok, is there any way I could copy the file to my server every time someone accesses the page and load it loacally?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Thu Dec 26, 2002 4:26 am

i donnt think that this is posible...


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest