TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

splash script

Page: 1 2 3 4 Reply
May 19th 2002#48770 Report
Member since: Mar 16th 2001
Posts: 2421
Well as you see I want to add a random splash page to the front page that users will make. Here is the deal. I'm using this code.

[CODE]< ?
$images = array("splash/ax.htm","splash/sidez1.htm","splash/sidez2.htm","splash/qtone1.htm");
srand((double)microtime()*1000000);
$max = count($images) -1;
$splash_num = rand(0, $max);

require("$images[$splash_num]");
? >[/CODE]

Here is the problem. I have the pages in a folder called splash. No problem there. But, the images are inside the splash folder in a folder called images. They are not loading. The script is trying to call the root images folder and I don't want to clutter that one up with all these new images. How can I point it to the images/ folder inside the splash folder??


Also new problem. The main page of this site is index.php
This is a php script. Now how the heck am I supposed to have this random splash page load as an index page/first page when the main page is already called index.php (and don't tell me to rename that one because I'll have to change every link in the site). I can call this splash page index.htm or something but then the .php code won't work. Sighs.....

Anyone?
Reply with Quote Reply
May 19th 2002#48771 Report
Member since: Mar 16th 2001
Posts: 2421
And if anyone knows of an automated way of doing this PLEASE speak up. As it is I'm going to have to manually do every page. I could make up a database but I'm not exactly sure about that....
Reply with Quote Reply
May 19th 2002#48808 Report
Member since: Mar 16th 2001
Posts: 2421
Ok, well I can fake it using a hidden frame but I hate doing that.

Hunkorama come save me!!!!!!!!!!!!
Reply with Quote Reply
May 19th 2002#48813 Report
Member since: Apr 20th 2002
Posts: 3000
maybe point it to: ~splashes/images
Reply with Quote Reply
May 19th 2002#48822 Report
Member since: Apr 1st 2002
Posts: 1487
index.html with a auto redirection to splash.php, maybe
Reply with Quote Reply
May 19th 2002#48825 Report
Member since: Mar 16th 2001
Posts: 2421
Well I have it working now in a hidden frame. Oh well. I'm sure there is a much better way but this had to be a quickie...
Reply with Quote Reply
May 20th 2002#48893 Report
Member since: Mar 18th 2001
Posts: 1690
redirecting from index.html to splash.php won't work I dont think. Not sure about it on a windows server, but on apache/linux, .php takes precedence over .html
Reply with Quote Reply
May 20th 2002#48894 Report
Member since: Apr 1st 2002
Posts: 1487
Originally posted by Axiom
redirecting from index.html to splash.php won't work I dont think. Not sure about it on a windows server, but on apache/linux, .php takes precedence over .html


yea, that was the only thing i was unsure of, but i thought id suggest it anyway
Reply with Quote Reply
May 20th 2002#48897 Report
Member since: Jun 30th 2001
Posts: 447
How can I point it to the images/ folder inside the splash folder??


You could always use a relative path such as /splash/images/whatever.gif. This basically tell the browser to fetch the image at http://www.teamphotoshop.com/splash/images/whatever.gif.

Now how the heck am I supposed to have this random splash page load as an index page/first page when the main page is already called index.php...


Call your splash screen splash.php or something. Then create a .htaccess file in your main www directory. Put DirectoryIndex splash.php in it.

There, all your problems solved!
Reply with Quote Reply
May 20th 2002#48899 Report
Member since: Mar 16th 2001
Posts: 2421
yeah I did that and used index.htm then used a one pixel frame and used the main page as the splash.php, seems to work so far...
Reply with Quote Reply
Page: 1 2 3 4 Back to top
Please login or register above to post in this forum