notsleepy
10-15-2006, 07:17 PM
hi, newbie so be gentle!
searching through the post here, i think this seems the nearest to what i'm after! anyone reading it for the first time will see it's connection!! and rather than starting a new thread i thought it might nest comfortably together, forgive me if this is not the done thing. - at least it's not off topic!!
i have an html form, when it is returned to and/or refreshed i want a new picture to load
__________________
how do i swap this
<html>
<p><img border="0" src= "../folder1/folder2/Picture75.JPG" width="30" height="40"></p>
</html>
for something like this
<?php
{
$randpicture = rand(10,99)
$newpicture = "../folder1/folder2/Picture".$randpicture.".JPG"
}
?>
<html>
<p><img border="0" src= $newpicture width="30" height="40"></p>
</html>
i've tried saving the page as .php then inserting <?php and ?> either side of the string $newpicture, tried blocking the html bits to with ...><?php $newpicture ?><... and various other logical and perhaps not so logical arrangements but it still doesn't bring up a picture!! even tried various arrangements of brackets and/or quotes/apostrophes all to no avail :mad:
i'm asuming the rand(10,99) is correct, ramdom number between 10 and 99 ??
the red bits are the bits i'm trying to swap, ie static string for random string.
i've asked over on the html board (not in this much type) but as there have been no responses at all at all i thought i'd give it a go here too!
__________________
i would like it to initially happen without a mouseclick on a button. then perhaps mouseover the page to refresh when returning with the 'back button'
it's driving me nuts!! as a VB6 person i know it should be possible, but then code is code and unless it's correct......!
searching through the post here, i think this seems the nearest to what i'm after! anyone reading it for the first time will see it's connection!! and rather than starting a new thread i thought it might nest comfortably together, forgive me if this is not the done thing. - at least it's not off topic!!
i have an html form, when it is returned to and/or refreshed i want a new picture to load
__________________
how do i swap this
<html>
<p><img border="0" src= "../folder1/folder2/Picture75.JPG" width="30" height="40"></p>
</html>
for something like this
<?php
{
$randpicture = rand(10,99)
$newpicture = "../folder1/folder2/Picture".$randpicture.".JPG"
}
?>
<html>
<p><img border="0" src= $newpicture width="30" height="40"></p>
</html>
i've tried saving the page as .php then inserting <?php and ?> either side of the string $newpicture, tried blocking the html bits to with ...><?php $newpicture ?><... and various other logical and perhaps not so logical arrangements but it still doesn't bring up a picture!! even tried various arrangements of brackets and/or quotes/apostrophes all to no avail :mad:
i'm asuming the rand(10,99) is correct, ramdom number between 10 and 99 ??
the red bits are the bits i'm trying to swap, ie static string for random string.
i've asked over on the html board (not in this much type) but as there have been no responses at all at all i thought i'd give it a go here too!
__________________
i would like it to initially happen without a mouseclick on a button. then perhaps mouseover the page to refresh when returning with the 'back button'
it's driving me nuts!! as a VB6 person i know it should be possible, but then code is code and unless it's correct......!