[TYPO3-german] frontend formular speichert daten auf der aktuellen seite statt im sysordner

Gerhard Rasi rasi at rasi.ch
Thu Jun 14 23:54:24 CEST 2007


hallo
ich habe eine extension (meine erste)
warum speichert dieses formular die daten nicht im sysordner?
vielen dank für hilfe!

gruss gerhard

<?php
require_once(PATH_tslib.'class.tslib_pibase.php');
/**
 * Plugin 'Event Confirmation' for the 'eventconfirm' extension.
 *
 * @author Gerhard Rasi <rasi at rasi.ch>
 * @package TYPO3
 * @subpackage tx_eventconfirm
 */
class tx_eventconfirm_pi1 extends tslib_pibase {
 var $prefixId      = 'tx_eventconfirm_pi1';  // Same as class name
 var $scriptRelPath = 'pi1/class.tx_eventconfirm_pi1.php'; // Path to this 
script relative to the extension dir.
 var $extKey        = 'eventconfirm'; // The extension key.

 /**
  * Main method of your PlugIn
  *
  * @param string  $content: The content of the PlugIn
  * @param array  $conf: The PlugIn Configuration
  * @return The content that should be displayed on the website
  */
 function main($content,$conf) {
 $this->conf=$conf;
 $this->pi_setPiVarDefaults();
 $this->pi_loadLL();

 if(isset($this->piVars['submit_button'])) {  // WHAT TO DO if content is 
submitted
  //t3lib_div::debug($this->piVars);
  $query = 'INSERT INTO tx_eventconfirm_participation 
(prename,surname,message,pid) 
VALUES("'.addslashes($this->piVars['DATA']['prename']).'",
 "'.addslashes($this->piVars['DATA']['surname']).'",
 "'.addslashes($this->piVars['DATA']['message']).'",
 "'.$GLOBALS['TSFE']->id.'")';
 $res = mysql(TYPO3_db, $query);
 echo mysql_error();
header ('Location: '.t3lib_div::locationHeaderUrl('index.php?id=30'));
 } else {
      $tage = 
array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
   $tag = date("w");
   $Heute.=('Heute ist ').$tage[$tag];
 $content = '
 <P>'.$Heute.'</P><br>
 <H3>Formular:</H3>
 <form action="'.$this->pi_getPageLink($GLOBALS["TSFE"]->id).'" 
method="POST">
 <input type="hidden" name="no_cache" value="1">
 <b class="label">Vorname</b><input type="text" 
name="'.$this->prefixId.'[DATA][prename]"><br>
 <b class="label">Name</b><input type="text" 
name="'.$this->prefixId.'[DATA][surname]"><br>
 <b class="label">Text</b><textarea 
name="'.$this->prefixId.'[DATA][message]"></textarea>
 <input type="submit" value="Speichern" 
name="tx_eventconfirm_pi1[submit_button]">
 </form>
 <BR>
 <P>You can click here to '.$this->pi_linkToPage("get to this page 
again",$GLOBALS["TSFE"]->id).'</P>
 ';
    }

 return $this->pi_wrapInBaseClass($content);
  }
}

if (defined("TYPO3_MODE") && 
$TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/eventconfirm/pi1/class.tx_eventconfirm_pi1.php"]) 
{
 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/eventconfirm/pi1/class.tx_eventconfirm_pi1.php"]);}?>



More information about the TYPO3-german mailing list