• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

<style> in Php ?

Hey,

ich habe folgenden Code:

HTML:
<style>.furni_box {	position: relative;	border: 1px solid #999;	border-radius: 6px;	box-shadow: 0px 2px 0px #B5B5AF;	background-color: #F3F3F3;	background-repeat: no-repeat;	background-position: center;	width: 185px;	height: 158px;	margin: 4px 4px 6px 4px;	display: block;	float: left;	cursor: pointer;}.furni_box:hover {	background-color: #DEDEDE;}.furni_box:hover div {	visibility: visible;}.furni_details {	visibility: hidden;	position: absolute;	top: -1px;	left: -1px; 	width: 183px;	border: 1px solid #999999;	border-top-right-radius: 6px; 	border-top-left-radius: 6px; 	background-color: #FFFFFF;	box-shadow: 0px 5px 8px #666;	padding: 1px;	margin: 0px;	z-index: 100;	font-size: 11px;	color: #444;	overflow: hidden;}.furni_box_debatte {	position: relative;	border: 1px solid #999;	border-radius: 6px;	box-shadow: 0px 2px 0px #B5B5AF;	background-color: #F3F3F3;	background-repeat: no-repeat;	background-position: center;	width: 215px;	height: 200px;	margin: 0px;	display: block;	float: left;}.furni_box_debatte:hover {	background-color: #DEDEDE;}.furni_box_debatte:hover div {	visibility: visible;}.price_timeline {	visibility: hidden;	position: absolute;	top: -1px;	left: -1px; 	width: 205px;	border: 1px solid #999999;	border-top-right-radius: 6px; 	border-top-left-radius: 6px; 	background-color: #FFFFFF;	padding: 5px;	margin: 0px;	z-index: 100;	font-size: 11px;	color: #444;	box-shadow: 0px 5px 8px #666;}
.price_tag {	position: absolute;	bottom: 0px;	right: 0px;	width: 65px;	height: 25px;	border-top: 1px solid #999;		border-left: 1px solid #999;	border-top-left-radius: 6px;	border-bottom-right-radius: 6px;	box-shadow: inset 0.5px 0.5px 0.5px 0.5px #B5B5AF;	background-color: #FFF;	text-align: center;	line-height: 25px;	font-family:Verdana,Arial,Helvetica,sans-serif!important;	font-size: 13px;	font-weight: bold;	color: #5B5B5B;	z-index: 50;}.price_label_up { 	color:#008B00;	background-color:#CCFFCC;	padding:2px;	border:1px solid #008B00;	text-align:center;	position:absolute;	top: -1px;	right: -1px;	z-index:99;	border-top-right-radius: 6px;  	box-shadow: inset 0.5px 0.5px 0.5px 0.5px #B5B5AF;}.price_label_down { 	color:#990000;	background-color:#FFF0F0;	padding:2px;	border:1px solid #990000;	text-align:center;	position:absolute;	top: -1px;	right: -1px;	z-index:99;	border-top-right-radius: 6px;	box-shadow: inset 0.5px 0.5px 0.5px 0.5px #B5B5AF;}</style>
<!-- Ende Online-Liste // Anfang neuer Eintrag -->		  <div class="furni_box" style="background-image: url(http://www.habbotimes.net/site/scripts/habboimager/habbo.php?user=test&loc=0&act=0&gest=agr&hdir=3&dir=2);" id="1467" ontouchstart="showHiddenDiv('det_1467');">                   <div id="det_1467" class="furni_details" ontouchstart="window.location.href='index.php?site=48&dfurni=1467';"><table cellpadding="2" cellspacing="3" width="100%">                <tr>                 <td valign="top" align="center" width="36" height="36"></td>                 <td class="furni_details_name"><b>test</b><br><i>nochmal test</i></td>                       </tr>                <tr>                 <td align="center" valign="top"><img src="uploads/images/Anderes/buy_price.gif"></td>                 <td class="text_left_middle">0 Taler</td>                </tr>               </table></div>                   <div class="price_tag">normaler tag</div>                   <div class="price_label_up">+up</div>                  </div>	<!-- Ende letzter Eintrag // Anfang neuer Eintrag -->

Den würde ich gerne in eine PHP Seite einbinden.
Also diese Style Sachen könnte ich auch in die CSS Datei einfügen, aber geht das auch so?

In den Bereich wo z.B. "0 Taler" steht muss ein PHP Code rein:
Preis: ".$price." Taler

Nur als Beispiel! Das kriege ich aber auch noch alleine hin. ;ugl
 
Hey,

danke für deinen Tipp. Ich hab es jetzt so gemacht:

Code:
if(!isset($_GET['detail']))
{
    $select_all_furni = "SELECT id, name, img FROM ".$prefix."pricelist_furni";
    $select_all_furni = mysql_query($select_all_furni);
    
    if(mysql_num_rows($select_all_furni) != 0)
    {
        echo "<div width=\"100%\" style=\"align: center\">";
        while($furni = mysql_fetch_assoc($select_all_furni))
        {
            $get_price_query = "SELECT price FROM ".$prefix."pricelist_price WHERE furni_id = '".$furni['id']."' ORDER BY time DESC LIMIT 0 , 1";
            $get_price_query = mysql_query($get_price_query);
            $price = mysql_fetch_assoc($get_price_query);
            $price = $price['price'];
            
            echo "\n";
            echo '<div class="furni_box" style="background-image: url(".$furni['img'].");">
                   <div id="det_1467" class="furni_details" ontouchstart="window.location.href='index.php?site=48&dfurni=1467';"><table cellpadding="2" cellspacing="3" width="100%">
                <tr>
                 <td valign="top" align="center" width="36" height="36"></td>
                 <td class="furni_details_name"><b>'".$furni['name']."'</b><br><i>'".$furni['cat']."'</i></td>       
                </tr>
                <tr>
                 <td align="center" valign="top"><img src="uploads/images/Anderes/buy_price.gif"></td>
                 <td class="text_left_middle">".$price." Taler</td>
                </tr>
               </table></div>
                   <div class="price_tag">".$price."</div>
                   <div class="price_label_up">+0</div>
                  </div>';
				  
				  }

Bei mir kommt aber diese Fehlermeldung:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/www/web135/html/index.php(61) : eval()'d code on line 17

Ich hab es mit " und ' versucht, bei beidem kommt diese Fehlermeldung.

Kannst mir bitte helfen? :)
 
Das ist nicht meiner.
Ich hab aus einem anderen Code ( Aus dem IV-CMS Forum ) die ganzen Teile raus genommen.
Der komplette Code geht so:

if(!isset($_GET['detail']))
{
$select_all_furni = "SELECT id, name, img FROM ".$prefix."pricelist_furni";
$select_all_furni = mysql_query($select_all_furni);

if(mysql_num_rows($select_all_furni) != 0)
{
echo "<div width=\"100%\" style=\"align: center\">";
while($furni = mysql_fetch_assoc($select_all_furni))
{
$get_price_query = "SELECT price FROM ".$prefix."pricelist_price WHERE furni_id = '".$furni['id']."' ORDER BY time DESC LIMIT 0 , 1";
$get_price_query = mysql_query($get_price_query);
$price = mysql_fetch_assoc($get_price_query);
$price = $price['price'];

echo "\n";
echo "<div style=\"width: 121px; height: 68px; background-color: white; float: left; margin-left: 5px; margin-right: 5px; margin-top: 2px\"><center><img onmouseover=\"Tip('".$furni['name']."')\" onmouseout=\"UnTip()\" style=\"width: 121px; height: 86px;\" src=\"".$furni['img']."\" /><br>Preis: ".$price." Taler<br><a href=\"?page=".$_GET['page']."&detail=".$furni['id']."\">Mehr Infos</a></center></div>";

}
echo "</div>";
}
else
{
echo "<center>Leider sind keine Möbel verfügbar!</center>";
}
}
else
{
$furni_id = (int) $_GET['detail'];
$get_furni_info = "SELECT id, name, img, cat FROM ".$prefix."pricelist_furni WHERE id = '".$furni_id."'";
$get_furni_info = mysql_query($get_furni_info);

if(mysql_num_rows($get_furni_info) == 1)
{
$furni = mysql_fetch_assoc($get_furni_info);
?>
<div style="background-color: #0000; height: 200px; width: 200px; float:left">
<center>
<img style="height: 86px; width: 121px;" src="<?php echo $furni['img']; ?>" />
</center></div>
<div style="float: left;">

Name des M&ouml;bels: <?php echo $furni['name']; ?><br /><br />
Kategorie: <?php echo $furni['cat'] ?><br /><br /><?php

$get_latest_price = "SELECT price, time FROM ".$prefix."pricelist_price WHERE furni_id = '".$furni['id']."' ORDER BY time DESC LIMIT 0 , 1";
$get_latest_price = mysql_query($get_latest_price);

$latest_price = mysql_fetch_assoc($get_latest_price);

$update_day = date("d.m.Y", $latest_price['time']);
$update_time = date("H:i", $latest_price['time']);

?>Aktueller Preis: <?php echo $latest_price['price']; ?> Taler (Letztes Update: <?php echo $update_day." : ".$update_time; ?>)<br /><br />
<span style="cursor:pointer; color:#00F; text-decoration: underline;" onclick="spoil('preishistorie');">Preishistorie</span><br /><br />
<br /><br /><br />

<div id="preishistorie" style="display:none;" align="center">
<h2><center>Preishistorie</center></h2><?php

$select_all_prices = "SELECT price, time FROM ".$prefix."pricelist_price WHERE furni_id = '".$furni['id']."' ORDER BY time DESC";
$select_all_prices = mysql_query($select_all_prices);

echo "<ul>";

//Zeige Voting!

$get_voting = "SELECT id
FROM ".$prefix."pricelist_changes
WHERE furni_id = '".$furni['id']."'
AND visible = '1'";
$get_voting = mysql_query($get_voting);


if(mysql_num_rows($get_voting) == 1)
{
echo "<li><strong>Eine &Auml;nderung des Preises wird derzeit diskutiert!</strong></li>";

}
echo mysql_error();


while($row = mysql_fetch_assoc($select_all_prices))
{
$this_update_day = date("d.m.Y", $row['time']);
$this_update_time = date("H:i", $row['time']);

echo "<li>".$this_update_day." : ".$this_update_time." - ".$row['price']." Taler</li>";

}

echo "</ul>";




?>

</div>
<h2><center>Diskussion</center></h2>

<?php

$ugb = new kommentar("preisliste_diskussion_".$_GET['id']);
$ugb->draw();

?></div>

<?php
}
else
{
echo "Nicht valides Möbelstück!";
}
}
echo '
<!-- Preisliste von jantede12 -->';

Ich hab aber was raus gelassen und was verändern wollen.
 
Zurück
Oben