PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 29th, 2004, 10:05 AM
nanzhong nanzhong is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 nanzhong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to nanzhong Send a message via AIM to nanzhong Send a message via MSN to nanzhong Send a message via Yahoo to nanzhong
Security problems?

I'm new to php and have just started learning it yesterday. I want to use a switch to change files so that all of the pages can be integrated to one file that includes others. I just wanted to know if there are any possible security problems with this code:

Code:
<?php
function test1()
{
include ('test1.txt');
}
function test2(){
include ('test2.txt');
}
function test3(){
include ('test3.txt');
}
switch( $_GET['article'] ) {
	case "test2":
		test2();
		break;
	case "test3":
		test3();
		break;
	default:
		test1();
 break;
}
?>


Thanks

Reply With Quote
  #2  
Old June 29th, 2004, 10:24 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Ok theres nothing wrong with this as such but theres a couple of issues I can think of.

1) Where you include the files you aren't testing to see if they actually exist so if an error occurs somewhere you won't know about it.

2) Since you are using a query string argument to determine which file you want to be displayed someone can edit the query string to get at any of the pages. This is fine if you don't wish to restrict access to any of them but if you do then this could present a problem.

Hope this helps,

-KM-

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Security problems?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT