Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   PHP und TPL (https://www.delphipraxis.net/129213-php-und-tpl.html)

milos 14. Feb 2009 19:48


PHP und TPL
 
Hallo nochmal :D
Schon wieder ein Problem
Ich will das ein Link kommt mit dem inhalt von einer TEXTBOX ich habe sie auch in die Variable gesetzt. Alle Variabeln werden automatisch in die TPL eingetragen

Doch mein Problem ist es wird nicht angezeigt was man im Textbox reintut.

PHP
Code:
<?php
$toolname = ($_POST['namebox']);

if ($_GET['done']) { 
$toolbox = ($_GET['done']);
echo "index_" . $toolbox . ".tpl";
}
?>
TPL
Code:
<html>

<head>
<meta http-equiv="Content-Language" content="de-ch">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Scheiss Tools gehen raus</title>
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--">
   

Toolname vom actions Ordner (OHNE .PHP):
   <input type="text" name="namebox" size="39"></p>
   

<input type="button" value="Löschen"

onclick="location='http://localhost/admin/index.php?screen=delete_tools&done=

{$toolname}'"></p>
</form>

</body>

</html>

Meflin 14. Feb 2009 19:53

Re: PHP und TPL
 
In deinem PHP-Script weißt du den Wert der Variable $toolname zu. Diese wird aber nirgends ausgegeben.

milos 14. Feb 2009 19:56

Re: PHP und TPL
 
Code:
$smarty->tpl_assing(toolname, $toolname);
??? Das habe ich schon probiert
Es kommt immer
Fatal error: Call to a member function on a non-object in C:\Users\Milu\Desktop\DSLan\Mei_Bot\dslan_v1.2\htd ocs\admin\actions\delete_tools.php on line 8

milos 14. Feb 2009 20:06

Re: PHP und TPL
 
Edit: Ich musste ja smarty.class.php includieren wie dumm bin ich??? omg... Jetzt kommt aber
Fatal error: Cannot redeclare class smarty in C:\Users\Milu\Desktop\DSLan\Mei_Bot\dslan_v1.2\htd ocs\lib\smarty\smarty.class.php on line 1

Die Muhkuh 14. Feb 2009 20:08

Re: PHP und TPL
 
Zeig mal den ganzen Code der Datei.

milos 14. Feb 2009 20:12

Re: PHP und TPL
 
Code:
<?php
include ("./../lib/smarty/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../Templates";
$smarty->compile_dir = "../Templates_C";

if ($_GET['done']) { 
$toolbox = ($_GET['done']);
echo "index_" . $toolbox . ".tpl";
}
$smarty->tpl_assing(toolname, $toolname)
?>

Die Muhkuh 14. Feb 2009 20:21

Re: PHP und TPL
 
Schau Dir am besten mal das QuickStart-Tutorial von Smarty an, da steht drin, wie es geht, da sind ja noch massig Fehler drin:

Code:
<?php
include ("./../lib/smarty/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../Templates";
$smarty->compile_dir = "../Templates_C";

if ($_GET['done']) {  // Du meinst das richtige, ist aber falsch geschrieben
$toolbox = ($_GET['done']);
echo "index_" . $toolbox . ".tpl"; // Warum hier ein echo?
}
$smarty->tpl_assing(toolname, $toolname) // Methode falsch geschrieben, Methode darfst eh nicht aufrufen, Du nutzt eine Konstante "toolname", die es gar nicht gibt.
?>

milos 14. Feb 2009 20:27

Re: PHP und TPL
 
Zitat:

Zitat von Die Muhkuh
Schau Dir am besten mal das QuickStart-Tutorial von Smarty an, da steht drin, wie es geht, da sind ja noch massig Fehler drin:

Code:
<?php
include ("./../lib/smarty/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../Templates";
$smarty->compile_dir = "../Templates_C";

if ($_GET['done']) {  // Du meinst das richtige, ist aber falsch geschrieben (was denn?)
$toolbox = ($_GET['done']);
echo "index_" . $toolbox . ".tpl"; // Warum hier ein echo? (für den test soll es mal anzeigen ob es läuft)
}
$smarty->tpl_assing(toolname, $toolname) // Methode falsch geschrieben, Methode darfst eh nicht aufrufen, Du nutzt eine Konstante "toolname", die es gar nicht gibt. (hab ausversehen überschrieben xD)
?>


Die Muhkuh 14. Feb 2009 20:35

Re: PHP und TPL
 
Du hast meinen Beitrag zitiert und nun?

milos 14. Feb 2009 20:37

Re: PHP und TPL
 
Ja ich weiss ned warum es ned geht.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:12 Uhr.
Seite 1 von 2  1 2      

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