Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Problems with infusion - redirecting

Locked Asked Modified Viewed 1,634 times
W
wayan
W
wayan 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Hi out there :-)

I don't really know how to describe the problem.

I am writing an infusion for version 7 and now i come to a problem.
i got a table of users in html and i want to delete them from my sql table with a button behind the proper datasheet.

this is done and i think it will work. My problem is, that whenever i press a button an accept or decline the "are you sure you want to delete" panel, the infusion redirects me to index.php as if i don't have proper acoount rights.

sorry for my english :-)
i would appreciate your help.

here is the code from my admin panel


<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: new_infusion_admin.php
| CVS Version: 1.00
| Author: INSERT NAME HERE
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/admin_header.php";

include INFUSIONS."ik_system/infusion_db.php";

if (!checkrights("IKSS") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."ik_system/locale/".$settings['locale'].".php")) {
   // Load the locale file matching the current site locale setting.
   include INFUSIONS."ik_system/locale/".$settings['locale'].".php";
} else {
   // Load the infusion's default locale file.
   include INFUSIONS."ik_system/locale/English.php";
}

//Funktion zum löschen eines Datensatzes
echo '<script type="text/javascript">
function chkDelete(){
   submitBool = confirm("Wollen Sie den Datensatz wirklich löschen?");
   return submitBool;
}</script>'; 
 


opentable("Ikarus Stats Administration");
echo "<form method='post' action=' ".$_SERVER['PHP_SELF']."' onSubmit='return chkDelete()'>";
   echo $locale['iks_admin_opener'];

   $abfrage = dbquery("SELECT
                     iks_user_id,
                     iks_userlevel,
                     iks_besatzung,
                            iks_schild,
                            iks_panzerung,
                            iks_energie,
                            iks_speed,
                            iks_angriff,
                            iks_rolle,
                            iks_date
                  FROM ".IKS_SYSTEM);
   echo"<table border=1 width=100%>";
      echo"<tr bgcolor = '#BDD3E7'>";
         echo"<th align = 'center'>Name</th>";
         echo"<th align = 'center'>Level</th>";
         echo"<th align = 'center'>Besatzung</th>";
         echo"<th align = 'center'>Schild</th>";
         echo"<th align = 'center'>Panzerung</th>";
         echo"<th align = 'center'>Energie</th>";
         echo"<th align = 'center'>Speed</th>";
         echo"<th align = 'center'>Angriff</th>";
         echo"<th align = 'center'>Rolle</th>";
         echo"<th align = 'center'>letzte<br>Aktualisierung</th>";
         echo"<th align = 'center'>Löschen</th>";
      echo"</tr>";
   for($i=1; $eintrag=mysql_fetch_object($abfrage); $i++)
   {
      $userid = $eintrag->iks_user_id;
      $abfrageuser = dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id like $userid");
      $username = mysql_fetch_object($abfrageuser);
      if($i % 2 == 0)
      {
         echo"<tr bgcolor = '#BDD3E7'>";
      }
      else
      {
         echo"<tr bgcolor = 'white'>";
      }
         echo"<td align=center>";
            echo $username->user_name;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_userlevel;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_besatzung;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_schild;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_panzerung;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_energie;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_speed;
         echo"</td>";
         echo"<td align=right>";
            echo $eintrag->iks_angriff;
         echo"</td>";
         echo"<td align=center>";
            echo $eintrag->iks_rolle;
         echo"</td>";
         echo"<td align=center>";
            echo $eintrag->iks_date;
         echo"</td>";
         echo"<td align=center>";
            echo"<button name='delete_button[]' type='submit' value='$eintrag->iks_user_id'>
                    <img src='del.png' width='15' height='15' alt='Löschen'><br>                 
                  </button>
               ";      
         echo"</td>";
      echo"</tr>";
   }
echo"</form>";


if(isset($_POST['delete_button'])){
   $arr = $_POST['delete_button'];
 for($y = 0; $y<= count($arr);$y++){
    echo $y."hallo ich bin Button".$arr[0];
 }
}

echo '<pre>'.print_r($_POST).'</pre>';
closetable();

require_once THEMES."templates/footer.php";
?>
0 replies
There are no post found.

Labels

None yet

Statistics

  • Views 0 views
  • Posts 0 posts
  • Votes 0 votes
  • Topic users 1 member

1 participant

W
W
wayan 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet