AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

PHP und TPL

Ein Thema von milos · begonnen am 14. Feb 2009 · letzter Beitrag vom 14. Feb 2009
Antwort Antwort
Seite 1 von 2  1 2   
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#1

PHP und TPL

  Alt 14. Feb 2009, 19:48
Hallo nochmal
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>
Milos
  Mit Zitat antworten Zitat
Benutzerbild von Meflin
Meflin

Registriert seit: 21. Aug 2003
4.856 Beiträge
 
#2

Re: PHP und TPL

  Alt 14. Feb 2009, 19:53
In deinem PHP-Script weißt du den Wert der Variable $toolname zu. Diese wird aber nirgends ausgegeben.
  Mit Zitat antworten Zitat
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#3

Re: PHP und TPL

  Alt 14. Feb 2009, 19:56
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
  Mit Zitat antworten Zitat
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#4

Re: PHP und TPL

  Alt 14. Feb 2009, 20:06
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
Milos
  Mit Zitat antworten Zitat
Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#5

Re: PHP und TPL

  Alt 14. Feb 2009, 20:08
Zeig mal den ganzen Code der Datei.
  Mit Zitat antworten Zitat
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#6

Re: PHP und TPL

  Alt 14. Feb 2009, 20:12
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)
?>
Milos
  Mit Zitat antworten Zitat
Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#7

Re: PHP und TPL

  Alt 14. Feb 2009, 20:21
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.
?>
  Mit Zitat antworten Zitat
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#8

Re: PHP und TPL

  Alt 14. Feb 2009, 20:27
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)
?>
Milos
  Mit Zitat antworten Zitat
Benutzerbild von Die Muhkuh
Die Muhkuh

Registriert seit: 21. Aug 2003
7.332 Beiträge
 
Delphi 2009 Professional
 
#9

Re: PHP und TPL

  Alt 14. Feb 2009, 20:35
Du hast meinen Beitrag zitiert und nun?
  Mit Zitat antworten Zitat
Benutzerbild von milos
milos

Registriert seit: 14. Jul 2008
Ort: Bern (CH)
508 Beiträge
 
Delphi 11 Alexandria
 
#10

Re: PHP und TPL

  Alt 14. Feb 2009, 20:37
Ja ich weiss ned warum es ned geht.
Milos
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2   

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 15:54 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