[php] 2 vraagjes

Gestart doorFreestyle7 reacties43 weergaven

8 berichten · pagina 1 van 1

Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik heb 2 vraagjes over 1 script

1. hoe het heet volgende script:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"p"[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"index.php"[/COLOR][COLOR= #007700]) {[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Dit is geen geldige verwijzing naar deze pagina!"[/COLOR][COLOR= #007700];
                    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"p"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]".php"[/COLOR][COLOR= #007700])) {[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De pagina kon niet worden gevonden!"[/COLOR][COLOR= #007700];
                        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                            [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"p"[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]".php"[/COLOR][COLOR= #007700]);
                            }
                            }[/COLOR]

?>


2. heb je zon script ook maar dan staan die andere bestanden in een andere map.

alvast bedankt
0
Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
oke.
maar kan ik ook bijvoorbeeld.
contact.php in de map pages zetten?

en nog iets. als ik deze code gebruik dan kan ik index.php zelf niet gebruikenconfusedhoe doe ik dat?

Ik zoek dit script op w3schools maar kan het niet echt vinden.
weten jullie waar ik dit kan vinden. of hoe ik dit kan vinden alvast bedankt?

ik weet het dubbel post. maar liever dubbelpost dan een 2de topicwink
0
Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zoek dit script op w3schools maar kan het niet echt vinden.
weten jullie waar ik dit kan vinden. of hoe ik dit kan vinden alvast bedankt?

ik weet het dubbel post. maar liever dubbelpost dan een 2de topicwink
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Laat het maken? Je gaat nooit een gratis script vinden met de eisen hoor.
Voor 0.1 geeft iemand je vast wat je zoekt + wat uitleg.
0
Freestyle

Lid · Topicstarter

Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik wil het zelf maken daarom zoek ik een link.
en bij deze geef ik 0,1pt als je me de goede link geeft met wat ik zoek
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat jij had is een Paginasysteem smile
0
Berichten
515
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit is een goed veilig paginascript

bestanden moeten in mapje p

[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]/**
* Arrays om errors en content tijdelijk in op te slaan
*/[/COLOR]
[COLOR= #0000BB]$aErrors[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$aContent[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]

[COLOR= #FF8000]/**
* Array met alle paginas die ge?nclude mogen worden,
* de keys stellen de namen van paginas voor en de waarden geven met een boolean
* aan of de pagina statisch (false) dan wel dynamisch (true)
*/[/COLOR]
[COLOR= #0000BB]$aPages[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL] [COLOR= #007700]([/COLOR]
    [COLOR= #DD0000]voorbeeld[/COLOR] [COLOR= #007700]=>[/COLOR] true[COLOR= #007700],
);[/COLOR]

[COLOR= #FF8000]/**
* Directory waarin de paginas zich bevinden
* Extensie die de te includen paginas hebben
*/[/COLOR]
[COLOR= #0000BB]$sDir[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]p/[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #FF8000]/**
* Is er een pagina opgegeven?
*/[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #0000BB]$sPad[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$sDir[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000].php[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #FF8000]/**
    * Is dit een toegestane pagina?
    */[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$aPages[/COLOR][COLOR= #007700]))
    {[/COLOR]
        [COLOR= #FF8000]/**
        * Bestaat de opgevraagde pagina?
        */[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sPad[/COLOR][COLOR= #007700]))
        {[/COLOR]
            [COLOR= #FF8000]/**
            * Is de pagina dynamisch of statisch?
            */[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aPages[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]]] ===[/COLOR] true[COLOR= #007700])
            {[/COLOR]
                [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sPad[/COLOR][COLOR= #007700]);
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$aContent[/COLOR][COLOR= #007700][] =[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sPad[/COLOR][COLOR= #007700]);
            }
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [COLOR= #0000BB]$aErrors[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Sorry, This page does not exist.[/COLOR][COLOR= #007700];
        }    
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$aErrors[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Sorry, This page is not accesible.[/COLOR][COLOR= #007700];
    }
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]p/welkom.php[/COLOR][COLOR= #007700]);
}[/COLOR]

[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$aErrors[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$fout[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"$fout"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
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