Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 12:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[PHP] index.php?s=...?action geht nicht

Discussion on [PHP] index.php?s=...?action geht nicht within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
TheRzR's Avatar
 
elite*gold: 4
Join Date: Apr 2009
Posts: 1,524
Received Thanks: 603
[PHP] index.php?s=...?action geht nicht

Hey Leute,
ich habe noch ein kleines Problem mit einem Script. Undzwar ist es bei mir so, wenn sich die User anmelden muss man sie manuell freischalten. Aber wenn ich dann auf Akzeptieren drücken will, komme ich immer auf die index.php.

Kann mir einer bitte helfen :S

index.php:
PHP Code:
<?php include('header.php'); ?>
<?PHP
        
          
if(isset($_GET['s']) && !empty($_GET['s']))
          {
            if(
file_exists("./pages/".$_GET['s'].".php")) 
            {
              include(
"./pages/".$_GET['s'].".php");
            }
            else {
              include(
"./pages/home.php");
            }
          } else 
          {
            include(
"./pages/home.php");
          }
        
        
?>
<?php 
include('footer.php'); ?>
admin_usercheck.php:
PHP Code:
    <?php if((isset($_SESSION['username']))&&(isset($_SESSION['password']))){ ?>
    <?php if (($_SESSION['rank']=='4' || $_SESSION['rank']=='3'))
        {
?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">      
<h1>Anfragen</h1><br><br>
<table style="text-align: left; width: 660px;" border="0"
 cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td style="text-align: center; width: 200px; background-color: rgb(0, 0, 102);"><b>Name</b></td>
      <td style="text-align: center; width: 200px; background-color: rgb(0, 0, 102);"><b>Email</b></td>
      <td style="text-align: center; width: 202px; background-color: rgb(0, 0, 102);"><b>Bereich</b></td>
      <td style="text-align: center; width: 202px; background-color: rgb(0, 0, 102);"><b>?</b></td>
    </tr>
  </tbody>
</table>
<?php
$quete 
mysql_query("SELECT * FROM validation");
while(
$validation mysql_fetch_array($quete))
?>

<table style="text-align: left; width: 660px;" border="0"
 cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td style="text-align: center; width: 220px;"><?php echo $validation['pseudo']; ?></td>
      <td style="text-align: center; width: 220px;"><?php echo $validation['email']; ?></td>
      <td style="text-align: center; width: 220px;"><?php echo '
      <a class="content_button" href="index.php?s=usercheck&action=candid&id='
.$validation['id'].'">Infos über ihn</a> '?></td>
      <td style="text-align: center; width: 212px;"><?php echo '
      <a class="content_button" href="index.php?s=usercheck&action=accepter&id='
.$validation['id'].'">Akzeptieren</a>
      <a class="content_button" href="index.php?s=usercheck&action=refuser&id='
.$validation['id'].'">Ablehnen</a>'?>
      </td>
    </tr>
  </tbody>
</table>
<?php
}
 
if(isset(
$_GET['action']) AND isset($_GET['id']))
{
$action $_GET['action'];
if(
$action == "accepter")
{
$id $_GET['id'];
$quete2 mysql_query("SELECT * FROM validation WHERE id='$id'");
$connexion mysql_fetch_array($quete2);
$pseudo $connexion['pseudo'];
$passe $connexion['passe'];
$email $connexion['email'];
mysql_query("INSERT INTO membres VALUES ('', '$pseudo', '$passe', '$email', '1')");
echo 
"<hr /><center><b>".$pseudo." - Mitglied akzeptiert</b></center>";
mysql_query("DELETE FROM validation WHERE id='$id'");
}
elseif(
$action == "refuser")
{
$id $_GET['id'];
mysql_query("DELETE FROM validation WHERE id='$id'");
echo 
"<hr /><center><b>".$pseudo." - Mitglied abgelehnt</b></center>";
}
elseif(
$action == "candid")
{
$id $_GET['id'];
$quete3 mysql_query("SELECT * FROM validation WHERE id='$id'");
$info mysql_fetch_array($quete3);
$candid $info['candidature'];
$complement $info['complement'];
$pseudo1 $info['pseudo'];
?><br><br>
<table style="text-align: left; width: 660px;" border="0"
 cellpadding="0" cellspacing="0">
  <tbody>
  <tbody>
    <tr>
      <td style="text-align: center; width: 220px; background-color: rgb(0, 0, 200);"><b>Alles    über  <?php echo $pseudo1?></b></td>
</tr></table><br><center><?php echo $complement?></center>
<?php
}
}
?>

    <?php }
}  
?>
2tes Problem:
Wenn ich bei einem User was ändern will geht der immer auf index.php?u=1 z.b. aber er soll es so machen index.php?s=blabla&u=1

PHP Code:
<?php
/***********************
 * InventorySQL php example
 * require .jar version 0.3.2
 ***********************/
 
require 'lib/lib.mysql.php';
require 
'lib/lib.config.php';
require 
'lib/lib.items.php';

$MySQL = new SQL($host$user$pass$database);
$users $MySQL->execute("SELECT `id`, `owner` FROM `".$table."`");
$data true;
$inv_totalItems 0;
$pend_totalItems 0;
$inventory[] = array();
$pendings[] = array();
$tmp[] = array();
$index 0;$isError false;
$message '';

if(isset(
$_GET['u'])){
    
$data $MySQL->execute("SELECT * FROM `".$table."` WHERE `id`='".$MySQL->escape($_GET['u'])."';");
}else{
    
$data $MySQL->execute("SELECT * FROM `".$table."`");
}

if(isset(
$_POST['give'])) {
    if(
$_POST['item_byte'] == ''$_POST['item_byte'] = 0;
    if(
$_POST['item_count'] == ''$_POST['item_count'] = 1;
    if(!
is_numeric($_POST['item_id']) || !is_numeric($_POST['item_byte']) || !is_numeric($_POST['item_count'])) { $isError true$message 'Please enter only numbers'; }
        
$item_id intval($_POST['item_id']);
        
$item_byte intval($_POST['item_byte']);
        
$item_count intval($_POST['item_count']);
    if(
$item_id == 0) { $isError true$message 'Cannot give/remove AIR item !'; }
    if(!isset(
$_GET['u']) || !$data) { $isError true$message 'Unknown id'; }
    if(
$item_count 64) { $isError true$message 'Too many items ! Limit is 64 per stack'; }
    if(!
$isError) {
        
$dat '['.$_POST['item_action'].'('.$item_id.':'.$item_byte.')x'.$item_count.']';
        
$give $MySQL->execute("UPDATE `".$table."` SET `pendings`=CONCAT_WS(',',`pendings`,'".$MySQL->escape($dat)."') WHERE `id`='".$MySQL->escape($_GET['u'])."';");
    }
}

if(isset(
$_GET['u'])) {
    
$data $MySQL->execute("SELECT * FROM `".$table."` WHERE `id`='".$MySQL->escape($_GET['u'])."';");
    foreach (
explode(","$data[0]['inventory']) as $i) {
        if(
$i != '') {
        
preg_match("/\[([0-9]{1,2})\(([0-9]{1,3}):([0-9]{1,2})\)x(-?[0-9]{1,2})\]/"$i$matches);
                if(
$matches[2] != '0') {
                    
$inventory[$index] = array('slot' => intval($matches[1]), 'id' => intval($matches[2]), 'byte' => intval($matches[3]), 'number' => intval($matches[4]));
                    
$num intval($matches[4]);
                    if (
$num 0$inv_totalItems += $num;
                    if (
$num 0$inv_totalItems += 1;
                    
$index++;
                }
        }
    }
    
    
$index 0;
    foreach (
explode(","$data[0]['pendings']) as $i) {
        if(
$i != '') {
        
preg_match("/\[(-|\+)?\(([0-9]{1,3}):([0-9]{1,2})\)x([0-9]{1,2})\]/"$i$matches);
                if(
$matches[2] != '0') {
                    
$pendings[$index] = array('param' => $matches[1], 'id' => intval($matches[2]), 'byte' => intval($matches[3]), 'number' => intval($matches[4])); 
                    
$num intval($matches[4]);
                    if (
$num 0$pend_totalItems += $num;
                    if (
$num 0$pend_totalItems += 1;
                    
$index++;
                }
        }
    }
}

?>
<form action="" method="get">
<fieldset>
<select name="u">
<?php 
foreach ($users as $user){
    echo 
'<option value="'.$user['id'].'"';
    if(isset(
$_GET['u'])) if($_GET['u'] == $user['id']) echo 'selected="selected"';
    echo 
'>'.$user['owner'].'</option>';
}
?>
</select>
<input type="submit" value="Change"/>
</fieldset>
</form>
<?php if(isset($_GET['u']))
    if(
$data) { ?>
<h3>Inventory</h3>
<?php
echo $inv_totalItems." items in total<br />";
if(
$inv_totalItems 0) {
    echo 
'<ul>';
    foreach(
$inventory as $inv) {
        echo 
'<li><b>Slot '.$inv['slot'].'</b> : '.$items[$inv['id']].':'.$inv['byte'].' (x'.$inv['number'].')';
    }
    echo 
'</ul>';
}else{
    echo 
'<i>No items</i>';
}
?>

<h3>Pendings</h3>

<?php
echo $pend_totalItems." items in total<br />";
if(
$pend_totalItems 0) {
    echo 
'<ul>';
    
$txt '';
    foreach(
$pendings as $pend) {
        if(
$pend['param'] == '+') {
            
$txt 'Add';
        }elseif(
$pend['param'] == '-'){
            
$txt 'Remove';
        }else{
            
$txt '(error..)';
        }
        echo 
'<li><b>'.$txt.'</b> : '.$items[$pend['id']].':'.$pend['byte'].' (x'.$pend['number'].')';
    }
    echo 
'</ul>';
}else{
    echo 
'<i>No items</i>';
}
?>

<form action="" method="post">
<fieldset>
<select name="item_action">
<option value="+">add</option>
<option value="-">remove</option>
</select>
<select name="item_id">
<?php 
foreach ($items as $id => $item){
    echo 
'<option value="'.$id.'">'.$item.'</option>';
}
?>
</select>:<input type="text" maxlength="2" name="item_byte" width="2" /> number : <input type="text" maxlength="2" name="item_count" width="2" /><br />
<input type="submit" value="Give" name="give"/> <?php if($isError) echo $message?>
</fieldset>
</form>
<?php
    
}else{
        echo 
"<h2>Unknown id</h2>";
    } 
?>
Item list for minecraft <?php echo $items_version?>
Push ich habe doch noch was.
TheRzR is offline  
Old 05/05/2012, 23:34   #2
 
sava's Avatar
 
elite*gold: 1
Join Date: Dec 2006
Posts: 360
Received Thanks: 135
Zum 2ten Problem:
wird wahrscheinlich die Form mit "GET Method" sein. Dort muss du mit Hidden Feldern arbeiten. Da die Form die URL überschreibt. Also für jede Variable die du übergeben willst machste en Hiddenfield dazu.
sava is offline  
Reply


Similar Threads Similar Threads
[Longjuyt2] 1 Char Geht 2 Char geht nicht Haubtchar auch nicht
04/04/2013 - Metin2 Private Server - 11 Replies
Hallo , Also ich und nen Paar andere aus meiner gilde kommen mit ihren lowchars farm chars noob chars vk chars ALLES aber mann kommt nicht mit HAUBTCHAR REIN was ist das kann mir einer erklären was das ist ???????? danke im vorraus
Map einfügen geht nicht wegen Index File?
09/30/2011 - Metin2 Private Server - 1 Replies
Also, immer wenn ich die neue map einfüge scheitert es an der Index, ich fahre den server hoch, connected time outs, und die chs sind offline, weil die Index irgendwas nicht laden kann: SYSERR: Sep 30 19:12:11 :: LoadSettingFile: cannot open file: locale/germany/map/metin2_map_casino/Setting.txt SYSERR: Sep 30 19:12:11 :: Build: can't load file locale/germany/map/metin2_map_casino/Setting.txt in LoadSettingFile SYSERR: Sep 30 19:12:11 :: Boot: cannot load MapIndex:...
FreeBSD root user geht nicht jedoch ein normaler geht
09/05/2011 - Metin2 Private Server - 5 Replies
Ich hab einen Root Server bei mir zuhause und hab die FreeBsd Version 8.2 drauf installiert. Ohne Zusatzorgramme, wie Debian... ganz alleine FreeBSD. Er läuft nur habe ich ein problem: Mit root kann ich nicht über putty oder Filezilla zugreifen, "kritischer Fehler" Passwort ist 100% richtig. Mit einem Benutzeracc kann ich wiederum zugreifen über putty und auch über Filezilla, jedoch keine Adminaufgaben durchführen. Wo liegt das Problem? Ich habe FreeBSD schon neu installiert aber das...
[MW2]Join geht nicht/[BO]Einladung geht nicht
08/14/2011 - Call of Duty - 14 Replies
Hey ich habe eben 2 Probleme. 1. Ich kann bei einem Kontakt von mir nicht joinen bzw. gruppe machen und er nicht auch nicht bei mir. Mit allen Anderen geht alles nur der eine Kontakt funzt nicht. 2. Ich kann bei BO keine Einladungen schicken. Das Feld zum Einladung senden ist ausgeblendet (kann nicht drauf klicken) Es handelt sich hier um die Playstation 3.



All times are GMT +2. The time now is 12:28.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.