Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
im having some trouble getting the content of variables like $Forum12Moderator and $Forum15Moderator... id like to be able to build the variable name using a counter variable. can i do this?

tks in advance

------------------

it's a matter of time and knowledge

Sponsored Links
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
You can but you don't want to. Soft references are a bad thing.

Read why here

But if you must anyway:

$counter = 7;
${Forum . $counter . Moderator} = 'Mark';
# or ${"Forum$counterModerator"} = 'Mark';
print $Forum7Moderator;

I don't recommend you do it though. Build a hash instead.

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
ok, tks mark. i gotta say that i dont know how to build a hash, but this will help me.

------------------

it's a matter of time and knowledge

Joined: Aug 2000
Posts: 3,590
Likes: 1
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Likes: 1
Bad Baby [Linked Image]

------------------


:: Who is Andy?

Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
I am wondering, mark, why you told him how to do that instead of showing him how to do a hash? because, frankly, hehe, soft references aren't good. [Linked Image]
Anyways..If i had time, i'd show ya.

------------------

Modification Developer of the Ultimate Bulletin Board
Due to time limitation, I do not offer support Via. E-mail, ICQ , AIM, Private message or any media.
Regards,
MasterMind

Sponsored Links
Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
err.. just a question..

${Forum . $counter . Moderator} = 'Mark'; or ${'Forum' . $counter . 'Moderator'} = 'Mark';?

------------------

it's a matter of time and knowledge

Joined: Jan 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 6
Quote
quote:
Use variables like $ForumModerator[12]
and $ForumModerator[15] instead of
$Forum12Moderator and $Forum15Moderator.


In addition to being much safer,
more reliable, and mor efficient than your method, this technique is also
more powerful because
you can easily get a list off all the
forum moderators by simply writing
@ForumModerator, which is
impossible with your method.

This message has been edited by Dominus on January 23, 2001 at 12:50 AM

Joined: Dec 2000
Posts: 595
Member
Member
Offline
Joined: Dec 2000
Posts: 595
im opening ubb cgi's mods.file..

------------------

it's a matter of time and knowledge


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2658
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 24
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)