AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

HTML/PHP - PHP Variable in HTML

Ein Thema von Neutral General · begonnen am 31. Mär 2007 · letzter Beitrag vom 31. Mär 2007
Antwort Antwort
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:10
Hi,

Ich habe irgendwo vorher im Code

Code:
$bookid = xyz;
definiert. Jetzt will ich die Variable an eine URL dranhängen:

Code:
<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>
Dummerweise geht das irgendwie nicht... mit smarty bekomm ichs irgendwie auch nicht hin...

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#2

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:13
und mit
Code:
<? echo $bookid; ?>
gehts nicht ?
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#3

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:18
Hi,

Dann bekomm ich das hier:

Code:
<form action="index.php?post&id=<? echo $bookid; ?>" method="POST">
...
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Gruber_Hans_12345

Registriert seit: 14. Aug 2004
1.426 Beiträge
 
Delphi 2007 Professional
 
#4

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:20
wenns damit
Code:
<?php echo $bookid; ?>
auch nicht geht, dann vermute ich, das der apache/php (oder wer auch immer falsch konfiguriert ist)

die datei ist eine .php oder .php4 (zumindest keine .html datei?)

[edit]wie gibst du den HTML-block überhaupt aus?
Gruss Hans

2B or not 2B, that is FF
  Mit Zitat antworten Zitat
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#5

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:22
Hi,

naja es ist eine TPL Datei die mit smarty dargestellt wird...

index.php wird geladen und je nach mode wird dann:

Code:
$page = "book.tpl";
und book.tpl ist oben der gepostete code und dann:

Code:
$mysmarty->Assign('content', $mysmarty->fetch($page));
und

Code:
$mysmarty->display('index.tpl');
wobei dann in index.tpl sowas steht wie:

Code:
sind in smarty als Anfang und Ende einer Smarty Variable definiert..

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Benutzerbild von cruiser
cruiser

Registriert seit: 23. Dez 2003
Ort: Königsbrück/Sachsen
455 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:26
Dann übergib Smarty doch die Variable zum abarbeiten und setz den entsprechenden Smarty-Tag

Also im PHP-Code:

Code:
$mysmarty->Assign('BookID', $IchBinEineID);
und im Template:

  Mit Zitat antworten Zitat
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#7

Re: HTML/PHP - PHP Variable in HTML

  Alt 31. Mär 2007, 14:34
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

Danke für die Hilfe

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz