Bravo List
Go Back   > Bravo List > P2P > Forum > Community Cafe
Old 22-10-16, 15:16
fireknight's Avatar
fireknight fireknight is offline
Join Date: Aug 2010
Posts: 136
Default 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

header("Location: $site_url/usercp.php?edited=1&action=$action".$urladd);
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.

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.

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.
Reply With Quote
Old 22-10-16, 16:10
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
Join Date: Jan 2008
United States
Posts: 1,998
more then likely your getting something like
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
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Managerô forum
My Current Demo is here
Reply With Quote
Old 22-10-16, 21:05
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
Join Date: May 2008
United Kingdom
Posts: 244
Just as Joe said, its only used for mail, is actually defined on takeeditcp

$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.

Last edited by Bigjoos; 23-10-16 at 12:44.
Reply With Quote

call , global

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 12:20. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.