![]() |
HTML/PHP - PHP Variable in HTML
Hi,
Ich habe irgendwo vorher im Code
Code:
definiert. Jetzt will ich die Variable an eine URL dranhängen:
$bookid = xyz;
Code:
Dummerweise geht das irgendwie nicht... mit smarty bekomm ichs irgendwie auch nicht hin...
<table>
<tr> <td> </td> </tr> <tr> <td style="padding-left:10px"> <form action="index.php?post&id=[[[HIER SOLL DIE BOOKID HIN]]]" method="POST"> <textarea name="text" style="width: 500px; height: 200px"></textarea> <input type="submit" value="Absenden"></br> </form> </td> </tr> </table> Gruß Neutral General |
Re: HTML/PHP - PHP Variable in HTML
und mit
Code:
gehts nicht ?
<? echo $bookid; ?>
|
Re: HTML/PHP - PHP Variable in HTML
Hi,
Dann bekomm ich das hier:
Code:
...
<form action="index.php?post&id=<? echo $bookid; ?>" method="POST">
|
Re: HTML/PHP - PHP Variable in HTML
wenns damit
Code:
auch nicht geht, dann vermute ich, das der apache/php (oder wer auch immer falsch konfiguriert ist)
<?php echo $bookid; ?>
die datei ist eine .php oder .php4 (zumindest keine .html datei?) [edit]wie gibst du den HTML-block überhaupt aus? |
Re: HTML/PHP - PHP Variable in HTML
Hi,
naja es ist eine TPL Datei die mit smarty dargestellt wird... index.php wird geladen und je nach mode wird dann:
Code:
und book.tpl ist oben der gepostete code und dann:
$page = "book.tpl";
Code:
und
$mysmarty->Assign('content', $mysmarty->fetch($page));
Code:
wobei dann in index.tpl sowas steht wie:
$mysmarty->display('index.tpl');
Code:
sind in smarty als Anfang und Ende einer Smarty Variable definiert..Gruß Neutral General |
Re: HTML/PHP - PHP Variable in HTML
Dann übergib Smarty doch die Variable zum abarbeiten und setz den entsprechenden Smarty-Tag
Also im PHP-Code:
Code:
und im Template:
$mysmarty->Assign('BookID', $IchBinEineID);
|
Re: HTML/PHP - PHP Variable in HTML
Hi,
Wie gesagt das hatte ich schon probiert, aber es hatte nicht geklappt..... Aber auch nur weil ich vergessen hatte die PHP Datei hochzuladen wo die Smarty-Variable definiert wird :wall: :mrgreen: Danke für die Hilfe ;) Gruß Neutral General |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:35 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz