Jump to content

DEFINE $_GET


amwd07

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.