.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #31  
Old August 14th, 2003, 05:25 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

Quote:
Originally posted by Imperator Fyron:
Well if you want to write it yourself, guess that leaves me off the hook. But if you do want me to, just tell me specifically what you want the script to do.
Ok, I'll let you do the job and then see if I can understand how it works, here goes:

When pressing the link
&#060a href="gamefile"&#062&#060img border=0 width=34 height=34
src="images/getturn.png"&#062Get latest game turn file &#060br&#062&#060/a&#062

it should find the first file in the directory gamefile and initiate a download to the client of that file.

the href="gamefile" ofcourse can be substituted for whatever, it's the icon and text in the link that needs to be preserved.

gamefile is a subdirectory to the server directory which is d:\data\server

Doable?
PHP is installed now and seems to work ok.

[ August 14, 2003, 04:27: Message edited by: Ruatha ]
Reply With Quote
  #32  
Old August 14th, 2003, 05:28 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT:Is this the right forum for HTML help?

What do you mean by "first file in the directory"? You can sort files in any order you want, so there isn't a first file. Do you mean the file containing the latest turn? That should be fairly easy, just a simple while loop testing each file to see if it has a larger number than the Last.

Also, how are the files named? Do you name them all the same way, but just with a different number in each filename?

[ August 14, 2003, 04:29: Message edited by: Imperator Fyron ]
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #33  
Old August 14th, 2003, 05:36 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

Hey.
PHP looks much easier than CGI, why didn't I check this out before?
Reply With Quote
  #34  
Old August 14th, 2003, 05:44 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT:Is this the right forum for HTML help?

Dunno. Care to answer my question?
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #35  
Old August 14th, 2003, 05:51 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT:Is this the right forum for HTML help?

I have your script written, I just need to know what the file naming scheme is.

Actually, go here to see it in action:

http://www.spaceempires.net/ruatha/

There are 4 files in the folder:
ng1.zip
ng01.zip
ng12.zip
ng3.zip

You can d/l the script here:

http://www.spaceempires.net/ruatha/index.zip

You will need to set the appropriate path info and such, as commented in the script.

[ August 14, 2003, 04:53: Message edited by: Imperator Fyron ]
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #36  
Old August 14th, 2003, 05:55 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

Sure.
When I do a script that looks for files in the directory it dirst returns the directorys "." and ".." and then a filenamen for the turn file, and I don't want it to try and download the current or above directory !
The turnfiles are named NGC3_57.zip with 57 variable.

I've done this but it seems to download into the browser and view the file there, and it gives header errors and I can't seem to get the path right!
So I'll be watching your script when it comes!!

That is propably what you'll get when you try to patch several scripts together!

[ August 14, 2003, 05:00: Message edited by: Ruatha ]
Reply With Quote
  #37  
Old August 14th, 2003, 05:56 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

Quote:
Originally posted by Imperator Fyron:
I have your script written, I just need to know what the file naming scheme is.

Actually, go here to see it in action:

http://www.spaceempires.net/ruatha/

There are 4 files in the folder:
ng1.zip
ng01.zip
ng12.zip
ng3.zip

You can d/l the script here:

http://www.spaceempires.net/ruatha/index.zip

You will need to set the appropriate path info and such, as commented in the script.
Thanx, will check it out now!
Reply With Quote
  #38  
Old August 14th, 2003, 06:04 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

Good,
I changed the path and the Last character from g to _ and so far it works ok.

Thanx Fyrons PHP script at my site (Not incorporated yet)

Now I just need it to start an automatic download instead of making a link....

This is the script I made prior to yours, it finds the right file but as I said I get header errors and it shows the content in the browser:
http://ruatha.homelinux.org/test.txt


Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 40

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 50

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 52

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 58

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 60

Warning: Cannot modify header information - headers already sent by (output started at d:\data\server\test.php:1) in d:\data\server\test.php on line 62

and then it starts to show text of the content of the zip file, not what I had in mind!

[ August 14, 2003, 05:22: Message edited by: Ruatha ]
Reply With Quote
  #39  
Old August 14th, 2003, 06:34 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT:Is this the right forum for HTML help?

Well... I am not really a PHP expert, so I am not sure about those header lines. If the syntax is correct, it may be that your install of PHP does not support them or something. My guess would be that they are not really necessary though...

Don't forget to format the page how you want. The easiest way would be to include a HTML file before and after the echo statements, such as this:

include ("header.html");

These files would just be the portions of the page above and below where the turn file is to be displayed.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #40  
Old August 14th, 2003, 06:39 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: OT:Is this the right forum for HTML help?

It seems to have something with not being allowed to send any information to the browser before the headers, I've removed all text output before the headers but still...

If the headers aren't needed, how to make the browser download the file without the need of clicking any link??

[ August 14, 2003, 05:41: Message edited by: Ruatha ]
Reply With Quote
Reply

Bookmarks


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 On

Forum Jump


All times are GMT -4. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.