ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
multipath.php help (General Discussion)
multipath.php help // General Discussiondlp anneJun 15, 2003, 12:02am
For some reason the multipath.php still dose not work, it stoped working
back in March 2003 and no one can seem to find out why. Was there an upgrade to teh php code that we need to know about? I do remember in teh past that it did this before and stoped working and I was told to change my " to ' to make it work again. Did they go back to " or changed it to something new? Here is the php the way it is now and it don't work. <?PHP $aPaths = array ('http://www.path1.com', 'http://www.path2.com', 'http://www.path3.com', 'http://www.path4.com'); $fIn=$fOut=$IsZip=0; // this block is only needed if AW examines the HTTP header! if ($Content = strrchr ($QUERY_STRING, '.')) { if (stristr ($Content, ".zip")) Header ("Content-Type: application/zip"); else Header ("Content-type: image/jpeg"); } $Namepos = strrpos ($QUERY_STRING, '/'); $Filepath = substr ($QUERY_STRING, 0, $Namepos+1); $Filename = substr ($QUERY_STRING, $Namepos+1); Header( "Content-Disposition: attachment; filename=".$Filename ); $Firsttry = -1; if ($Filename[0] == '~') { $Firsttry = intval (substr($Filename,1,2))-1; $Filename = substr($Filename, 3); if ($Firsttry >= 0) if ($fIn = at fopen ($aPaths[$Firsttry].$Filepath.$Filename, "rb")) { fpassthru ($fIn); // no fclose, fpassthru() closes the file exit; } } $Anz = sizeof ($aPaths); for ($i=0; $i<$Anz; $i++) if ($i != $Firsttry) if ($fIn = at fopen ($aPaths[$i].$Filepath.$Filename, "rb")) { fpassthru ($fIn); // no fclose, fpassthru() closes the file exit; } ?> ryanJun 15, 2003, 12:48am
[View Quote]
> For some reason the multipath.php still dose not work, it stoped working
> back in March 2003 and no one can seem to find out why. > Was there an upgrade to teh php code that we need to know about? > I do remember in teh past that it did this before and stoped working and I > was told to change my " to ' to make it work again. > Did they go back to " or changed it to something new? > Here is the php the way it is now and it don't work. > > <?PHP > $aPaths = array ('http://www.path1.com', 'http://www.path2.com', > 'http://www.path3.com', 'http://www.path4.com'); > > > $fIn=$fOut=$IsZip=0; > > // this block is only needed if AW examines the HTTP header! > if ($Content = strrchr ($QUERY_STRING, '.')) > { > if (stristr ($Content, ".zip")) > Header ("Content-Type: application/zip"); > else > Header ("Content-type: image/jpeg"); > } > > $Namepos = strrpos ($QUERY_STRING, '/'); > $Filepath = substr ($QUERY_STRING, 0, $Namepos+1); > $Filename = substr ($QUERY_STRING, $Namepos+1); > > Header( "Content-Disposition: attachment; filename=".$Filename ); > > > $Firsttry = -1; > if ($Filename[0] == '~') > { > $Firsttry = intval (substr($Filename,1,2))-1; > $Filename = substr($Filename, 3); > > if ($Firsttry >= 0) > if ($fIn = at fopen ($aPaths[$Firsttry].$Filepath.$Filename, > "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > } > > $Anz = sizeof ($aPaths); > for ($i=0; $i<$Anz; $i++) > if ($i != $Firsttry) > if ($fIn = at fopen ($aPaths[$i].$Filepath.$Filename, "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > ?> > > I am not sure, but I was having lots of problems with PHP and trying to get a multipath to work. I was unsuccessful and a friend of mine failed as well in getting it to work. Ryan dlp anneJun 15, 2003, 1:26am
wizard myrddinJun 15, 2003, 5:21am
Create a file called test.php in notebook and in this snippet in it:
<?php phpinfo(); ?> Save as mentioned test.php Run it Then see what changes have been made to your hosters php [View Quote] ananasJun 15, 2003, 6:33am
Do what Wizard Myrddin wrote and check the result.
"allow_url_fopen=1" in the phpinfo.php result is a requirement for the type of fopen() usage in this multipath script. Another test is always : try to download a small model with a web browser, like http://host.dom/path/multipath.php?/models/walk001.zip then open this ZIP file with notepad and see if there's an error message text somewhere. As long as the script URL is not provided, we cannot do these tests for you. dlp anne schrieb: > For some reason the multipath.php still dose not work, it stoped working > back in March 2003 and no one can seem to find out why. > Was there an upgrade to teh php code that we need to know about? > I do remember in teh past that it did this before and stoped working and I > was told to change my " to ' to make it work again. > Did they go back to " or changed it to something new? > Here is the php the way it is now and it don't work. > > <?PHP > $aPaths = array ('http://www.path1.com', 'http://www.path2.com', > 'http://www.path3.com', 'http://www.path4.com'); > > > $fIn=$fOut=$IsZip=0; > > // this block is only needed if AW examines the HTTP header! > if ($Content = strrchr ($QUERY_STRING, '.')) > { > if (stristr ($Content, ".zip")) > Header ("Content-Type: application/zip"); > else > Header ("Content-type: image/jpeg"); > } > > $Namepos = strrpos ($QUERY_STRING, '/'); > $Filepath = substr ($QUERY_STRING, 0, $Namepos+1); > $Filename = substr ($QUERY_STRING, $Namepos+1); > > Header( "Content-Disposition: attachment; filename=".$Filename ); > > > $Firsttry = -1; > if ($Filename[0] == '~') > { > $Firsttry = intval (substr($Filename,1,2))-1; > $Filename = substr($Filename, 3); > > if ($Firsttry >= 0) > if ($fIn = at fopen ($aPaths[$Firsttry].$Filepath.$Filename, > "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > } > > $Anz = sizeof ($aPaths); > for ($i=0; $i<$Anz; $i++) > if ($i != $Firsttry) > if ($fIn = at fopen ($aPaths[$i].$Filepath.$Filename, "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > ?> > > wizard myrddinJun 15, 2003, 6:50am
There is a known "bug" around that does effect some php scripting and the
uRL, if the multipath script used is the same as I sent to Data22 a few years ago it will be out of date now, thus it will be proberly be effected, but now knowing what script is been used its hard to look for errors that can effect the script. In all things this should not effect php, but its one of the things no one can figure out why, proberly something to do with server interactions. [View Quote] dlp anneJun 15, 2003, 7:02am
Do you know of a working one that is up to date with today's php?
I put that test.php on and ran it in a web browser and it dose nothing, it sits there as if its trying to load something but never dose. [View Quote] wizard myrddinJun 15, 2003, 7:23am
Humm,, if that script fails to work as it should means either your hosting
compay has not installed php, which I dought or you are hosting on a company that you have to pay more to gain extra facilities like php,cgi and sql usage. There are some out there, its why when we put a E-commerce site togather we like to reconmend the hosting company that we know has what we need. Check with your hosting agent to see if you can use php scripts free or you have to cough up some more pobble beads. [View Quote] wizard myrddinJun 15, 2003, 7:27am
As a footnote and me recalling if you are still using the hoster that begins
with easy*****.com on a standered hosting package you dont get php facilities,, hence your problem is solved in one splash of a dogs tail.. They like you to part with the beads before allowing php.. [View Quote] kahJun 15, 2003, 8:58am
"wizard myrddin" <admin at rdescape.co.uk> wrote in
news:3eec3360$1 at server1.Activeworlds.com: > There is a known "bug" around that does effect some php scripting and > the uRL, if the multipath script used is the same as I sent to Data22 > a few years ago it will be out of date now, thus it will be proberly > be effected, but now knowing what script is been used its hard to look > for errors that can effect the script. > > In all things this should not effect php, but its one of the things no > one can figure out why, proberly something to do with server > interactions. I'm a bit confused as to what you mean? A bug in what? The main reason for this script not working is server configuration (especially regarding the one directive Ananas posted). KAH wizard myrddinJun 15, 2003, 9:14am
If its server as you say not configured right whats that got to do with the
script , You must know about the server that hosts the script then? You help then. > I'm a bit confused as to what you mean? A bug in what? The main reason for > this script not working is server configuration (especially regarding the > one directive Ananas posted). > > KAH johnJun 15, 2003, 10:10am
Is this 3.4? Because I was told a while back that AW have stopped PHP
scripts for TVs so it may apply to multipath too [View Quote] bowenJun 15, 2003, 3:26pm
[View Quote]
The server has everything to do with the script. If remote loading or
whatever it is is not enabled, it will _not_ work. -- --Bowen-- kahJun 16, 2003, 4:13pm
"wizard myrddin" <admin at rdescape.co.uk> wrote in
news:3eec5518$1 at server1.Activeworlds.com: > If its server as you say not configured right whats that got to do > with the script , You must know about the server that hosts the script > then? You help then. The server executes the script... Anyway, I just wondered what bug you were talking about because your post was a bit foggy. No need to get defensive. KAH dlp anneJun 16, 2003, 9:06pm
hmm executes the script...
I wonder if this may be causing the problem. You now how you can set up the files accuses rights over the ftp, the CHMOD? I use to be able to do this but now it wont allow me to set the number to 777 or 555. Therefor the file only has read and write accuses or just read accuses, it wont seem to let me allow the thing to be executed. [View Quote] andrasJun 17, 2003, 3:18am
[View Quote]
> hmm executes the script...
> I wonder if this may be causing the problem. > You now how you can set up the files accuses rights over the ftp, the CHMOD? > I use to be able to do this but now it wont allow me to set the number to > 777 or 555. > Therefor the file only has read and write accuses or just read accuses, it > wont seem to let me allow the thing to be executed. > > > > This explains why it stopped working:( PHP scripts has to has execute right to be executed by the server. Ask your web provider/host about the PHP script rights. -- Andras "It's MY computer" (tm Steve Gibson) xelagJun 24, 2003, 10:30pm
May I suggest a solution to all this, especially to universe and
galaxy owners? STOP using workarounds. DEMAND politely but firmly from ActiveWorlds that they implement the simple but very necessary features you require. Code that has to do with url paths SHOUL NOT be solved by php or other scripts, it should be solved by ActiveWorlds. An example. There have been multiple requests to allow a flexible filename for the avatars.dat, to allow different worlds to share the same object path. Similarly for terrain, to allow different texture base names. These are two VERY simple features to implement, yet they have not been done. In the meantime, inventive programmers have have given us workarounds... which will work or not according to weather conditions or server configurations.... It's up to you to decide :) Alex On 14 Jun 2003 22:02:57 -0400, "dlp anne" <anne at dreamlandpark.com> [View Quote] >For some reason the multipath.php still dose not work, it stoped working >back in March 2003 and no one can seem to find out why. >Was there an upgrade to teh php code that we need to know about? >I do remember in teh past that it did this before and stoped working and I >was told to change my " to ' to make it work again. >Did they go back to " or changed it to something new? >Here is the php the way it is now and it don't work. > ><?PHP > $aPaths = array ('http://www.path1.com', 'http://www.path2.com', >'http://www.path3.com', 'http://www.path4.com'); > > > $fIn=$fOut=$IsZip=0; > > // this block is only needed if AW examines the HTTP header! > if ($Content = strrchr ($QUERY_STRING, '.')) > { > if (stristr ($Content, ".zip")) > Header ("Content-Type: application/zip"); > else > Header ("Content-type: image/jpeg"); > } > > $Namepos = strrpos ($QUERY_STRING, '/'); > $Filepath = substr ($QUERY_STRING, 0, $Namepos+1); > $Filename = substr ($QUERY_STRING, $Namepos+1); > > Header( "Content-Disposition: attachment; filename=".$Filename ); > > > $Firsttry = -1; > if ($Filename[0] == '~') > { > $Firsttry = intval (substr($Filename,1,2))-1; > $Filename = substr($Filename, 3); > > if ($Firsttry >= 0) > if ($fIn = at fopen ($aPaths[$Firsttry].$Filepath.$Filename, > "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > } > > $Anz = sizeof ($aPaths); > for ($i=0; $i<$Anz; $i++) > if ($i != $Firsttry) > if ($fIn = at fopen ($aPaths[$i].$Filepath.$Filename, "rb")) > { > fpassthru ($fIn); // no fclose, fpassthru() closes the file > exit; > } > ?> > bowenJun 25, 2003, 4:37am
[View Quote]
Woo, you tell them XelaG. You have to admit, they are clever
workarounds though. -- --Bowen-- ryanJun 25, 2003, 4:41am
I agree that AW should accomodate these requests - especially when there
is a situation that the PHP cannot work / host doesn't support it, etc. Ryan uzumeJun 25, 2003, 5:15am
I agree. AWI recently added support for HTTP REFERER. Why not ask that there
be some other world specific data sent in the HTTP request. They could even support a POST instead of a GET that passes in the world name or something (though this might be extreme as I think there are other easily accessible HTTP headers they could add with the world name in it). This would allow the server to determine the requesting world without changing the URL (which AW uses as a cache handle). These are just some hopefully useful idle thoughts. Enjoy, Uzume [View Quote] ananasJun 25, 2003, 7:13pm
There's no scaling yet either - except for dynamic OP users ;)
Tilt & roll shows that they do listen to users requests sometimes. [View Quote] bowenJun 25, 2003, 11:49pm
[View Quote]
Why it wasn't included the first way through is beyond me. I mean come
on; you have X, you have Y, but no Z for rotating an object? (replace variable representations to whichever you wish and to whichever axis you wish it to represent) -- --Bowen-- codewarriorJul 5, 2003, 4:59am
The world name is already part of the HTTP_REFERER string.
Since the format is not documented anywhere that I can see.. here it is for your benefit: aw://xx.xx.xx.xx:port/worldname where xx.xx.xx.xx is the IP of the uni server and port is the port number. Given that there are probably a lot of characters used in worldnames that are illegal in HTTP headers, only time and trial and error (or some detailed information from AWI) will tell how those characters will appear in the referrer string. [View Quote] |