Adobe Forums

Add Me
Adobe Forums » Adobe Influences » Dynamic Html » Re: How to work with php require_once?

Tags:



Reply
LinkBack Thread Tools Display Modes
Re: How to work with php require_once?
  #1 (permalink)  
Old 09-25-2008, 03:18 AM
cscampste
Guest
 
Posts: n/a
Default Re: How to work with php require_once?

I've just tried <?php virtual('/mydb/connections/sqlconnect.php'); ?>

Which works ok on all files but I guess this is almost the same as using an
absolute path. Is there no way to use require_once with relative paths?

Also is there any problem using virtual() instead of require()?



Reply With Quote


  #2 (permalink)  
Old 09-25-2008, 03:18 AM
Michael Fesser
Guest
 
Posts: n/a
Default Re: How to work with php require_once?

.oO(cscampste)

>I've just tried <?php virtual('/mydb/connections/sqlconnect.php'); ?>
>
> Which works ok on all files but I guess this is almost the same as using an
>absolute path. Is there no way to use require_once with relative paths?


Absolute paths based on the document root are the most reliable way, as
described in my other reply.

> Also is there any problem using virtual() instead of require()?


Yes. It's less performant than a direct include and it's specific to
Apache servers. There's hardly a reason to use it.

Micha
Reply With Quote


  #3 (permalink)  
Old 09-25-2008, 03:18 AM
cscampste
Guest
 
Posts: n/a
Default Re: How to work with php require_once?

Thanks a lot for the info guys, this has helped a lot. I'm going with the
$_SERVER['DOCUMENT_ROOT'] option as Michael suggested. Thanks for the tip
regarding the location of the include file as well, guess I still have lots to
learn.

Next on the list of things to understand are sessions/cookies. I need to
create a login page where people will select the database to connect to and
enter the database user name and password. At the moment these details are
statically recorded in the include file.

Reply With Quote


Reply



Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Hairstyles | UFO Videos | Bollywood Wallpapers | Poems  | WWE


All times are GMT. The time now is 11:47 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.