hey,
ik ben PHP aan het leren en ben dus aan het oefenen met scriptjes maken.
hier plaats ik al mijn nieuwe scripts (headpost) en ik wil graag dat andere mensne hier geen scripts neerzetten en eventuele verbeteringen via PB sturen.
de © moet blijven staan!
allereerst: random banner script / voorbeeld: www.rogier.one2xs.com/test/banner.php
met dit script kan je simpel banner en url toevoegen naar een plek.
hier een loterij script met hulp van anubisfan. voorbeeld: www.rogier.one2xs.com/test/loterij.php
er volgen meer!
ik ben PHP aan het leren en ben dus aan het oefenen met scriptjes maken.
hier plaats ik al mijn nieuwe scripts (headpost) en ik wil graag dat andere mensne hier geen scripts neerzetten en eventuele verbeteringen via PB sturen.
de © moet blijven staan!
allereerst: random banner script / voorbeeld: www.rogier.one2xs.com/test/banner.php
met dit script kan je simpel banner en url toevoegen naar een plek.
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]//maak de array met banners[/COLOR]
[COLOR= #0000BB]$banner[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]http://rogier.one2xs.com/test/banner1.png[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://rogier.one2xs.com/test/banner2.png[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://rogier.one2xs.com/test/banner3.png[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//maak de array met urls[/COLOR]
[COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]http://www.one2xs.com[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://www.wolm.nl[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://www.gsmbundels.nl[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//vul de variable $i met een random getal van nul tot maximaal het aantal elementen van de banner array[/COLOR]
[COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$banner[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]//geeft een link met daarin de banner weer als HTML op de pagina.[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a href="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" ><img src="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$banner[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" /></a>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #FF8000]//© Rogier fischer 2009 - 2011[/COLOR]
?> hier een loterij script met hulp van anubisfan. voorbeeld: www.rogier.one2xs.com/test/loterij.php
[COLOR= #0000BB]<?php
$deelnemer[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]rogier[COLOR= #007700],[/COLOR] daan[COLOR= #007700],[/COLOR] thijs[COLOR= #007700],[/COLOR] tijmen[COLOR= #007700],[/COLOR] milan[COLOR= #007700],[/COLOR] ruben[COLOR= #007700],[/COLOR] rik[COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// deelnemers in een array[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]de winaar is: <strong>[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$deelnemer[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$deelnemer[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]))] .[/COLOR] [COLOR= #DD0000]</strong>[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// haalt random 1 deelnemer op [/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]de deelnemers waren:[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$deelnemer[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++)
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$deelnemer[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]];
}[/COLOR]
[COLOR= #FF8000]// maakt een lijst met deelnemers [/COLOR]
?> er volgen meer!


