Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Community Cafe
Reply
  #1  
Old 22-10-16, 15:16
fireknight's Avatar
fireknight fireknight is offline
Senior Member
 
Join Date: Aug 2010
Australia
Posts: 126
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

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.
Reply With Quote
  #2  
Old 22-10-16, 16:10
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 1,989
Default
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
__________________
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 http://demo.btmanager.org/
Reply With Quote
  #3  
Old 22-10-16, 21:05
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
 
Join Date: May 2008
United Kingdom
Posts: 237
Default
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.

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

Tags
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 14:42. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2017, vBulletin Solutions Inc.