Script geht nicht mehr unter Xampp

Alles, was PHP betrifft, kann hier besprochen werden.

Script geht nicht mehr unter Xampp

Postby wolfgangftl » 21. April 2005 17:41

Hallo, hatte vorher Jana2 Server, da geht das Script, nun bei Xampp
geht es nicht mehr. Fehlermeldung:

Fatal error: Cannot re-assign $this in \apachefriends\xampp\htdocs\ccf-1\portal\fussball\admin\admin.php on line 17
Code: Select all
<?
$_POST = $HTTP_POST_VARS;
$_GET = $HTTP_GET_VARS;
require("../common/include.php");

$action = $_GET['action'];
if(!isset($action))
$action = $_POST['action'];
//$actdaytxt = "actday.txt";
$this="admin.php"; [b]Linie 17[/b]
$db=mysql_connect("$address", "$dbuser", "$dbpasswd");
?>

Danke für Hilfe im Voraus.

Edit by DJ DHG, Code-Tags hinzugefügt
Herzliche Grüße aus Freital
Wolfgang
User avatar
wolfgangftl
 
Posts: 45
Joined: 20. April 2005 19:22
Location: Freital

Postby Wiedmann » 21. April 2005 18:10

Der Code ist nicht kompatible zu PHP5. Also entweder den Code korrektieren, oder nach PHP4 umschalten.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby wolfgangftl » 21. April 2005 18:24

Wiedmann wrote:Der Code ist nicht kompatible zu PHP5. Also entweder den Code korrektieren, oder nach PHP4 umschalten.


Leider bin ich Anfänger, wie mache ich das hier das ganze Script:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Bundesliga-Tippspiel Adminbereich</title>
<link rel="stylesheet" type="text/css" href="../common/style.css">
</head>
<body>
<?
   $_POST  = $HTTP_POST_VARS;
   $_GET  = $HTTP_GET_VARS;
   require("../common/include.php");

   $action = $_GET['action'];
   if(!isset($action))
      $action = $_POST['action'];
   //$actdaytxt = "actday.txt";
   $this="admin.php";
   $db=mysql_connect("$address", "$dbuser", "$dbpasswd");
   $result = mysql_db_query("$dbname", "select intDay, dtmClose from tblinfo");
   if(mysql_numrows($result)==0)
   {
      mysql_db_query("$dbname", "INSERT INTO tblinfo (intDay, dtmClose) VALUES(1, NULL)");
      $newDay=1;
   }
   else
   {
      $newDay = mysql_result($result, 0, "intDay");
      $close = mysql_result($result, 0, "dtmClose");
      if($newDay == "")
      {
         mysql_db_query("$dbname", "UPDATE tblinfo SET intDay=1, dtmClose=NULL");
         $newDay=1;
      }
   }
   ?><b>Aktueller Spieltag: <?echo $newDay?></b><?
   if(!isset($action))
   {
      $error = $_GET['error'];
      switch($error)
      {
         case "datetime":
            ?>
            <br>
            <br>
            <strong style="color:red">Ungültiges Datum</strong>
            <br>
            <?
            break;
      }
      ?>


      <table>
      <tr>
      <td><input type="button" value="Spieltag eintragen" style="width:150px" onclick="document.location.href='<?echo $this?>?action=newDay'"></td>
      </tr><tr>
      <td><input type="button" value="Spieltag schließen" style="width:150px" onclick="document.location.href='<?echo $this?>?action=makeClosed'"></td>
      </tr><tr>
      <td><input type="button" value="Erinnerung senden" style="width:150px" onclick="document.location.href='<?echo $this?>?action=sendRemember'"></td>
      </tr>
       <tr>
      <td><input type="button" value="Spieltag auswerten" style="width:150px" onclick="document.location.href='admin2.php'"></td>
      </tr><tr>
      <td><input type="button" value="nächster Spieltag" style="width:150px" onclick="document.location.href='<?echo $this?>?action=makeOpen'"></td>
      </tr>
      <tr>
         <td><hr></td>
      </tr>
      <tr>
         <td>
            <table>
               <form method="post">
               <input type="Hidden" name="action" value="setCloseDate">
               <tr>
                  <td>
                     Automatisches schließen am
                  </td>
                  <td colspan="3">
                     <?=$close?>
                  </td>
               </tr>
               <tr>
                  <td>
                     Nächsten Spieltag automatisch am
                  </td>
                  <td>
                     <select name="aday">
                        <?
                        for($i=1; $i <= 31; $i++)
                        {
                           $seltext = "";
                           if($i == date("d"))
                              $seltext = "selected";
                           ?>
                           <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                        <?}?>
                     </select>
                     <select name="amonth">
                        <?
                        for($i=1; $i <= 12; $i++)
                        {
                           $seltext = "";
                           if($i == date("m"))
                              $seltext = "selected";
                           ?>
                           <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                        <?}?>
                     </select>
                     <select name="ayear">
                        <option value="<?=date("Y")-1?>" <?=$seltext?> ><?=date("Y")-1?></option>
                        <option selected value="<?=date("Y")?>" <?=$seltext?> ><?=date("Y")?></option>
                        <option value="<?=date("Y")+1?>" <?=$seltext?> ><?=date("Y")+1?></option>
                     </select>
                  </td>
                  <td>
                     <select name="fhour">
                        <?
                           for($i=0; $i<24; $i++)
                           {
                        ?>
                        <option value="<?=$i?>"><?=$i?></option>
                        <?}?>
                     </select> Uhr
                  </td>
                  <td>
                     schließen
                  </td>
               </tr>
               <tr>
                  <td colspan="4">
                     <input type="Submit" value="Setzen">
                  </td>
               </tr>
               </form>
            </table>
         </td>
      </tr>
      <tr>
         <td><hr></td>
      </tr>
      <tr>
      <td><input type="button" value="Mannschaften Bearbeiten" style="width:210px" onclick="document.location.href='<?echo $this?>?action=setTeam'"></td>
      </tr>
<!--
# neuer Button für MailText Bearbeitung
# JayDee 7/04
# post@jd-gerke.de
-->

      <tr>
      <td><input type="button" value="Mailtext ändern" style="width:210px" onclick="document.location.href='<?echo $this?>?action=changeMailText'"></td>
      </tr>
<!-- Ende JayDee -->
      <tr>
         <td><input type="button" value="Userverwaltung" style="width:210px" onclick="document.location.href='<?echo $this?>?action=userlist'"></td>
      </tr>
      <tr>
      <td><input type="button" value="Alles löschen (ausser die Vereine)" style="width:210px" onclick="document.location.href='<?echo $this?>?action=reset'"></td>
      </tr>
      </table><?
   }
   if($action == "setCloseDate")
   {
      $fhour = $_POST['fhour'];
      if(strlen($fhour) == 1)
         $fhour = "0" + $fhour;
      /*$hour = $_POST['ahour'];
      $minute = $_POST['aminute'];*/

      $year = $_POST['ayear'];
      $month = $_POST['amonth'];
      $day = $_POST['aday'];
      if(checkdate($month, $day, $year))
      {
         $datetime = "$year-$month-$day $fhour:00:00";
   //      $datetime = "$fdate $fhour:00:00";
         mysql_db_query("$dbname", "UPDATE tblinfo set dtmClose="$datetime"");
         ?>
         <script language="JavaScript1.2">
            document.location.href="admin.php";
         </script>
         <?
      }
      else
      {
         ?>
         <script language="JavaScript1.2">
            document.location.href="admin.php?error=datetime";
         </script>
         <?
      }
   }
   if($action=="deleteuser")
   {
      $userid = $_POST['userid'];

      //alle tipps des users löschen
      $SQL = "DELETE FROM tblwette WHERE intUserid=$userid";
      $result = mysql_db_query($dbname, $SQL);
      echo mysql_error();

      //alle nachrichten des users löschen
      $SQL = "DELETE FROM tblmessage WHERE lngUserToID=$userid OR lngUserFromID=$userid";
      $result = mysql_db_query($dbname, $SQL);
      echo mysql_error();

      //alle nachrichten des users löschen
      $SQL = "DELETE FROM tblgamer WHERE lngIndex=$userid";
      $result = mysql_db_query($dbname, $SQL);
      echo mysql_error();

      include("userlist.php");
   }
   if($action=="userlist")
   {
      include("userlist.php");
   }

/*
# alte Routine, durch neue ersetzt....
# arbeitet mit templatevorlage....
# JayDee 7/04
# post@jd-gerke.de

   if($action == "sendRemember")
   {
      //$text = "Guten Tag,\r\nSie haben sich bei http://www.script-fabrik.de für die Bundesliga-wette registriert.\r\nAls kleinen Service biete ich Ihnen ein sogenannten Erinnerungsservice an. Also hier die Erinnerung:\r\nDer $newDay. Spieltag ist eröffnet. Ich wünsche viele Gute Tips und einen guten Tabellenstand\r\n\r\n--> Jetzt neu mit videochat! Schaut mal vorbei unter http://www.script-fabrik.de/main/conference.htm <--";
      $fp = fopen("mailtext.html", "r");
      $text = fread($fp, filesize("mailtext.html"));
      fclose($fp);
      $result = mysql_db_query("$dbname", "select strEmail from tblgamer where boolRemember=1");
      $mailcnt = mysql_numrows($result);
      $good = 0;
      for($i = 0; $i < $mailcnt; $i++)
      {
         $mail = mysql_result($result, $i, "strEmail");
         $header = "from: "$hp" <$email>\r\nContent-Type: text/html";
         if(mail($mail,"Admin-News",$text,$header) == 1)
         {
            echo "<br>Email an $mail erfolgreich gesendet";
            $good++;
         }
      }
      echo "<br>Es wurden $good E-mails erfolgreich versendet";
      ?><br><br><input type="button" onclick="document.location.href='<?echo $this?>'" value="zum Hauptmenü"><?
   }
*/

   if($action == "sendRemember")
   {
      $tpl = tplload("mailtext.html");
      $result = mysql_db_query("$dbname", "select strEmail, strAlias from tblgamer where boolRemember=1");
      $mailcnt = mysql_numrows($result);
      $good = 0;
      for($i = 0; $i < $mailcnt; $i++)
      {
         $mail = mysql_result($result, $i, "strEmail");
         $name = mysql_result($result, $i, "strAlias");
         $text = tplprint($tpl, array(
            "NEWDAY" => $newDay,
            "NAME" => $name));

         $header = "from: "$hp" <$email>\r\nContent-Type: text/html";
         if(mail($mail,"Admin-News",$text,$header) == 1)
         {
            echo "<br>Email an $mail erfolgreich gesendet";
            $good++;
         }
      }
      echo "<br>Es wurden $good E-mails erfolgreich versendet";
      ?><br><br><input type="button" onclick="document.location.href='<?echo $this?>'" value="zum Hauptmenü"><?
   }

# neu eingeführt....
# ermöglicht das Verändern der MailText-Vorlage
# JayDee 7/04
# post@jd-gerke.de

   if($action == "changeMailText")
   {

      $fp = fopen("mailtext.html", "r");
      $text = fread($fp, filesize("mailtext.html"));
      fclose($fp);
?>

      <table border="0" width="75%">
        <tr>
          <td width="43%" valign="top">
            <form method="POST" action="admin.php?action=MailTextSpeichern">
            <p><textarea rows="12" name="MailText" cols="60"><? echo stripslashes($text); ?></textarea></p>
            <p><input type="submit" value="Speichern" name="MailTextSpeichern">
             <input type="reset" value="Zurücksetzen" name="B2">
             <input type="button" onclick="window.open('mailtext.html','Fenster2');" value="Vorschau"></p>
            </form>
          </td>
          <td width="57%" valign="top" height="376"> Erlaubte Inserts:
           <table border="0" width="59%">
            <tr>
              <td width="37%" valign="top">{NAME}</td>
              <td width="63%">Name des Mitspielers</td>
            </tr>
            <tr>
              <td width="37%" valign="top">{NEWDAY}</td>
              <td width="63%">des aktuelle Spieltag</td>
            </tr>
           </table>
            <br>
            Erweiterung zusammengestellt durch:
            <br>
            JayDee - <a href="http://www.spzg-mauritz-erpho.de.ms" target="_blank">Spielmannszug Mauitz-Erpho</a>
          </td>
        </tr>
      </table>
      <br>&nbsp;<input type="button" onclick="document.location.href='<?echo $this?>'" value="zum Hauptmenü">
 <?
   }

   if($action == "MailTextSpeichern")
   {
      $mailtext = $_POST['MailText'];
      $mailtext = stripslashes($mailtext);
      $hdl = fopen("mailtext.html", "w");
      fputs ($hdl, $mailtext);
      flock ($hdl, 3);
      fclose  ($hdl);
?>
                 <br><br>gespeichert .....
      <br><br><input type="button" onclick="document.location.href='<?echo $this?>'" value="zum Hauptmenü">
 <?

   }


# Ende JayDee


   if($action=="setTeam")
   {
      ?><table cellpadding="2" cellspacing="0">
      <tr>
         <td style="border-bottom:2px solid darkgray" align="center"><b>Vereinsname</b></td>
         <td style="border-bottom:2px solid darkgray" align="center"><b>Homepage des Vereins</b></td>
         <td style="border-bottom:2px solid darkgray" align="center">&nbsp;</td>
      </tr><?
      for($i=1;$i<=($gamecount*2);$i++)
      {
         $result = mysql_db_query("$dbname", "select * from tblverein where lngIndex='$i'");
         echo mysql_error();
         if(mysql_numrows($result)!=0)
         {
            $verein = mysql_result($result, 0, "strName");
            $url = mysql_result($result, 0, "strUrl");
         }
         else
         {
            $verein="";
            $url = "";
         }
         ?>
         <tr>
         <form action="<?echo $this?>" method="post"><input type="hidden" name="id" value="<?echo $i?>">
         <input type="hidden" name="action" value="saveTeam">
         <td>
            <input type="text" name="strName" value="<?echo $verein?>" style="width:200px">
         </td>
         <td>
            <input type="text" name="strUrl" value="<?echo $url?>" style="width:200px">
         </td>
         <td>
         <input type="submit" value="speichern">
         </td></form></tr>
         <?
      }
      ?>
      <tr><td colspan="2"><input type="button" onclick="document.location.href='<?echo $this?>'" value="zum Hauptmenü"></td></tr>
      </table>
      <?
   }

   if($action=="saveTeam")
   {
      $id = $HTTP_POST_VARS['id'];
      $strName = $HTTP_POST_VARS['strName'];
      $strUrl = $HTTP_POST_VARS['strUrl'];
      $result = mysql_db_query("$dbname", "select * from tblverein where lngIndex=$id");
      if(mysql_numrows($result)!=0)
         mysql_db_query("$dbname", "UPDATE tblverein SET strName='$strName', strUrl='$strUrl' WHERE lngIndex=$id");
      else
         mysql_db_query("$dbname", "INSERT INTO tblverein (lngIndex,strName, strUrl)Values($id, '$strName', '$strUrl')");

      echo "<script>document.location.href='$this?action=setTeam'</script>";
   }

   if($action=="newDay")
   {
      $newDay = $HTTP_GET_VARS['newday'];
      if(!isset($newDay))
         $newDay = $HTTP_POST_VARS['newday'];

      ?>
      <script language="Javascript">
         function checkTeam(formid)
         {
            if(document.forms[formid].ver1.value == document.forms[formid].ver2.value)
               alert("Ein Team kann nicht gegen sich selbst spielen!!!");
            else
               document.forms[formid].submit();
         }

         function deletePair(id)
         {
            document.deleteForm.lngid.value = id;
            document.deleteForm.submit();
         }
      </script>
      <table width="600" cellpadding="2" cellspacing="0">
      <?
      if(!isset($newDay))
      {
         $result = mysql_db_query("$dbname", "select intDay as day from tblinfo");
         if(mysql_numrows($result)==0)
         {
            mysql_db_query("$dbname", "INSERT INTO tblinfo (intDay) VALUES(1)");
            $newDay=1;
         }
         else
         {
            $newDay = mysql_result($result, 0, "day");

            if($newDay == "")
               $newDay=1;

         }
         $result = mysql_db_query("$dbname", "SELECT * FROM tblspieltag WHERE intTag=$newDay");
         $tmpcnt = mysql_numrows($result);
         while($tmpcnt == $gamecount)
         {
            $newDay++;
            $result = mysql_db_query("$dbname", "SELECT * FROM tblspieltag WHERE intTag=$newDay");
            $tmpcnt = mysql_numrows($result);
         }
      }
      else
      {
         $result = mysql_db_query("$dbname", "SELECT * FROM tblspieltag WHERE intTag=$newDay");
         $tmpcnt = mysql_numrows($result);
      }

/*      if(mysql_numrows($result)==9)
      {
         $newDay=$newDay+1;
         echo "<tr><td>Spieltag:</td><td colspan="2"><b>$newDay</b></td></tr><tr><td colspan="3"><hr></td></tr>";
      }
      else*/
      {
         ?>
         <tr>
            <td>Spieltag:</td>
            <td colspan="3"><b><?=$newDay?></b></td>
         </tr>
         <tr>
            <td colspan="4">
               <hr>
            </td>
         </tr>
         <?$cnt = mysql_numrows($result);
         $cntold = $cnt;
         for($j=0; $j < $cnt; $j++)//while($cnt > -1)
         {
            $id1 = mysql_result($result, $j, "intVerein1");
            $hlp = mysql_db_query("$dbname", "select * from tblverein WHERE lngIndex=$id1");
            $verein = mysql_result($hlp, 0, "strName");

            $id2 = mysql_result($result, $j, "intVerein2");
            $hlp = mysql_db_query("$dbname", "select * from tblverein WHERE lngIndex=$id2");
            $verein2 = mysql_result($hlp, 0, "strName");
            ?>
            <tr>
               <td width="290" align="center"><?=$verein?></td>
               <td>:</td>
               <td width="290" align="center"><?=$verein2?></td>
               <td>
                  <input type="Button" value="l&ouml;schen" onclick="deletePair(<?=mysql_result($result, $j,"lngIndex")?>)" <?if(mysql_result($result, $j, "intStatus") != 0){echo "disabled";}?>>
               </td>
            </tr>
            <?//$cnt--;
         }
      }
      for($i=0;$i<($gamecount-$cntold);$i++)
      {
         ?>
         <tr>
            <form name="<?=$i?>" action="<?=$this?>">
            <input type="hidden" name="action" value="saveDay">
            <input type="hidden" name="newDay" value="<?=$newDay?>">
         <?
         $result= mysql_db_query("$dbname", "select * from tblverein");
         $cnt = mysql_numrows($result);
         ?>
         <td align="center">
            <select name="ver1" style="width:200"><?
         for($j = 0; $j < $cnt; $j++)//while($cnt > -1)
         {
            $verein = mysql_result($result, $j, "strName");
            $id = mysql_result($result, $j, "lngIndex");
            $hlp = mysql_db_query("$dbname", "select * from tblspieltag WHERE (intVerein1=$id OR intVerein2=$id) AND intTag=$newDay");
            if(mysql_numrows($hlp)==0)
               echo "<option value="$id">$verein</option>";
         }
         ?></select>
         </td>
         <td>:</td>
         <td align="center">
            <select name="ver2" style="width:200">
         <?$cnt = mysql_numrows($result);
         for($j = 0; $j < $cnt; $j++)
         {
            $verein = mysql_result($result, $j, "strName");
            $id = mysql_result($result, $j, "lngIndex");
            $hlp = mysql_db_query("$dbname", "select * from tblspieltag WHERE (intVerein1=$id OR intVerein2=$id) AND intTag=$newDay");
            if(mysql_numrows($hlp)==0)
               echo "<option value="$id">$verein</option>";
            //$cnt--;
         }
         ?></select>
         </td>
         <td>
            <input type="button" value="Speichern" onclick="checkTeam(<?=$i?>)">
         </td>
         </form>
         </tr>
      </table>
      <table>
      <?
      }
      $result = mysql_db_query("$dbname","select DISTINCT(intTag) FROM tblspieltag");
      $anzahl = mysql_numrows($result)-1;
      echo "<tr><td colspan='3'>";
      for($i=0; $i <= $anzahl; $i++)
      {
         $nDay = mysql_result($result, $i, "intTag");
         ?>
            <input type="button" onClick="document.location.href='admin.php?action=newDay&newday=<?echo $nDay?>'" value="<?echo $nDay?>. Spieltag">
         <?
      }
      ?><input type="button" onClick="document.location.href='admin.php?action=newDay'" value="neuer Spieltag"></td>
      <form action="<?=$this?>" method="get" name="deleteForm">
         <input type="Hidden" name="lngid">
         <input type="hidden" name="action" value="deleteDay">
         <input type="hidden" name="newDay" value="<?=$newDay?>">
      </form>
      <?
      echo "</tr>";
      echo "<tr><td colspan="3"><input type="button" value="zum Hauptmenü" onclick="document.location.href='$this'"></td></tr>";
      echo "</table>";

   }
   if($action=="saveDay")
   {
      $ver1 = $HTTP_GET_VARS['ver1'];
      $ver2 = $HTTP_GET_VARS['ver2'];
      $newDay = $HTTP_GET_VARS['newDay'];
      if(mysql_numrows(mysql_db_query($dbname, "SELECT * FROM tblspieltag WHERE ((intVerein1=$ver1 OR intVerein2=$ver1) OR (intVerein1=$ver2 OR intVerein2=$ver2)) AND intTag=$newDay"))==0)
      {
         mysql_db_query("$dbname", "INSERT INTO tblspieltag(intVerein1,intVerein2,intTag,intStatus) VALUES($ver1,$ver2,$newDay,0)");
         echo mysql_error();
      }

      echo "<script>document.location.href='$this?action=newDay';</script>";
   }

   if($action=="deleteDay")
   {
      $id = $_GET['lngid'];
      $newDay = $_GET['newDay'];
      mysql_db_query("$dbname", "DELETE FROM tblwette WHERE intSpielid=$id");
      mysql_db_query("$dbname", "DELETE FROM tblspieltag WHERE lngIndex=$id");
      echo mysql_error();
      echo "<script>document.location.href='$this?action=newDay';</script>";
   }

   if($action == "makeClosed")
   {
      echo "<table>";
      $result= mysql_db_query("$dbname", "select DISTINCT(intTag)as DAY from tblspieltag where intStatus=1");
      if(mysql_numrows($result)!=0)
      {
         //$disable="disabled";?>
         <tr>
            <td>
               <strong>Achtung: ein oder mehrere Spieltage wurden noch nicht ausgewertet!</strong>
            </td>
         </tr>
         <?
      }
      //else
      $disable="";
      $result= mysql_db_query("$dbname", "select DISTINCT(intTag)as DAY from tblspieltag where intStatus=0 ORDER BY intTag DESC");
      $cnt = mysql_numrows($result)-1;
      while($cnt>-1)
      {
         echo "<tr>";
         for($i=0;$i<5 && $cnt > -1;$i++)
         {
            echo "<td>";
            $id = mysql_result($result, $cnt, "DAY");
            echo "<input type="button" value="$id" onclick="document.location.href='$this?action=setClosed&id=$id'" $disable>";
            echo "</td>";
            $cnt--;
         }
         echo "</tr>";
         //$cnt--;
      }
      echo "<tr><td colspan="5"><input type="button" value="zum Hauptmenü" onclick="document.location.href='$this'"></td></tr>";
      echo "</table>";
   }
   if($action=="setClosed")
   {
      $id = $HTTP_GET_VARS['id'];
      mysql_db_query("$dbname", "UPDATE tblspieltag SET intStatus=1 WHERE intTag=$id");
      echo "<script>document.location.href='$this?action=makeClosed';</script>";
   }

   if($action=="makeOpen2")
   {
      ?>
      <form method="post" action="admin.php?action=makeOpen2">
      <table>
         <tr>
            <td align="right">
               Automatisches Schlie&szlig;en am:
            </td>
            <td>
               <select name="aday">
                  <?
                  for($i=1; $i <= 31; $i++)
                  {
                     $seltext = "";
                     if($i == date("d"))
                        $seltext = "selected";
                     ?>
                     <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                  <?}?>
               </select>
               <select name="amonth">
                  <?
                  for($i=1; $i <= 12; $i++)
                  {
                     $seltext = "";
                     if($i == date("m"))
                        $seltext = "selected";
                     ?>
                     <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                  <?}?>
               </select>

               <select name="ayear">
                  <option value="<?=date("Y")-1?>" <?=$seltext?> ><?=date("Y")-1?></option>
                  <option selected value="<?=date("Y")?>" <?=$seltext?> ><?=date("Y")?></option>
                  <option value="<?=date("Y")+1?>" <?=$seltext?> ><?=date("Y")+1?></option>
               </select>
            </td>
         </tr>
         <tr>
            <td align="right">um:</td>
            <td>
               <select name="ahour">
                  <?
                  for($i=0; $i <= 24; $i++)
                  {
                     $seltext = "";
                     if($i == date("h"))
                        $seltext = "selected";
                     ?>
                     <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                  <?}?>
               </select>
               <select name="aminute">
                  <?
                  for($i=0; $i <= 59; $i++)
                  {
                     $seltext = "";
                     if($i == date("i"))
                        $seltext = "selected";
                     ?>
                     <option value="<?=$i?>" <?=$seltext?> ><?=$i?></option>
                  <?}?>
               </select>
            </td>
         </tr>
         <tr>
            <td colspan="2" align="right">
               <input type="Submit" value="&Ouml;ffnen">
            </td>
         </tr>
      </table>
      </form>
      <?
   }
   if($action=="makeOpen")
   {
      mysql_db_query("$dbname", "UPDATE tblinfo set intDay=intDay+1, dtmClose=NULL");//, dtmClose="$datetime"");
      echo "<script>document.location.href='$this';</script>";
   }
   if($action=="reset")
   {
      ?>
      wollen sie wirklich löschen???
      <form action="admin.php?action=reset2" method="post">
      <input type="submit" value="wirklich???">
      </form>
      <?
   }
   if($action=="reset2")
   {
      mysql_db_query("$dbname", "DELETE FROM tblwette");
      mysql_db_query("$dbname", "DELETE FROM tblspieltag");
      mysql_db_query("$dbname", "DELETE FROM tblsession");
      mysql_db_query("$dbname", "UPDATE tblgamer SET intPoint=0, intMoney=40");
      mysql_db_query("$dbname", "UPDATE tblverein SET intGoal=0, intGGoal=0, intPoint=0");
      mysql_db_query("$dbname", "UPDATE tblinfo SET intDay=1, dtmClose=NULL");
      echo "<script>alert("Alle Spieler haben jetzt 0 Punkte und 40 Spieleinheiten!");document.location.href='$this';</script>";
   }

   if($action=="editDay")
   {
   }

?>
<br>
<table width="500" cellpadding="0" cellspacing="0" border="0">
<tr>
   <td align="right">
   <a href="http://www.script-fabrik.de">Copyright (c) 2003 by www.Script-Fabrik.de</a>
   </td>
</tr>
</table>
</body></html>


<?

# Funktionen zur Einbíndung des Mailtemplates
# JayDee 7/04
# post@jd-gerke.de

  function tplload($file)
  {
    if($fp = @fopen($file, "r"))
    {
      $tpl = fread($fp, filesize($file));
      fclose ($fp);
    }
    else $tpl = "Template konnte nicht geöffnet werden ($file)";
    return $tpl;
  }

  function tplprint($tpl, $repla)
  {
    foreach($repla as $key=>$elem)
    {
      $tpl = str_replace("{".$key."}", $elem, $tpl);
    }
    return $tpl;
  }

  ?>
Herzliche Grüße aus Freital
Wolfgang
User avatar
wolfgangftl
 
Posts: 45
Joined: 20. April 2005 19:22
Location: Freital

Postby Stefan » 22. April 2005 00:34

Servus,

Was ist $this? -> http://www.php-faq.de/q/q-klassen-this.html
Ich habe keine Ahnung, sondern vermute mal, das PHP5 die Angelegenheit etwas straffer sieht und eben ein $this in der Form nicht mehr akzeptiert.(Richtig? Bitte um Korrektur)
Fatal error: Cannot re-assign $this in...


Nach Version 4 kannst Du mit der "php-switch.bat" wechseln.
Ansonsten würde ein umbenennen der Variablen "$this" auch genügen.

ciao, Stefan
User avatar
Stefan
 
Posts: 475
Joined: 26. December 2002 22:36
Location: Mitten in der sonnigen Südpfalz

Postby wolfgangftl » 22. April 2005 07:45

Stefan wrote:Servus,

Was ist $this? -> http://www.php-faq.de/q/q-klassen-this.html
Ich habe keine Ahnung, sondern vermute mal, das PHP5 die Angelegenheit etwas straffer sieht und eben ein $this in der Form nicht mehr akzeptiert.(Richtig? Bitte um Korrektur)
Fatal error: Cannot re-assign $this in...


Nach Version 4 kannst Du mit der "php-switch.bat" wechseln.
Ansonsten würde ein umbenennen der Variablen "$this" auch genügen.

ciao, Stefan

Könnte mit PHP5 zusammenhängen. Wie kann ich die Variable umbenennen, so das die gleiche Aktion ausgeführt wird.
Herzliche Grüße aus Freital
Wolfgang
User avatar
wolfgangftl
 
Posts: 45
Joined: 20. April 2005 19:22
Location: Freital

Postby Stefan » 22. April 2005 12:06

Grüß Dich,

Wie kann ich die Variable umbenennen, so das die gleiche Aktion ausgeführt wird.
Na einfach per suchen+ersetzen. Ersetze alle "$his" durch "$dies"(ist natürlich Dir überlassen.)


ciao, Stefan

PS: natürlich machst Du vorichtshalber mal eine Sicherungskopie der Originaldatei
User avatar
Stefan
 
Posts: 475
Joined: 26. December 2002 22:36
Location: Mitten in der sonnigen Südpfalz


Return to PHP

Who is online

Users browsing this forum: No registered users and 13 guests