Elke refresh een willekeurige afbeelding

Gestart doorErwinn16 reacties49 weergaven

17 berichten · pagina 1 van 2

Erwinn

Lid · Topicstarter

Berichten
1.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste,

Ik ben opzoek naar een script dat na refeshen een willekeurige afbeelding toont. Heeft iemand dit script?
0
Berichten
1.811
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit kan volgens mij gewoon met ongeveer het wistje datje script staat ergens bij tutorialswink
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]afbeeldingnaam.png[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]afbeelding2.png[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src=images/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>


Dus zo kan je meerdere afbeeldingen toevoegen, door simpel nog een $Img toe te voegen!
Niet getest, maar zou moeten werken
0
Erwinn

Lid · Topicstarter

Berichten
1.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eleky schreef:
[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]afbeeldingnaam.png[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]afbeelding2.png[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src=images/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>
Dus zo kan je meerdere afbeeldingen toevoegen, door simpel nog een $Img toe te voegen!
Niet getest, maar zou moeten werken

Dankje heart
Edit: Werkt niet. Dit is mijn code:
<html>
<center>
<br>
<br>

[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]1.jpg[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]2.jpg[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>

</html>


De afbeeldingen worde gehost in public_html, geen apart mapje. Iemand ideeen?
0
Berichten
7.179
Reputatie
1
Punten
3,01
Lid sinds
Laatst gezien
Wat een bizar scriPt zeg emo je opent een php script in een html, en je sluit sommige tags niet af?
0
Berichten
4.013
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb het niet opgelost. Maar wel even de php er rond wat beter gemaakt.

<html>
<br /><br />
<div align="center">

[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]1.jpg[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]2.jpg[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>

</div>
</html>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
html>
<br /><br />
<div align="center">

[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]1.jpg[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]2.jpg[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>

</div>
</html>
0
Berichten
435
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is niet echt super moeilijk:

[COLOR= #0000BB]<?php
$afbeeldingen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]http://roodenpaars.nl/images/banner0.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner1.png[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/array_rand"]array_rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700])].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
6.722
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Of dit:

<html>
<br /><br />
<div align="center">

[COLOR= #0000BB]<?php
$Img[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]1.jpg[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]2.jpg[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>

</div>
</html>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stanieboy schreef:
Is niet echt super moeilijk:

[COLOR= #0000BB]<?php
$afbeeldingen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]http://roodenpaars.nl/images/banner0.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner1.png[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/array_rand"]array_rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700])].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR]
?>
[COLOR= #0000BB]<?php
$afbeeldingen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]http://roodenpaars.nl/images/banner0.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner.png[/COLOR][COLOR= #007700],[/COLOR]
                      [COLOR= #DD0000]http://roodenpaars.nl/images/banner1.png[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$afbeelding[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array_rand"]array_rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$afbeeldingen[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" />[/COLOR][COLOR= #007700];[/COLOR]
?>


Dit was netter.
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je gebruikt $afbeelding niet Shahiem yummie
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kyron schreef:
je gebruikt $afbeelding niet Shahiem yummie
Haha, niet eens opgemerkt. emo
0
Berichten
787
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
//EDIT: Laatmaar, ik zag aan de kleuren dat mijn oplossing niet klopte..
0
Erwinn

Lid · Topicstarter

Berichten
1.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Slotje, niet meer nodig.
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<html>
<head>
<title>Pagina titel</title>
</head>
<body>
<div align="center" margin-top="10px">

[COLOR= #0000BB]<?php
$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]1.jpg[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]2.jpg[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/shuffle"]shuffle[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$Img[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" />"[/COLOR][COLOR= #007700];[/COLOR]
?>
</div>
</body>
</html>
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren