hi, dunno really where to post this but i got kinda problem
this is what i got:
/////// image.html
<img src='http://www.htmlforums.com/archive/index.php/image.php'>
/////// image.php
<?php
$array1 = array('av.gif','sig.gif');
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.htmlforums.com/archive/index.php/$image'>";
?>
that's what i have know, i guess you know what i want, i want just to get a random image on the image.html page, how would i do that ? thank you )and what is wrong? did you get any errors?
you have to seed the random array
<?php
$array1 = array('av.gif','sig.gif');
srand ((float) microtime() * 10000000);
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.htmlforums.com/archive/index.php/$image'>";
?>no you misunderstood my question, my problem is how to get a random image on the image.html file, without having to work with iframes like ad systems work.hmm, i dont know if you can do that.....me neither, but it's for a forum siggy, so i can't use html stuffix T_TOriginally posted by yoda
no you misunderstood my question, my problem is how to get a random image on the image.html file, without having to work with iframes like ad systems work.
did you get an error? and does it even work? I understand what you want I all I said is you need to seed the rand array. nothing was said about an iframe so what are you talking about? you can get a randome image wihout a iframe and what is this html suffix?did you get an error?
No
and does it even work?
(the rand. image on the image.php file) Yesthen I wm lost as to what you want. can you explain yourself a littel better. you said somethin about a sig image for a forum? so do you want the image to be in a html file tha tis calling a php script? then no you can't have that. but what is the forum?ok my explaination:
I want to get a random image in a forum signature. The forum is phpbb2, and doesn't allow html in sigs. so i have to use url tags.
so i tried to make it like this with a php file.
but i guess this is impossible no it isn't impossible. instead of using a html page just do what you did in the first post.
do this in your sig
[img ]http://www.yoursite.com/image.php[/img ]
then you have the script from above in that file. what is wrong with that?hmmm i did what you said, look at my sig.
the image.php file can be found here (<!-- m --><a class="postlink" href="http://www.exartic.net/~yoda/image.php">http://www.exartic.net/~yoda/image.php</a><!-- m -->)
But it dind't work.
...
i the content of that php file, can not be displayed in the img. ...in your sig you forgot the www. tha tis all I can see that you did wrong. maybe that host won't let you hotlink images.no what i actually dont get is.. here a example:
I make a html page with a lot of text, and somewhere on that page i do: <img src=http://www.htmlforums.com/archive/index.php/"bla.gif">.
Than on a second page i would do <img src=http://www.htmlforums.com/archive/index.php/"test.html">
If i would do that it wouldn't display the picture that is on that page right ?
I know (think) you can't do in a <img tag as a src .html or .php or whatever. It needs to be a valid image extension. you can only do this
<img src=http://www.htmlforums.com/archive/index.php/"image.php">
if the site parses php, that is perfectly valid. it will dispaly the image in that page if the image.php source has
echo"<img src=http://www.htmlforums.com/archive/index.php/"some.jpg">";
it will echo out.
try putting the whole path in the imgae tag. the one in the image.php page.
edit: also add this to the very top of the script
header("content-Type: image/*");
* = what ever extension you are using in yout img tag. jpg, gifwell, i tried, dind't work im totally lost now
here both sources if image.php and image.html
image.php (<!-- m --><a class="postlink" href="http://www.gq-guild.com/image.php">http://www.gq-guild.com/image.php</a><!-- m -->)
<?php
header("content-Type: image/gif");
$array1 = array('images/knight_m.gif','images/logo2.gif');
srand ((float) microtime() * 10000000);
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.gq-guild.com/$image'>";
?>
image.html (<!-- m --><a class="postlink" href="http://www.gq-guild.com/image.html">http://www.gq-guild.com/image.html</a><!-- m -->)
<img src='http://www.gq-guild.com/image.php'>
I really don't know it anymore. Site parses php perfectly (also supports hotlinking, itm's my paid server)
If you could give some sort of revised code, that would be highly apreciatedhmmm I can't get it to work eitehr. funny thing is you can do this with the gd library and create your own image and it works fine, but this way won't, strange. I will look into this more.hehe well thanks anyway, just notice me when you find out something about this topic wait, why cant u just use <?php include("whatever.php"); ?> or doesnt it allow it?you can't
this is what i got:
/////// image.html
<img src='http://www.htmlforums.com/archive/index.php/image.php'>
/////// image.php
<?php
$array1 = array('av.gif','sig.gif');
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.htmlforums.com/archive/index.php/$image'>";
?>
that's what i have know, i guess you know what i want, i want just to get a random image on the image.html page, how would i do that ? thank you )and what is wrong? did you get any errors?
you have to seed the random array
<?php
$array1 = array('av.gif','sig.gif');
srand ((float) microtime() * 10000000);
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.htmlforums.com/archive/index.php/$image'>";
?>no you misunderstood my question, my problem is how to get a random image on the image.html file, without having to work with iframes like ad systems work.hmm, i dont know if you can do that.....me neither, but it's for a forum siggy, so i can't use html stuffix T_TOriginally posted by yoda
no you misunderstood my question, my problem is how to get a random image on the image.html file, without having to work with iframes like ad systems work.
did you get an error? and does it even work? I understand what you want I all I said is you need to seed the rand array. nothing was said about an iframe so what are you talking about? you can get a randome image wihout a iframe and what is this html suffix?did you get an error?
No
and does it even work?
(the rand. image on the image.php file) Yesthen I wm lost as to what you want. can you explain yourself a littel better. you said somethin about a sig image for a forum? so do you want the image to be in a html file tha tis calling a php script? then no you can't have that. but what is the forum?ok my explaination:
I want to get a random image in a forum signature. The forum is phpbb2, and doesn't allow html in sigs. so i have to use url tags.
so i tried to make it like this with a php file.
but i guess this is impossible no it isn't impossible. instead of using a html page just do what you did in the first post.
do this in your sig
[img ]http://www.yoursite.com/image.php[/img ]
then you have the script from above in that file. what is wrong with that?hmmm i did what you said, look at my sig.
the image.php file can be found here (<!-- m --><a class="postlink" href="http://www.exartic.net/~yoda/image.php">http://www.exartic.net/~yoda/image.php</a><!-- m -->)
But it dind't work.
...
i the content of that php file, can not be displayed in the img. ...in your sig you forgot the www. tha tis all I can see that you did wrong. maybe that host won't let you hotlink images.no what i actually dont get is.. here a example:
I make a html page with a lot of text, and somewhere on that page i do: <img src=http://www.htmlforums.com/archive/index.php/"bla.gif">.
Than on a second page i would do <img src=http://www.htmlforums.com/archive/index.php/"test.html">
If i would do that it wouldn't display the picture that is on that page right ?
I know (think) you can't do in a <img tag as a src .html or .php or whatever. It needs to be a valid image extension. you can only do this
<img src=http://www.htmlforums.com/archive/index.php/"image.php">
if the site parses php, that is perfectly valid. it will dispaly the image in that page if the image.php source has
echo"<img src=http://www.htmlforums.com/archive/index.php/"some.jpg">";
it will echo out.
try putting the whole path in the imgae tag. the one in the image.php page.
edit: also add this to the very top of the script
header("content-Type: image/*");
* = what ever extension you are using in yout img tag. jpg, gifwell, i tried, dind't work im totally lost now
here both sources if image.php and image.html
image.php (<!-- m --><a class="postlink" href="http://www.gq-guild.com/image.php">http://www.gq-guild.com/image.php</a><!-- m -->)
<?php
header("content-Type: image/gif");
$array1 = array('images/knight_m.gif','images/logo2.gif');
srand ((float) microtime() * 10000000);
$rand_keys1 = array_rand ($array1, 2);
$image = $array1[$rand_keys1[0]];
echo "<img src='http://www.gq-guild.com/$image'>";
?>
image.html (<!-- m --><a class="postlink" href="http://www.gq-guild.com/image.html">http://www.gq-guild.com/image.html</a><!-- m -->)
<img src='http://www.gq-guild.com/image.php'>
I really don't know it anymore. Site parses php perfectly (also supports hotlinking, itm's my paid server)
If you could give some sort of revised code, that would be highly apreciatedhmmm I can't get it to work eitehr. funny thing is you can do this with the gd library and create your own image and it works fine, but this way won't, strange. I will look into this more.hehe well thanks anyway, just notice me when you find out something about this topic wait, why cant u just use <?php include("whatever.php"); ?> or doesnt it allow it?you can't