Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Community Cafe (http://www.bvlist.com/forumdisplay.php?f=18)
-   -   Global Call (http://www.bvlist.com/showthread.php?t=10998)

fireknight 22nd October 2016 15:16

Global Call
 
I was just playing around with FreeTSP code.

Both takeeditaltusercp.php & takeeditusercp.php
At the bottom of the file have the return header

Code:

header("Location: $site_url/usercp.php?edited=1&action=$action".$urladd);
Code:

header("Location: $site_url/altusercp.php?edited=1&action=$action".$urladd);
This returns you back to your profile and lets you know the update was successful.
Which is exactly what it does.
But it should not work.
Because no global for $site_url has been defined.

Example
Code:

global $site_url;
So how does it understand what $site_url means.

Now both files call function_main.php.
And that file calls function_config.php.
Which contains the definition of $site_url.

If that is the reason it works.
That then raises the question.

Do we really need to use the global define at all in any file ??

I have just removed all the global defines from the index.php.
Some things work fine without the global call, yet others give errors ??

I have checked U232 V4 takeeditcp.php
And the same thing.
No main or any global call.
But the same line at the bottom of the file.

Code:

header("Location: {$INSTALLER09['baseurl']}/usercp.php?edited=1&action=$action" . $urladd);
This is not a major issue or anything like that.
It is just me wondering WHY?

Can any one shed any light on this for me.

joeroberts 22nd October 2016 16:10

more then likely your getting something like
Code:

Location: /usercp.php?edited=1
and in most cases this works fine.
if you look at most themes you well see they dont put site url in them for images and they work fine

Bigjoos 22nd October 2016 21:05

Just as Joe said, its only used for mail, is actually defined on takeeditcp

Code:

$urladd.= "&mailsent=1";
Global defines are normally all on config which is included on bittorrent.php making that define usable on any script that includes bittorrent.php, or you define the global on the file only if its only used on that one file.


All times are GMT +2. The time now is 02:01.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.