hallo,
folgendes problem habe ich
ich möchte das die globalen Bilder nicht immer mit <IMG src="http://www.php.de/Images/xx.png" geladen werden. sondern so <IMG src="127.0.0.1 or http://mein_server/Images/xx.png". Nach dem 3 untermenue "../../../../Images/xx.png. (unsinnige tipparbeit und fehlerträchtig)Daher dachte ich, meine IP or name holen und dann den ordner dranhängen
global var nein also eine konstante
also eine define:
define("GLOBAL_IMAGE","<IMG src=´".$_SERVER["SERVER_ADDR"]."/Images/");
Aufruf <?PHP echo GLOBAL_IMAGE."xx.png";
Das bild wird nicht angezeigt. im html-code wird localhost/main/127.0.0.1/Images/xx.png angezeigt.
wenn ich define dahin ändere "../Images/" klappt dieses
inerhalb von <a href klappt dieses auch nicht mal.
<IMG src="http://meine Seite.de/Images/ habe ich versucht klappt auch nicht.
ich kann den fehler nicht finden weis nicht weiter
cu
hamburg
und nun das script dazu ( grün ist "../Images/" , rot = <IMG src=´".$_SERVER["SERVER_ADDR"]."/Images/")
<?PHP
include_once("../Inc/install.inc");
$referer = explode('/',$_SERVER['HTTP_REFERER']);
if(in_wartung("post") == 1){
echo "<script>window.location.href=\"../system/index.php?sys=sys&seite=$referer[3]\";</SCRIPT>)";
}
lade_session();
?>
<!-- beginn oberer Abschnitt wird über Install.inc gemacht -->
<table width=1270 />
<tr>
<TD valign="top" />
<!-- beginn linker Abschnitt -->
<TABLE width="182">
<TR>
<TD>
<img src="<?PHP echo GLOBAL_IMAGE ?> ab_o.png" width=138 height=15 /></BR>
<img src="Images/schild.png" width=182></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height=20 /></BR>
<a href=../News/index.php?seite=office target=_top><img id=klick src="Images/office_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/office_a.png';" onMouseOut="this.src='Images/office_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../News/index.php?seite=Main target=_top><img id=klick src="Images/news_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/news_a.png';" onMouseOut="this.src='Images/news_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../post/index.php target=_top><img id=klick src="Images/post_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/post_a.png';" onMouseOut="this.src='Images/post_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../markt/index.php target=_top><img id=klick src="Images/markt_b.png" width=138 border=0 alt="Bild" onMouseOut="this.src='Images/markt_b.png';" onMouseOver="this.src='Images/markt_a.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../db/index.php target=_top><img id=klick src="Images/db_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/db_a.png';" onMouseOut="this.src='Images/db_b.png';" /></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../forum/index.php target=_top><img id=klick src="Images/forum_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/forum_a.png';" onMouseOut="this.src='Images/forum_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../suche/index.php target=_top />
<?PHP echo GLOBAL_IMAGE ?>suche_b.png"
width=138 border=0 alt="Bild" onMouseOver="src='../Images/suche_a.png';" onMouseOut="src='../Images/suche_b.png';" /></a></BR>
<?PHP back_wahl(true);
echo OUT_TABLE;
?>
</td>
<!-- beginn mittlerer Abschnitt -->
<TD width="100%" vAlign="top" />
<Table width=100%>
<TR><TD align=center>
<?PHP uhr(); ?>
</TD>
</TR>
<TR><TD>
<?PHP
echo "<DIV align=center></BR><FONT size=6>".ANREDE."<P></P><FONT size=6>Wir starten am 01. Januar 2009</p>
<P>Bis dahin nur Testbetrieb</FONT></p><FONT size=2>admin".EMAIL."</P></DIV>".OUT_TABLE;
?>
</TD>
<!-- beginn rechter Abschnitt -->
<TD width=182 vAlign=top>
<Table width=100%>
<TR><TD>
<?PHP
rechts(true);
echo OUT_TABLE."\n".OUT_TABLE;
unten();
footer();
?>
folgendes problem habe ich
ich möchte das die globalen Bilder nicht immer mit <IMG src="http://www.php.de/Images/xx.png" geladen werden. sondern so <IMG src="127.0.0.1 or http://mein_server/Images/xx.png". Nach dem 3 untermenue "../../../../Images/xx.png. (unsinnige tipparbeit und fehlerträchtig)Daher dachte ich, meine IP or name holen und dann den ordner dranhängen
global var nein also eine konstante
also eine define:
define("GLOBAL_IMAGE","<IMG src=´".$_SERVER["SERVER_ADDR"]."/Images/");
Aufruf <?PHP echo GLOBAL_IMAGE."xx.png";
Das bild wird nicht angezeigt. im html-code wird localhost/main/127.0.0.1/Images/xx.png angezeigt.
wenn ich define dahin ändere "../Images/" klappt dieses
inerhalb von <a href klappt dieses auch nicht mal.
<IMG src="http://meine Seite.de/Images/ habe ich versucht klappt auch nicht.
ich kann den fehler nicht finden weis nicht weiter
cu
hamburg
und nun das script dazu ( grün ist "../Images/" , rot = <IMG src=´".$_SERVER["SERVER_ADDR"]."/Images/")
<?PHP
include_once("../Inc/install.inc");
$referer = explode('/',$_SERVER['HTTP_REFERER']);
if(in_wartung("post") == 1){
echo "<script>window.location.href=\"../system/index.php?sys=sys&seite=$referer[3]\";</SCRIPT>)";
}
lade_session();
?>
<!-- beginn oberer Abschnitt wird über Install.inc gemacht -->
<table width=1270 />
<tr>
<TD valign="top" />
<!-- beginn linker Abschnitt -->
<TABLE width="182">
<TR>
<TD>
<img src="<?PHP echo GLOBAL_IMAGE ?> ab_o.png" width=138 height=15 /></BR>
<img src="Images/schild.png" width=182></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height=20 /></BR>
<a href=../News/index.php?seite=office target=_top><img id=klick src="Images/office_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/office_a.png';" onMouseOut="this.src='Images/office_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../News/index.php?seite=Main target=_top><img id=klick src="Images/news_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/news_a.png';" onMouseOut="this.src='Images/news_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../post/index.php target=_top><img id=klick src="Images/post_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/post_a.png';" onMouseOut="this.src='Images/post_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../markt/index.php target=_top><img id=klick src="Images/markt_b.png" width=138 border=0 alt="Bild" onMouseOut="this.src='Images/markt_b.png';" onMouseOver="this.src='Images/markt_a.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../db/index.php target=_top><img id=klick src="Images/db_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/db_a.png';" onMouseOut="this.src='Images/db_b.png';" /></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../forum/index.php target=_top><img id=klick src="Images/forum_b.png" width=138 border=0 alt="Bild" onMouseOver="this.src='Images/forum_a.png';" onMouseOut="this.src='Images/forum_b.png';"></a></BR>
<img src="<?PHP echo GLOBAL_IMAGE ?>ab_x.png" width=138 height="5"></BR>
<a href=../suche/index.php target=_top />
<?PHP echo GLOBAL_IMAGE ?>suche_b.png"
width=138 border=0 alt="Bild" onMouseOver="src='../Images/suche_a.png';" onMouseOut="src='../Images/suche_b.png';" /></a></BR>
<?PHP back_wahl(true);
echo OUT_TABLE;
?>
</td>
<!-- beginn mittlerer Abschnitt -->
<TD width="100%" vAlign="top" />
<Table width=100%>
<TR><TD align=center>
<?PHP uhr(); ?>
</TD>
</TR>
<TR><TD>
<?PHP
echo "<DIV align=center></BR><FONT size=6>".ANREDE."<P></P><FONT size=6>Wir starten am 01. Januar 2009</p>
<P>Bis dahin nur Testbetrieb</FONT></p><FONT size=2>admin".EMAIL."</P></DIV>".OUT_TABLE;
?>
</TD>
<!-- beginn rechter Abschnitt -->
<TD width=182 vAlign=top>
<Table width=100%>
<TR><TD>
<?PHP
rechts(true);
echo OUT_TABLE."\n".OUT_TABLE;
unten();
footer();
?>
Kommentar