PHP Varialbe in html einbauen?
    
Yomar Urungar
    
    
      
    
  - php
- 0 sirius6b
- 0 -S-P-Y-K-E-
 nicht angemeldet
 nicht angemeldetHallo,
ich möchte das Attribut width einer Tabelle in einer php variable speichern.
Ich habe das so versucht
<?php
 var $table_Width = 123;
....
?>
<html>....
...
<table width ="<?php $table_Width ?>"....>
</table>
...
</html>
aber das funktioniert nicht. Wenn ich mir den quellcode im browser anschaue bekomme ich:
<table width =""....>
</table>
...
</html>
also für width gar nix.
Wieso?
lg
Yomar
du musst es per echo ausgeben lassen.
allerdings geht auch folgendes <?=$variable?>
versuch's mal so
Hallo,
ich möchte das Attribut width einer Tabelle in einer php variable speichern.
Ich habe das so versucht
<?php
var $table_Width = 123;
....
?>
<html>....
...
<table width ="<?php $table_Width ?>"....>
</table>
...
</html>
aber das funktioniert nicht. Wenn ich mir den quellcode im browser anschaue bekomme ich:
<table width =""....>
</table>
...
</html>
also für width gar nix.
Wieso?
lg
Yomar
Hallo,
ich möchte das Attribut width einer Tabelle in einer php variable speichern.
Ich habe das so versucht
<?php
var $table_Width = 123;
....
?>
<html>....
...
<table width ="<?php $table_Width ?>"....>
</table>
...
</html>
aber das funktioniert nicht. Wenn ich mir den quellcode im browser anschaue bekomme ich:
<table width =""....>
</table>
...
</html>
also für width gar nix.
Wieso?
lg
Yomar
versuch mal
<?php echo $table_Width; ?>
Das funktioniert auf jedenfall