Problem mit Sessions (Firefox = ok, IE = manche seiten gehen

Alles, was PHP betrifft, kann hier besprochen werden.

Problem mit Sessions (Firefox = ok, IE = manche seiten gehen

Postby HENNER » 08. June 2005 14:53

Hi,

hab hier ein kleines Problem mit Sessions und dem IE.

Sessions gehen über Cookies. Einstellungen von PHP sind:

session.use_cookies = 1
session.use_only_cookies = 0
session.use_trans_sid = 1

Manche Seiten gehen mit dem IE und einige nicht. Habe hier ein Menü, wo man sein Fahrzeug (welches in einer Galerie eingetragen ist) auswählt um es dann zu bearbeiten. Man kann das Fahrzeug auswählen (Radiobuttons). Sobald ich dem Script dann sage, er soll es zur weiteren Bearbeitung abschicken, landet man wieder an genau dieser Stelle (also ob man kein Fahrzeug auswählen würde) ...

Code: Select all
<?php
 
 // error_reporting(E_ALL);

  include("dbconnect.php");
  include("sessionhelpers.inc.php");
  // include("navigation.php");

function br2nl( $data )
  {
  return preg_replace( '!<br.*>!iU', "\n", $data );
  }

function dbdate2datum( $dbdate )
  {
  list($dbjahr, $dbmonat, $dbtag) = explode("-", $dbdate);
  $datum = $dbtag .".". $dbmonat .".". $dbjahr;
  return $datum;
  }

function datum2dbdate( $datum )
  {
  list($dbtag, $dbmonat, $dbjahr) = explode(".", $datum);
  $dbdate = $dbjahr ."-". $dbmonat ."-". $dbtag;
  return $dbdate;
  }



  session_start();

if (!logged_in())
  {
  header("Location: user_login.php");
  }
 else
  {
  if ($action=="")
    {
    include("navigation.php");
    ?>
    <html>
    <head>
    <title>KIA Tuning ~ Userbereich</title>
    </head>
    <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
    <body>

    <div id="rightcontent">

    <center>
    <br>
    <br>
    <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>

    <br> <br>
   
    <table cellspacing=0 cellpadding=0 border=0>
     <tr>
      <td width=125 align=center valign=middle><a href="user_fzgdat.php?action=view"><img src="daten_ansehen.gif" alt="Daten ansehen" border="0"></a></td>
      <td width=125 align=center valign=middle><a href="user_fzgdat.php?action=change"><img src="daten_aendern.gif" alt="Daten ändern" border="0"></a></td>
     </tr>
    </table>     
    </body>
    </html>
    <?
    }

  // ##############  view  ###############
  if ($action=="view")
    {
    include("navigation.php");
    $sessionid = session_id();
    $abfrage = "SELECT UserID FROM users WHERE (UserSession=\"$sessionid\") LIMIT 1";
    $result = mysql_query($abfrage) or die("Fehler beim lesen aus der Datenbank aufgetreten. (Result)<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
    $row = mysql_fetch_object($result);
 
    $UserID = $row->UserID;
 
    mysql_free_result($result);

    ?>
    <html>
    <head>
    <title>KIA Tuning ~ Userbereich</title>
    </head>
    <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
    <body>

    <div id="rightcontent">

    <center>
    <br>
    <br>
    <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>

    <br> <br>
   
    <form action="user_fzgdat.php?action=change" method="post">
   
    <table cellspacing=0 cellpadding=0 border=0>
     <tr>
      <td width=10 bgcolor="#DFDFDF"> </td>
      <td width=25 bgcolor="#DFDFDF"> </td>
      <td width=80 align=center valign=middle bgcolor="#DFDFDF"><font face="Verdana, Arial" size="2"><b>Modell</b></font></td>
      <td width=5 bgcolor="#DFDFDF"> </td>
      <td width=180 align=center valign=middle bgcolor="#DFDFDF"><font face="Verdana, Arial" size="2"><b>Fahrzeug</b></font></td>
      <td width=5 bgcolor="#DFDFDF"> </td>
      <td width=100 align=center valign=middle bgcolor="#DFDFDF"><font face="Verdana, Arial" size="2"><b>letzte Ändg.</b></font></td>
      <td width=5 bgcolor="#DFDFDF"> </td>
      <td width=60 align=center valign=middle bgcolor="#DFDFDF"><font face="Verdana, Arial" size="2"><b>Status</b></font></td>
      <td width=10 bgcolor="#DFDFDF"> </td>
     </tr>
     <?


    $abfrage2 = "SELECT FzgID,UserID,GalID,status FROM users_fzg WHERE (UserID=$UserID)";
    $result2 = mysql_query($abfrage2) or die("Fehler beim lesen aus der Datenbank aufgetreten (Result2).<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
   
    while ($row2 = mysql_fetch_object($result2))
       {
       
       $fzg_id = $row2->FzgID;
       $gal_id = $row2->GalID;

       $dbstatus = $row2->status;

       switch ($dbstatus)
           {
           case 0:
            $status = "<img src=\"fzg_offline.gif\" alt=\"offline\" border=\"0\">";
            $checkbox = "<input type=\"radio\" name=\"fzgid\" value=\"". $fzg_id ."\" id=\"fzgid\">";
            break ;   
           case 1:
            $status = "<img src=\"fzg_online.gif\" alt=\"online\" border=\"0\">";
            $checkbox = "<input type=\"radio\" name=\"fzgid\" value=\"". $fzg_id ."\" id=\"fzgid\">";
            break ;   
           case 2:
            $status = "<img src=\"fzg_gesperrt.gif\" alt=\"gesperrt\" border=\"0\">";
            $checkbox = "";
            break ;   
      default:
            // $status = "<img src=\"fzg_offline.gif\" alt=\"offline\" border=\"0\">";
            // $checkbox = "<input type=\"checkbox\" name=\"fzgid\" value=\"". $fzg_id ."\" id=\"fzgid\">";
           }

       $abfrage3 = "SELECT id,fahrzeug,modell,datum FROM galerie WHERE (id=$gal_id)";
       $result3 = mysql_query($abfrage3) or die("Fehler beim lesen aus der Datenbank aufgetreten (Result3).<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
       $row3 = mysql_fetch_object($result3);

       $fahrzeug = $row3->fahrzeug;
       $modell = ucfirst($row3->modell);
       $modell1 = $row3->modell;
       $lastchange = dbdate2datum($row3->datum);

       // while ($row3 = mysql_fetch_object($result3))
       //   {
         ?>
         <tr>
          <td bgcolor="#DFDFDF" colspan=10 height=3> </td>
         </tr>
         <tr>
          <td bgcolor="#DFDFDF"> </td>
          <td bgcolor="#DFDFDF"><? echo $checkbox; ?></td>
          <td align=center valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $modell; ?></font></td>
          <td bgcolor="#DFDFDF"> </td>
          <td align=center valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $fahrzeug; ?></font></td>
          <td bgcolor="#DFDFDF"> </td>
          <td align=center valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $lastchange; ?></font></td>
          <td bgcolor="#DFDFDF"> </td>
          <td align=center valign=middle bgcolor="#DFDFDF"><font face="Verdana, Arial" size="2"><? echo $status; ?></font></td>
          <td bgcolor="#DFDFDF"> </td>
         </tr>
         <?
       //   }
       mysql_free_result($result3);
       }
    mysql_free_result($result2);
    ?>
       <tr>
        <td bgcolor="#DFDFDF" colspan=10 height=8> </td>
       </tr>
       <tr>
        <td colspan=10 height=16>&nbsp;</td>
       </tr>
       <tr>
        <td align=center valign=middle colspan=10><input type="image" src="daten_aendern.gif" name="submit" value="submit" id="submit"></td>
       </tr>

    </table>     
    </form>
    </body>
    </html>
    <?
    }     

  // ##################  change  ###############################
  if ($action=="change")
    {
    if (isset($_POST["submit"]) AND isset($_POST["fzgid"]))
      {
      $sessionid = session_id();

      $abfrage = "SELECT UserID FROM users WHERE (UserSession=\"$sessionid\") LIMIT 1";
      $result = mysql_query($abfrage) or die("Fehler beim lesen aus der Datenbank aufgetreten.<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
      $row = mysql_fetch_object($result);
      $UserID = $row->UserID;
      mysql_free_result($result);

      $fzgid = $_POST["fzgid"];
      $abfrage2 = "SELECT FzgID,UserID,GalID,status FROM users_fzg WHERE (UserID=$UserID AND FzgID=$fzgid)";
      $result2 = mysql_query($abfrage2) or die("Fehler beim lesen aus der Datenbank aufgetreten.<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
      $row2 = mysql_fetch_object($result2);
       
      $fzg_id = $row2->FzgID;
      $galid = $row2->GalID;
      mysql_free_result($result2);


      $abfrage3 = "SELECT id,fahrzeug,modell,datum FROM galerie WHERE (id=$galid)";
      $result3 = mysql_query($abfrage3) or die("Fehler beim lesen aus der Datenbank aufgetreten.<br>ErrNo: ".mysql_errno()." Error: ".mysql_error()."<br><br>Bitte verständigen Sie den Webmaster.");
      $row3 = mysql_fetch_object($result3);

      $fahrzeug = $row3->fahrzeug;
      $modell = ucfirst($row3->modell);
      $modell1 = $row3->modell;
      $lastchange = dbdate2datum($row3->datum);
      mysql_free_result($result3);
     
      switch ($modell1)
         {
       case "picanto":
        $modell2 = "<option value=\"picanto\" selected>Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens I/II</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival I/II</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "pride":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\" selected>Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "rio":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\" selected>Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "sephia":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\" selected>Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "shuma":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\" selected>Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "cerato":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\" selected>Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "clarus":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\" selected>Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "magentis":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\" selected>Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "opirus":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\" selected>Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "carens":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\" selected>Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "joice":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\" selected>Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "carnival":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\" selected>Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "sportage":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\" selected>Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "retona":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\" selected>Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "sorento":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\" selected>Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "roadster":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\" selected>Roadster</option><option value=\"sonstige\">sonstige</option>";
        break ;   
       case "sonstige":
        $modell2 = "<option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\" selected>sonstige</option>";
        break ;   
       default:
        $modell2 = "<option value=\"modell-waehlen\" selected>Modell auswählen</option><option value=\"picanto\">Picanto</option><option value=\"pride\">Pride</option><option value=\"rio\">Rio</option><option value=\"sephia\">Sephia</option><option value=\"shuma\">Shuma</option><option value=\"cerato\">Cerato</option><option value=\"clarus\">Clarus</option><option value=\"magentis\">Magentis</option><option value=\"opirus\">Opirus</option><option value=\"carens\">Carens</option><option value=\"joice\">Joice</option><option value=\"carnival\">Carnival</option><option value=\"sportage\">Sportage</option><option value=\"retona\">Retona</option><option value=\"sorento\">Sorento</option><option value=\"roadster\">Roadster</option><option value=\"sonstige\">sonstige</option>";
        break;
         }

     
     
      $dbstatus = $row2->status;

      if ($dbstatus == "2")
        {
        include("navigation.php");
        ?>
        <html>
        <head>
        <title>KIA Tuning ~ Userbereich</title>
        </head>
        <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
        <body>

        <div id="rightcontent">

        <center>
        <br>
        <br>
        <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>

        <br> <br><font face="verdana, arial" size="1" color="red">Dieses Fahrzeug wurde durch den Seitenbetreiber gesperrt !<br>Für nähere Informationen <a href="/html/kontakt.html">kontaktieren</a> Sie uns.<br><br><font color="black">

        <table cellspacing=0 cellpadding=0 border=0>
         <tr>
          <td width=10 bgcolor="#EFEFEF"> </td>
          <td width=60 align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2">Fahrzeug-Modell</font></td>
          <td width=30 align=center bgcolor="#EFEFEF">:</td>
          <td width=200 align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $modell; ?></font></td>
         </tr>
         <tr>
          <td bgcolor="#EFEFEF"> </td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2">Fahrzeug</font></td>
          <td align=center bgcolor="#EFEFEF">:</td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $fahrzeug; ?></font></td>
         </tr>
        </table>     
        </div>
        </body>
        </html>
        <?


        }
       else
        {
        if ($dbstatus == "1")
          {
          $dbstat = "<select name=\"status\" style=\"width:225px;\"><option value=\"1\" selected>online</option><option value=\"0\">offline</option></select>";
          }
         else
          {
          $dbstat = "<select name=\"status\" style=\"width:225px;\"><option value=\"1\">online</option><option value=\"0\" selected>offline</option></select>";
          }
       
        include("navigation.php");
        ?>
        <html>
        <head>
        <title>KIA Tuning ~ Userbereich</title>
        </head>
        <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
        <body>

        <div id="rightcontent">

        <center>
        <br>
        <br>
        <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>

        <br> <br>

        <form action="user_fzgdat.php?action=save" method="POST">

        <input type="hidden" name="fzgid" value="<? echo $fzgid; ?>">
        <input type="hidden" name="galid" value="<? echo $galid; ?>">
   
        <table cellspacing=0 cellpadding=0 border=0>
         <tr>
          <td width=10 bgcolor="#EFEFEF"> </td>
          <td width=60 align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2">Fahrzeug-Modell</font></td>
          <td width=30 align=center bgcolor="#EFEFEF">:</td>
          <td width=200 align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><select name="modell" style="width:225px;"><? echo $modell2; ?></select></font></td>
         </tr>
         <tr>
          <td bgcolor="#EFEFEF"> </td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2">Fahrzeug</font></td>
          <td align=center bgcolor="#EFEFEF">:</td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><input type="text" name="fahrzeug" value="<? echo $fahrzeug; ?>" style="width:225px;"></font></td>
         </tr>
         <tr>
          <td bgcolor="#EFEFEF"> </td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2">Status</font></td>
          <td align=center bgcolor="#EFEFEF">:</td>
          <td align=left valign=middle bgcolor="#EFEFEF"><font face="Verdana, Arial" size="2"><? echo $dbstat; ?></font></td>
         </tr>
         <tr>
          <td colspan=4 height=16> </td>
         </tr>
         <tr>
          <td colspan=4 height=16 align=center valign=middle><input type="image" src="aenderungen_speichern.gif" name="submit" value="submit" id="submit"></td>
         </tr>
        </table>     
        <form>
        </div>
        </body>
        </html>
        <?
        }     
      }     
     else
      {
      header("Location: user_fzgdat.php?action=view");
      }
   }

  // ##############  save  ###############
  if ($action=="save")
    {
    if (isset($_POST["submit"]))
      {
      $fzgid = $_POST['fzgid'];
      $galid = $_POST['galid'];
      $modell = $_POST['modell'];
      $dbstat = $_POST['status'];
      $fahrzeug = htmlspecialchars($_POST['fahrzeug']);
      $lastchange = datum2dbdate(date("d.m.Y"));
         
      $wm="update galerie set modell=\"$modell\" WHERE (id=\"$galid\") LIMIT 1";
      $erg=mysql_query($wm) or die ("UpdateDB : Ein Fehler beim Aendern ist aufgetreten\nFehlerfeld: MODELL");

      $wm="update galerie set fahrzeug=\"$fahrzeug\" WHERE (id=\"$galid\") LIMIT 1";
      $erg=mysql_query($wm) or die ("UpdateDB : Ein Fehler beim Aendern ist aufgetreten\nFehlerfeld: FAHRZEUG");

      $wm="update galerie set datum=\"$lastchange\" WHERE (id=\"$galid\") LIMIT 1";
      $erg=mysql_query($wm) or die ("UpdateDB : Ein Fehler beim Aendern ist aufgetreten\nFehlerfeld: LASTCHANGE");

      $wm="update users_fzg set status=\"$dbstat\" WHERE (FzgID=\"$fzgid\") LIMIT 1";
      $erg=mysql_query($wm) or die ("UpdateDB : Ein Fehler beim Aendern ist aufgetreten\nFehlerfeld: STATUS1");

      $wm="update galerie set viewable=\"$dbstat\" WHERE (id=\"$galid\") LIMIT 1";
      $erg=mysql_query($wm) or die ("UpdateDB : Ein Fehler beim Aendern ist aufgetreten\nFehlerfeld: STATUS2");

      include("navigation.php");
      ?>
      <html>
      <head>
      <title>KIA Tuning ~ Userbereich</title>
      </head>
      <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
      <body>
      <div id="rightcontent">
      <center>
      <br>
      <br>
      <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>
      <br> <br>
      <font face="verdana, arial" size="2">Änderungen wurden gespeichert.<br>
      <br> <br> <br>
      <a href="user_fzgdat.php?action=change"><img src="weiter.gif" border="0" alt="weiter"></a><br>
      </div>
      </body>
      </html>
      <?
      }
     else
      {
      include("navigation.php");
      ?>
      <html>
      <head>
      <title>KIA Tuning ~ Userbereich</title>
      </head>
      <link rel="stylesheet" type="text/css" href="kt_style.css" media="all">
      <body>
      <div id="rightcontent">
      <center>
      <br>
      <br>
      <font face="verdana, arial" size="3"><b><u>Fahrzeug Daten</u></b></font><br>
      <br> <br>
      <font face="verdana, arial" size="2" color="red">Es wurden keine Daten übertragen. Bitte benutzen Sie das Änderungsformular. Danke.<br>
      </div>
      </body>
      </html>
      <?
      }

    }
   
  }
 
?>


Wie gesagt, mit dem Firefox, geht alles ohne probleme ...

Weiss jemand woran das liegen könnte ??

HENNER

PS: habe gerade erfahren, das es bei einem benutzer trotz IE6 unter WinXP funktioniert ...
HENNER
 
Posts: 23
Joined: 07. March 2004 15:06

Postby jakimo72 » 09. June 2005 23:34

Der Internet-Explorer hat Schwierigkeiten mit einem Value-Attribut
im <input type="image" ...> Tag.
(Soweit ich weiss ist der in HTML-Standard auch nicht vorhanden)
Entweder auf <input type="submit" ...> zurückgreifen,
oder ein zusätzliches Hidden-Field einfügen.


Einige Anmerkungen hätte ich noch zu Deinem Sourcecode:
1. Exessive Nutzung von "Copy & Paste" führt zu überlangen
unwartbaren Code. Besser viele sinnvoll benannte Funktionen mit
Parametern:
z.B.
Code: Select all
function viewOption($modell1)
{
  $modelle = array("picanto" => "Picanto",
                            "pride" => "Pride",
                            "rio" => "Rio"
                            "carnival" => "Carnival I/II");
// usw.
 
  $ret = ''; // String als Returnwert
  foreach($modelle as $key => $value)
  {
     $ret .= "<option value=\"$key\" ";
     if($modell1 == $key)
       $ret .= "selected=\"selected\" ";
     $ret .= ">$value</option>";
  }
  return $ret;
}
$modell2 = viewOption($modell1);

würde bereits 2 Bildschirmseiten Deines Codes überflüssig machen...
2. Hast Du schon mal an die Verwendung von CSS nachgedacht?
schau einmal an wievielen Stellen Du z.B. bgcolor="#EFEFEF" oder
<font face="Verdana, Arial" geschrieben hast...
Einmal eine CSS-Klasse gefinieren mit Hindergrundfarbe und Font,
und schon wird Dein Code viel übersichtlicher
z.B.
Code: Select all
<style type="text/css">
.normalfarbe {background-color:#EFEFEF; font-family:Verdana,Arial,sans-serif;}
</style>
<table>
<tr>
<td class="normalfarbe">eins</td>
</tr>
</table>

3. Den HTML-Kopf könnte man schön an einer zentralen
stelle definieren. Z.B. in einer Funktion.
User avatar
jakimo72
 
Posts: 151
Joined: 07. February 2005 13:25
Location: Hamburg-Barmbek


Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests