The reason it doesn't work may go beyond PHP. You are trying to make an HREF
point to an exact location on your hard drive. When the user of your web
page clicks the link, they do not have that location on their system so it
will fail. Always use relative locations for links. Then once you get that
ironed out, skip the defines, just use the variables. Change the code to be:
$doc_dir = "/store/";
$image_dir = "/images/";
$control_dir = "/control/";

"<?php echo $control_dir ?>"verify_login.php"
<a href="<?php echo $doc_dir ?>">click here</a>
and don't forget the 'php' after the <?
Jim Hunter
-------Original Message-------
Date: Wednesday, March 12, 2003 10:51:04 AM
Subject: [PHP-DB] Define()
I am developing an app which needs 3 constants. The value of these
constants comes from a database result.

This works fine. My problem is that they do not work very well. I am
developing on both windows/Linux (depending what I boot into).

This is the effect I want

$doc_dir = the string of d:/is/clients/client/web/store/
$image_dir = the string of d:/is/clients/client/web/images/
$control_dir = the string of d:/is/clients/client/web/control/ 


The outcome is that 

1. I cannot submit pages using action="<? echo CONTROL_DOC_ROOT
2. I cannot use links as <a href="<? echo $DOC_HOME_ROOT ?>">click

Has anyone had a lot of use with define and in my scenario. I don't the
problem is with the db results, I think it's more of the define().

Like I said above, I am using this on linux as well as windows.

Every chance I get, I try to incorporate 
Open Source resources into my everyday
work. Maybe instead of of paying Microsoft
for software, the money can added to my

PHP Database Mailing List (
To unsubscribe, visit:


Reply via email to