amwd07 Posted February 8, 2008 Share Posted February 8, 2008 Hello this is very fraustrating issue Not sure if this is even possible I have this upload script, and just need to change the upload directory define('UPLOAD_PATH', '/usr/home/website/id/'); I have tried to include $_GET['webid']; after the trailing slash and throws an error also tried the following $webid = $_GET['web_id']; define('UPLOAD_PATH', '/usr/home/website/id/$webid'); I need to use the define methos is there any way to include $_GET? Quote Link to comment https://forums.phpfreaks.com/topic/89995-define-_get/ Share on other sites More sharing options...
pocobueno1388 Posted February 8, 2008 Share Posted February 8, 2008 You need to use double quotes, like this: <?php $webid = $_GET['web_id']; define('UPLOAD_PATH', "/usr/home/website/id/$webid"); Quote Link to comment https://forums.phpfreaks.com/topic/89995-define-_get/#findComment-461426 Share on other sites More sharing options...
haku Posted February 8, 2008 Share Posted February 8, 2008 As far as I can tell, that goes against all logic in defining a constant. Constant: not changing. Using a $_GET variable is dynamic. Dynamic: changing. I just don't see it being doable in the way you want. What I would suggest is using this: define('UPLOAD_PATH', '/usr/home/website/id/'); Then on the page you need to use it on you use: URL = UPLOAD_PATH. $_GET['web_id']; Quote Link to comment https://forums.phpfreaks.com/topic/89995-define-_get/#findComment-461427 Share on other sites More sharing options...
amwd07 Posted February 8, 2008 Author Share Posted February 8, 2008 I have used the double quotes works perfect thanks Quote Link to comment https://forums.phpfreaks.com/topic/89995-define-_get/#findComment-461431 Share on other sites More sharing options...
pocobueno1388 Posted February 8, 2008 Share Posted February 8, 2008 Please don't forget to mark the topic as solved. Quote Link to comment https://forums.phpfreaks.com/topic/89995-define-_get/#findComment-461445 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.