Page 2 of 2

Re: help with javascript

Posted: Mon Oct 25, 2010 6:39 pm
by netmaestro
Thanks, I'll have a play with that. All of PHP is new to me so it's all good learning fodder, ugly or not. :mrgreen:

Re: help with javascript

Posted: Tue Oct 26, 2010 1:37 pm
by srod
netmaestro wrote:Thanks, I'll have a play with that. All of PHP is new to me so it's all good learning fodder, ugly or not. :mrgreen:
It shouldn't matter that you're not as good looking as I Netty, php is for all. :)

Mind you, I do look like a mule!

Re: help with javascript

Posted: Tue Oct 26, 2010 4:19 pm
by Nituvious
Image
:mrgreen:

Re: help with javascript

Posted: Tue Oct 26, 2010 8:12 pm
by srod
:lol:

Re: help with javascript

Posted: Wed Oct 27, 2010 4:13 am
by Mistrel
Nituvious wrote:You can use ereg_replace to remove any possibility for directory transversal.
Actually, it's best practice to never use "include" with an instance where the path is obtained from user-editable input. For example: '$_GET["page"]'.

Even though you may think that you've parsed it safely, there may be ways around that.

Re: help with javascript

Posted: Wed Oct 27, 2010 11:38 am
by Nituvious
Mistrel wrote:
Nituvious wrote:You can use ereg_replace to remove any possibility for directory transversal.
Actually, it's best practice to never use "include" with an instance where the path is obtained from user-editable input. For example: '$_GET["page"]'.

Even though you may think that you've parsed it safely, there may be ways around that.
True, I don't like using Include because of the possible exploits. I have allow_url_include turned off, so it "may" be a little safer for my tiny website. I used fopen before, but it became more troublesome but keep in mind I have only used php for about 6 months so, I'm still new to it!

Re: help with javascript

Posted: Thu Oct 28, 2010 12:06 am
by Mistrel
It doesn't really matter if you turn off allow_url_include. The point is that they can "include" private areas of your website such as config files, .htaccess, etc. The most dangerous part is potentially including a PHP file in such a way that the actual page contents gets displayed. Hence, just "don't do it".