Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-22-2007, 02:24 PM Disable scripts
delighted's Avatar
Super Talker

Posts: 147
Trades: 0
Anyone know if it's possible to disable scripts in certain directories - so if a .php, .cgi or something else is requested it won't be treated like a script, but like any other file..?

Thanks
__________________

Please login or register to view this content. Registration is FREE
- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-22-2007, 03:27 PM Re: Disable scripts
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Well what you would have to do is put the files onto another server and then turn off PHP support.

Otherwise, you could just save all of the scripts as TXT files...
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-22-2007, 03:33 PM Re: Disable scripts
delighted's Avatar
Super Talker

Posts: 147
Trades: 0
Quote:
Originally Posted by coolkbk585 View Post
Well what you would have to do is put the files onto another server and then turn off PHP support.
That is not an option...

Quote:
Otherwise, you could just save all of the scripts as TXT files...
That too is not an option This is a folder where users can upload files.. Of course, .php files and similar is filtered out - this will be only for extra security.
__________________

Please login or register to view this content. Registration is FREE
- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
Old 08-22-2007, 03:57 PM Re: Disable scripts
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Before you let them upload it you can also run it through a script that str_replaces all of the <?php tags...making all of the code harmless.

But all of the code would show up as text.
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 08-22-2007, 04:21 PM Re: Disable scripts
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
What do you mean by "disable scripts" ?

Redirecting to another page, displaying a specific message, generating a blank page, resulting in a "403 access denied", or not being parsed (meaning displaying the php source in the browser) ?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-22-2007, 04:23 PM Re: Disable scripts
delighted's Avatar
Super Talker

Posts: 147
Trades: 0
Quote:
Originally Posted by tripy View Post
What do you mean by "disable scripts" ?

Redirecting to another page, displaying a specific message, generating a blank page, resulting in a "403 access denied", or not being parsed (meaning displaying the php source in the browser) ?
The last, not being parsed.
__________________

Please login or register to view this content. Registration is FREE
- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
Old 08-22-2007, 06:06 PM Re: Disable scripts
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
As far as I know, this must be handled in PHP.
If you disable the handler on PHP script in apache, it will be served as html, with the php code in text into the document.

You must save in some place which directory you want to disable, and have every php pages on your site to check this list to see if they are allowed to be parsed.
If not, simply do an exit(); otherwise do the parsing as previously.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Disable scripts
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25701 seconds with 12 queries