![]() |
| Adobe Forums » Adobe Influences » Dynamic Html » Re: How to work with php require_once? |
| Tags: |
![]() |
| LinkBack | Thread Tools | Display Modes |
|
|||
|
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()? |
|
|||
|
.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 |
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|