Variable

kesnw

Erfahrenes Mitglied
Hi, wie kann ich folgendes in korrekter Syntax realisieren?

PHP:
$one_back="<TD WIDTH='20' ALIGN='center' bgcolor='<?php echo $bgcolor;?>'><FONT FACE='Arial, Helvetica' SIZE='-1'><a href='data-content-sample-content.php?offset=<?php echo $k-25;?>&rows=25&alp=<?php echo $_GET['alp'];?>&sort=<?php echo $_GET['sort'];?>&search=<?php echo $_GET['search'];?>'><?php echo $i+1;?></a></FONT></td>"
 
Hat bei mir auch nicht so richtig gewollt. da hab ich's so gelöst. Gibt bestimmt besseres.

PHP:
$link ="<TD WIDTH='20' ALIGN='center' bgcolor='%s'>
           <FONT FACE='Arial, Helvetica' SIZE='-1'>
           <a href='data-content-sample-content.php?offset=%s&rows=25&alp=%s&sort=%s&search=%s'>
           %s
           </a>
           </FONT>
           </td>";

$one_back=sprintf($link,$bgcolor,$k-25,$_GET['alp'],$_GET['sort'],$_GET['search'],$i+1);

Das ist wahrscheinlich die dümmste Lösung von allen, finde aber grad keine andere :D

mb fanste
 
Probier mal Folgendes:
PHP:
<?php

	…
	$one_back = '<td style="width:20px; text-align;center; background-color:'.$bgcolor.'; font-family:Arial,Helvetica,sans-serif; font-size:smaller"><a href="data-content-sample-content.php?offset='.($k-25).'&amp;rows=25&amp;alp='.$_GET['alp'].'&amp;sort='.$_GET['sort'].'&amp;search='.$_GET['search'].'">' .($i+1).'</a></td>';
	…

?>
 
Zurück