Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/89995-define-_get/
Share on other sites

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'];

Link to comment
https://forums.phpfreaks.com/topic/89995-define-_get/#findComment-461427
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.