Added: 6 months ago
From: phpacademy
Views: 5,769
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (27)

Sign In or Sign Up now to post a comment!
  • what, if we use POST instead of GET , do we still need such type validation....

    Thanks In Advance

  • What's the best (safest) way to use includes for a file outside the root folder? I need to access a file that's in another folder. Thanks

  • Hi Alex, I was wondering, couldn't you have done it this way:

    if (file_exists("pages/$page[0].p­hp")) {

    include("pages/$page[0].php");

    } else {

    include("pages/home.php"); }

    I'm just thinking that this would be a bit quicker, and easier on your server than creating an array and then searching the array? :)

    Anyway, THANKS for a great tut :)

  • Comment removed

  • betterphp!

  • have my ears gone bad, or thats not Alex ?

    great tut though :)

    Alex Quality

  • thanks bro, this are really good tutorials...

  • if($_GET['page']=='login'){

    include('_page/login.php');

    } else {

    include('_page/home.php'); }

    This will work to and it's safe to :D

  • @yakuzashi Not very dynamic though.

  • PHP ACADEMY FTW!!!!! Great tutorial. What PHP editor are you using, and can you get it for Windows? :)

  • @SkidMarkHavoc

    Its called gedit, there is a windows version but it looks like crap on windows

  • Comment removed

  • wouldnt just doing the include as a var and php at the end...cant do an example here utube wont let me :P but anyways thats what I do even with a file check I just would have say ?page=login and the inlclude string has the php extension...I mean what r u going to load besides php anyways so lets force .php :P

  • I havnt watched the whole vid yet but im 5 30 in...what I do is always do like ?page=login and then in the php file its an include for ' . $page . '.php ...This would stop the whole thing ur talking about ah cause got ur example....

    include "pages/../../../../../../../..­/etc/passwd.php would ERROR out correct?

  • Really, thanks, i love Phpacademy, thanks for all.

  • I still see the school of rock folder... haha

  • @pallport It's the DVD that has been in the drive for about 2 months now, It will also appear in every other video I make :)

  • @wideload123 Oh I know I just think it should be your trademark lolol

  • @pallport Perhaps a better film ;)

  • thanx pal

  • Thanks

  • Ubuntu-awesomess !

  • No shit you don't include things from a remote source, much less user defined.

  • @killerpacdot some ppl r too stupid to know that though LOL

  • If I "Like" this does it make me big headed ?

  • AWESOMES!! 

  • First view and first comment :).

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more