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?
what, if we use POST instead of GET , do we still need such type validation....
Thanks In Advance
shoibmd 1 week ago
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
lgadwords 2 months ago
Hi Alex, I was wondering, couldn't you have done it this way:
if (file_exists("pages/$page[0].php")) {
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 :)
SpeedPainting 6 months ago
Comment removed
SpeedPainting 6 months ago
betterphp!
KayferProductions 6 months ago
have my ears gone bad, or thats not Alex ?
great tut though :)
Alex Quality
saadlulu 6 months ago
thanks bro, this are really good tutorials...
mastermax7777 6 months ago
if($_GET['page']=='login'){
include('_page/login.php');
} else {
include('_page/home.php'); }
This will work to and it's safe to :D
yakuzashi 6 months ago 5
@yakuzashi Not very dynamic though.
wideload123 6 months ago
PHP ACADEMY FTW!!!!! Great tutorial. What PHP editor are you using, and can you get it for Windows? :)
SkidMarkHavoc 6 months ago
@SkidMarkHavoc
Its called gedit, there is a windows version but it looks like crap on windows
arshak0023 6 months ago
Comment removed
m0gria 6 months ago
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
killerbng 6 months ago
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?
killerbng 6 months ago
Really, thanks, i love Phpacademy, thanks for all.
cFrAnCoEc 6 months ago
I still see the school of rock folder... haha
pallport 6 months ago
@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 6 months ago
@wideload123 Oh I know I just think it should be your trademark lolol
pallport 6 months ago
@pallport Perhaps a better film ;)
wideload123 6 months ago
thanx pal
lamartir88 6 months ago
Thanks
jomirife 6 months ago
Ubuntu-awesomess !
spyridonas23 6 months ago
No shit you don't include things from a remote source, much less user defined.
killerpacdot 6 months ago
@killerpacdot some ppl r too stupid to know that though LOL
killerbng 6 months ago
If I "Like" this does it make me big headed ?
wideload123 6 months ago
AWESOMES!!
mangopearandapples 6 months ago
First view and first comment :).
TheEpicNewb 6 months ago