Adventure Game Studio

Community => General Discussion => Topic started by: Raven_Gray on Thu 18/12/2003 02:49:08

Title: Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Raven_Gray on Thu 18/12/2003 02:49:08
Help! help! help! :( I really have no idea how to do .php stuff, I bearly know html but I need someone to figure out how some  simple code for me? maybe?  :P Here is how it is; I need to create a webpage which will display one picture, and then  when the page is refreshed, display a new picture in order and so on. In ANYONE knows how to do this please please please help me out.. Thanx a bunch, guys.
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: MrColossal on Thu 18/12/2003 04:23:10
check this out:

http://www.bezveze.com/skripte/rid/

click on example for an example and download to... well... download
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Raven_Gray on Thu 18/12/2003 04:41:21
Wow thanx. You know a program is good if it shows pictures of naked women on the cover. Amen to that.  ::) I'll check it out, though, I would really perfer if I could determin  the order of which the images appear and then they would loop back to the first image. Know what I mean? Anyone know how to do this?
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: MrColossal on Thu 18/12/2003 04:49:11
do you mean like an image gallery only the images are only changed on a refresh?

http://sylpher.com/kafka/randomcomics/index.php?i=1

like this only without the next and previous links?
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Raven_Gray on Thu 18/12/2003 04:59:29
Yes, and yes that is a must. They have to only change on refresh. So if you took all those frames at made each one its own picture all the same size and then loaded them up in a .php? picture gallery thing, each time you refreashed the next picture would appear in the sequence. Is that possible to do? I know absolutly nothing about .php
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Ishmael on Thu 18/12/2003 09:58:32
It's rather easy to learn php if you know something about c/c++ and html, I believe. Check the lowest link in my signature and see what I've learned to do.

You can refresh a page without php. Just use
<meta http-equiv="Refresh" content="1; URL=pics.htm">
to refres teh page after 1 second to pics.htm.

Check out http://www.php.net also.
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Raven_Gray on Thu 18/12/2003 13:49:39
The refreshing the page part is not what I am having a problem with. Its complicated, I know, but I guess I am not making myself very clear. All I need is to make a page with nothing on it except for a picture, but when the page is refreshed, the picture will change to the next one in a sequence. Having it change to a random picture doesn't help me much. It sounds silly to ya'll, I know, but if someone could actually figure this out, that would be great.
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Raven_Gray on Thu 18/12/2003 13:55:27
If there is a way to change the content of  the page, aka telling it to move to the next picture without .php or making it a .GIF (because the all need to be .JPG images), then by all means tell me how. But if you can make a page that displays randomly selected images, then surely wouldn't it be possible to tweak the code so that it selects them in a certain order?
Title: Re:Please help? Anyone who knows ANYTHING about .php code? ???
Post by: Ishmael on Thu 18/12/2003 15:54:04
<?php

$fh = fopen('imgnum.txt','r');
$imgnum = fread($fh,filesize('imgnum.txt'));
fclose($fh);

$imgfilename = 'img'.$imgnum.'.jpg';

echo '<img src="'.$imgfilename.'">';

$imgnum++;

$fh2 = fopen('imgnum.txt','w');
fwrite($fh2,$imgnum);
fclose($fh2);

echo '<meta http-equiv="Refresh" content="1; URL=javascript:history(0)">';

?>

and the heads 'n bodys with html tags outsied fo the <?php ?> tags...


Then, put a file called imgnum.txt on the same folder, where you put the number 1. The image files are then named img##.jpg where ## is the number of the image in order...