DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 24, 2018, 02:04:42 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: "Outputting" variable problem  (Read 4263 times)
0 Members and 1 Guest are viewing this topic.
Voratus
Guest
« on: July 01, 2004, 09:56:50 AM »

This is weird.
I'm trying to make my weapon.php work for various locations, using a "return" argument to know which city the player is entering from, and based upon that displays different text.
I set the into text to a variable called $text. I set the header information to a variable called $header.
page_header("$header"); works
output("$text"); works
output("`c`b`&$header`0`b`c"); does not work
output("`c`b`&".$header."`0`b`c"); does not work
output("`c`b`&{$header}`0`b`c"); does not work

Note: These are all attempts I have tried to get the centered text (which normally displays "MightyE's Weapon Emporium") to use a variable. Text works fine, but I cannot get a variable to work in that line, and all that's calling it is the output function.
I was able to create a separate variable which has the formatting included in it, and that works fine.
Can anyone tell me if I was using the syntax wrong? If not, it looks like color formatting with only a variable for text will not work.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5479



View Profile WWW
« Reply #1 on: July 01, 2004, 11:20:32 AM »

How is it 'not' working?

When I add two lines to a file:
Code:
$header="This is the blitz line";
output("`c`b`&$header`0`b`c");

It displays as expected.  But if I change 'blitz' to 'header', the page is messed up.  If you're experiencing the messed up page, use a different variable name.
Logged

Play the latest beta version here on DragonPrime
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #2 on: July 01, 2004, 03:12:55 PM »

How is it 'not' working?

When I add two lines to a file:
Code:
$header="This is the blitz line";
output("`c`b`&$header`0`b`c");

It displays as expected.  But if I change 'blitz' to 'header', the page is messed up.  If you're experiencing the messed up page, use a different variable name.

I get all messed up even with only the association line
Code:
$header="This is the blitz line";
It seems a problem related with header PHP command.
It's enough to change $header to $headers that everything works fine.

Maybe someone else more skilled then me (easy to find Wink) will explain this.

Rgds Excalibur
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5479



View Profile WWW
« Reply #3 on: July 01, 2004, 03:26:54 PM »

The $header variable contains all the html code for...the header.

Insert the line: output("This is the header:  $header"); in a basic file, and you'll see why things go wrong...
Logged

Play the latest beta version here on DragonPrime
Voratus
Guest
« Reply #4 on: July 01, 2004, 07:00:32 PM »

I just renamed my variable to $head, and had no problems afterward. Wink
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
38 Guests, 1 User
pharis
Home Forums News Downloads Login Register Advanced Search