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 September 2nd, 2003, 11:10 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
php include

im having some trouble with a php include script. I have a page which redirects and i want it to open in the main section, however i get errors and i cannot get the other page to display...sort of like opening from a menu then having a link and when u click on the link to have it open in that place instead of in a new browser...

php include script

PHP Code:
<? 
                
if(isset($_GET['id']) && $_GET['id'] != ""){
                    
$id$_GET['id'];
                }else{
                    
$id"";
                }
                
                if(
$id==""){
                    include(
'news.php');
                }else{
                    
$include$_GET['id'];
                    include(
"$include.php");
                }
?>        
 
used for url 

./index.php?id=main


any suggestions on how i can make any link open in the main part i want?

thx

Reply With Quote
  #2  
Old September 3rd, 2003, 12:43 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
What is the error message?
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old September 3rd, 2003, 10:09 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
the error is something similar to this ...the file i want included is from a different directory.... i just wanted to basically login and then go to the page i specify

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/bruski.trixgaming.com/httpdocs/index.php on line 81

Warning: Failed opening 'Registration.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/bruski.trixgaming.com/httpdocs/index.php on line 81

Reply With Quote
  #4  
Old September 3rd, 2003, 01:33 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Are your included files in the same directory as the script?

What you can do is in your php.ini
comment out: open_basedir or if your scripts will always be in the same directory as the includes set it to .

Reply With Quote
  #5  
Old September 3rd, 2003, 03:37 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
the script is in another directory...anyway to get around this...or a better way to do the include, basically the problem comes from the login... i press login and i want the member page to open in the main section...

Reply With Quote
  #6  
Old September 4th, 2003, 12:28 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
1. In your php.ini comment out: open_basedir
2. In your php.ini add the path to the include files to your include_path

Reply With Quote
  #7  
Old September 4th, 2003, 10:33 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i have no control over the php.ini option anyway to bypass it

Reply With Quote
  #8  
Old September 4th, 2003, 11:15 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Set the options in your php.ini using the php_value settings.
For reference: http://us3.php.net/configuration.changes

Reply With Quote
  #9  
Old September 4th, 2003, 11:30 AM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
thx ill give it a try

Reply With Quote
  #10  
Old September 4th, 2003, 04:43 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
so something like this?

php_value include_path ".:/home/httpd/vhosts/bruski.trixgaming.com/httpdocs/"

Reply With Quote
  #11  
Old September 4th, 2003, 04:55 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
how about this


PHP Code:
"ini_set('open_basedir','.')" 

or

PHP Code:
"ini_set('open_basedir','null')" 

Reply With Quote
  #12  
Old September 4th, 2003, 09:37 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
You had it pretty much correct the first time.
I am not sure, but I don't think you can set open_basedir at runtime using ini_set.

You will have to use php_value

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php include


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