Logo Search packages:      
Sourcecode: dacode version File versions  Download package

submit.php3

<?php
/* daCode _ http://www.dacode.org/
 * $Id: submit.php3,v 1.13.2.6 2002/10/12 17:32:29 ruffy Exp $
 */

      $topdir = '..';
      require $topdir.'/dacode.php3';

      $html = LoadClass('Html');
      $user = LoadClass('User');

      if ($user->checked != 1) {
            echo lecho("Must be logged...")."<br />\n";
            echo $html->footer();
            exit;
      }

      if (!ereg('^'.$config->baseurl,$HTTP_SERVER_VARS['HTTP_REFERER'])
            && !($session->param & pow(2,3))) {
            $title = lecho("HTTP referer");
            $nobanner = false;
            $utils = LoadClass('Utils');
            $text = $utils->warn_referer();
            $html->parsetemplate('basic.tmpl');
            exit;
      }

      $tips = LoadClass('Tips');

      if (!isset ($HTTP_POST_VARS['submit']) 
                  || !isset ($HTTP_POST_VARS['tip'])) {
            $title = lecho("Submit a tip");
            $text = $tips->formNewTip();
            $nobanner = false;
            $html->parseTemplate('basic.tmpl');
      } else {
            if (empty ($HTTP_POST_VARS['tip']) || empty ($HTTP_POST_VARS['name'])) {
                  $title = lecho("Submit a tip");
                  $text = lecho("<br />You must propose a tip and a tip's name...<br /><br />");
                  $html->parseTemplate('basic.tmpl');
            } else {
                  $row['tip'] = $HTTP_POST_VARS['tip'];
                  $row['name'] = $HTTP_POST_VARS['name'];
                  $row['tip_section_id'] = $HTTP_POST_VARS['tip_section_id'];
                  $tips->addNewTip($row);
            }
      }

?>

Generated by  Doxygen 1.6.0   Back to index