SV650.org - SV650 & Gladius 650 Forum



Idle Banter For non SV and non bike related chat (and the odd bit of humour - but if any post isn't suitable it'll get deleted real quick).
There's also a "U" rating so please respect this. Newbies can also say "hello" here too.

Reply
 
Thread Tools
Old 15-03-06, 05:55 PM   #1
TSM
The Sick Man
Mega Poster
 
TSM's Avatar
 
Join Date: Nov 2004
Location: Peckham.SE.LDN
Posts: 4,768
Default Small PHP issue

Odd problem. I have a small php file that just proxys the data from one page to another so that the end user does not know the original url. Problem i am having is that it works on one machine and not the other.

Code:
  $dataFile = fopen( "http://xx.xx.xx, "r" ) ;

  if ( $dataFile )
  {
   while (!feof($dataFile)) 
   {
       $buffer = fgets($dataFile, 4096);
       echo $buffer;
   }

   fclose($dataFile);
  }
  else
  {
   die( "fopen failed" ) ;
  }
The code above works on my home machine but not on my webserver. I might have to use fsockopen instead as that works fine.

Any Ideas why? Not a major problem though.

OS: XPSP2, IIS
__________________
OTR: KTM 690 Duke R 2015 Full Akro
SIDELINE: Kwak ZX636 A1P 2002, Red, R&G's, Yoshi, Double Bubble Screen
GONE: Kwak ZX-7R P1, Full Akro, Undertray, Screen
GONE: SV650S K2 Very Bruised & Without Fairing, Motovation Frame Sliders, R&G Ally Sprocket Toe Protector, HEL 2 Line Setup, GSXR K1 600 RWU Forks, Barnett Clutch & Springs, Penske 8981 Shock, Gilles Ti Rearsets, Steel Barends, Scottoiler, AFAM Chain & Sprockets, Twin FIAMM Horns, Skidmarx Bellypan, Full Micron Zeta Steel System, Cut down undertay.

Forum Problems & Information / Site Suggestions
TSM is offline   Reply With Quote
Old 15-03-06, 06:06 PM   #2
mac
Guest
 
Posts: n/a
Default

I wish i understood one word of that

  Reply With Quote
Old 15-03-06, 06:45 PM   #3
Gnan
Guest
 
Posts: n/a
Default

are you escaping the backslashes in your URL? is your local webserver running linux?

there's a few problems with fopen() in a lot of PHP versions

personally i'd not bother with it and use curl
  Reply With Quote
Old 15-03-06, 07:08 PM   #4
TSM
The Sick Man
Mega Poster
 
TSM's Avatar
 
Join Date: Nov 2004
Location: Peckham.SE.LDN
Posts: 4,768
Default

Quote:
Originally Posted by Gnan
are you escaping the backslashes in your URL? is your local webserver running linux?

there's a few problems with fopen() in a lot of PHP versions

personally i'd not bother with it and use curl
nop is an IIS server so i dont have the curl option.

I guess i will have to use fsockopen
__________________
OTR: KTM 690 Duke R 2015 Full Akro
SIDELINE: Kwak ZX636 A1P 2002, Red, R&G's, Yoshi, Double Bubble Screen
GONE: Kwak ZX-7R P1, Full Akro, Undertray, Screen
GONE: SV650S K2 Very Bruised & Without Fairing, Motovation Frame Sliders, R&G Ally Sprocket Toe Protector, HEL 2 Line Setup, GSXR K1 600 RWU Forks, Barnett Clutch & Springs, Penske 8981 Shock, Gilles Ti Rearsets, Steel Barends, Scottoiler, AFAM Chain & Sprockets, Twin FIAMM Horns, Skidmarx Bellypan, Full Micron Zeta Steel System, Cut down undertay.

Forum Problems & Information / Site Suggestions
TSM is offline   Reply With Quote
Old 15-03-06, 07:13 PM   #5
Sudoxe
Guest
 
Posts: n/a
Default

bloody long way round, try this
<?
require ("http://www.x.x.x.x");
?>

or

<?
include ("http://www.x.x.x.x");
?>
  Reply With Quote
Old 15-03-06, 07:20 PM   #6
TSM
The Sick Man
Mega Poster
 
TSM's Avatar
 
Join Date: Nov 2004
Location: Peckham.SE.LDN
Posts: 4,768
Default

Nop does not work either. Weird there may be a problem in php on IIS.
__________________
OTR: KTM 690 Duke R 2015 Full Akro
SIDELINE: Kwak ZX636 A1P 2002, Red, R&G's, Yoshi, Double Bubble Screen
GONE: Kwak ZX-7R P1, Full Akro, Undertray, Screen
GONE: SV650S K2 Very Bruised & Without Fairing, Motovation Frame Sliders, R&G Ally Sprocket Toe Protector, HEL 2 Line Setup, GSXR K1 600 RWU Forks, Barnett Clutch & Springs, Penske 8981 Shock, Gilles Ti Rearsets, Steel Barends, Scottoiler, AFAM Chain & Sprockets, Twin FIAMM Horns, Skidmarx Bellypan, Full Micron Zeta Steel System, Cut down undertay.

Forum Problems & Information / Site Suggestions
TSM is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My issue.......... jumjum_0214 Bikes - Talk & Issues 5 09-03-08 06:27 PM
Ladies Bike gear - Small or Extra Small! StreetHawk Stuff Wanted 8 07-12-07 06:18 PM
Is this an issue? The Mass SV Talk, Tuning & Tweaking 5 24-01-06 11:55 AM


All times are GMT. The time now is 04:11 AM.


Powered by vBulletin® - Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.