WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 24.10.2002, 15:22   #1
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard php global definitionen geht nicht ?

ganz oben hab ich:

global $bgcolor7

dann:

$bgcolor7 = "#FF9933"; //die farbe definiert

und irgendwo in einer funktion ruf ich dann auf:

echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" bgcolor=\"$bgcolor7\">\n"... usw...

nur er nimmt mit die farbe nicht.

Wenn ich aber statt $bgcolor7 den farbwert #ff9933 einsetze geht es.

WARUM ?
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Alt 24.10.2002, 18:03   #2
Philipp
verXENt
 
Benutzerbild von Philipp
 
Registriert seit: 01.08.1999
Beiträge: 7.084

Mein Computer

Standard

PHP-Code:
global $bgcolor7
musst du nach
PHP-Code:
function name() { 
verwenden und nicht am Anfang des Scripts
Philipp ist offline   Mit Zitat antworten
Alt 25.10.2002, 08:19   #3
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard

klingt zwar unlogisch (und bei allen anderen definitionen gehts auch) aber ich habs probiert - ohne Erfolg.
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Alt 25.10.2002, 10:33   #4
käptn
Inventar
 
Registriert seit: 04.11.2001
Alter: 45
Beiträge: 2.150


Standard

PHP-Code:
$bgcolor '#AAAACC';

function 
echo_td($cellcontent) {
     global 
$bgcolor;
     echo 
'<td bgcolor="'.$bgcolor.'">'.$cellcontent.'</td>';

Geht net - gibt's net

~
____________________________________
LOL - Mein erstes Post im Programmier Forum

MACINTOSH - Most Applications Crash, If Not The Operating System Hangs
käptn ist offline   Mit Zitat antworten
Alt 25.10.2002, 11:18   #5
_m3
Inventar
 
Registriert seit: 24.09.2001
Beiträge: 7.335


Standard

http://at.php.net/manual/de/migration4.variables.php
Zitat:
While handling of global variables had the focus on to be easy in PHP 3 and early versions of PHP 4, the focus has changed to be more secure. While in PHP 3 the following example worked fine, in PHP 4 it has to be unset($GLOBALS["id"]);. This is only one issue of global variable handling. You should always have used $GLOBALS, with newer versions of PHP 4 you are forced to do so in most cases. Read more on this subject in the global references section.
PHP-Code:
<?php
$id 
1;
function 
test()
{
    global 
$id;
    unset(
$id);
}
test();
echo(
$id); // This will print out 1 in PHP 4
?>
____________________________________
Weiterhin zu finden auf http://martin.leyrer.priv.at , http://twitter.com/leyrer , http://www.debattierclub.net/ , http://www.tratschen.at/ und via Instant Messaging auf Jabber: m3 <ät> cargal.org .
_m3 ist offline   Mit Zitat antworten
Alt 28.10.2002, 13:45   #6
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard

ich will sie aber nicht unsetten weil ich die variablen später wieder benötige.
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Alt 28.10.2002, 15:04   #7
Philipp
verXENt
 
Benutzerbild von Philipp
 
Registriert seit: 01.08.1999
Beiträge: 7.084

Mein Computer

Standard

Poste vielleicht einmal das ganze Script
Philipp ist offline   Mit Zitat antworten
Alt 28.10.2002, 15:31   #8
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard

hehe lieber nicht aber ich werd mal a bisl war rauskopieren

PHP-Code:
<?php
$tabbgcolor 
=   "#FFFFFF"
$tabcolor =     "#8F9CAC"
$tabbgcolor2 =  "#AAAAAA";
$tabcolor2 =    "#BBBBBB";
$headercolor =  "#FF9933"
$menuebgcolor "#F4F7E5";
$textcolor1 =   "#FFFFFF";  
$textcolor2 =   "#0066CC"
$textcolor3 =   "#000000";  
$footercolor =  "#FFFFFF"
$titlecolor =   "#FFFFFF";
function 
themeheader() {
global 
$user$banners$sitename$slogan$cookie$prefix$tabbgcolor$headercolor$textcolor1$textcolor3;
    
cookiedecode($user);
$username $cookie[1];
//
//(hier noch ein paar unterfunktionen)
//
echo "<body topmargin=\"0\" leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" bgcolor=\"$tabbgcolor\">\n\n";  //HIER ZB DIE TABBGCOLOR GEHT NICHT

echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"1\" bgcolor=\"$headercolor\">\n"  //HIER ZB DIE HEADERCOLOR GEHT NICHT
."<tr>\n"
."<td align=\"left\" valign=\"bottom\" width=\"65%\"><a href=\"index.php\"><img src=\"themes/TPLUS/images/tplus_bo.jpg\" align=\"left\" alt=\""._WELCOMETO." $sitename\" border=\"0\"></a>[b]<h2>text</h2>[/b]</td>\n"
."<form action=\"modules.php?name=Search\" method=\"post\">\n"
."<td align=\"right\" valign=\"bottom\">\n"
."<font class=\"content\" color=\"$textcolor3\">[b]".translate("Seite durchsuchen")." [/b]\n"
."<input type=\"text\" name=\"query\" size=\"14\"></font></td></form>\n"
."</tr></table>\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\">\n"
."<tr valign=\"middle\" bgcolor=\"#ffffff\">\n"
."<td align=\"left\" valign=\"top\" width=\"8\" height=\"22\" background=\"themes/TPLUS/images/topnav-bg.gif\"></td>\n"
."<td width=\"15%\" background=\"themes/TPLUS/images/topnav-bg.gif\" nowrap><font class=\"content\" color=\"#363636\">\n";
//weiter in der funktion
}
im Quelltext sieht das dann so aus:
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="">

<table cellpadding="0" cellspacing="0" width="100%" border="1" bgcolor="">
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Alt 28.10.2002, 15:59   #9
Philipp
verXENt
 
Benutzerbild von Philipp
 
Registriert seit: 01.08.1999
Beiträge: 7.084

Mein Computer

Standard

Das Script selber funktioniert hier problemlos

Wie wird es eigentlich aufgerufen? Sieht für mich wie ein Skin für PHP-Nuke aus
Philipp ist offline   Mit Zitat antworten
Alt 28.10.2002, 16:07   #10
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard

ja ist ein theme für phpnuke 6
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 17:51 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag