eternitysoft
Mitglied
Hallo ^^
also ich habe folgendes Problem
Ich habe mit hilfe ein Ordnugssystem gescriptet was die Werte einer Tabelle auf Seiten aufteilen soll und mann dann selber wählen kann nach was sie sortiert werden
erstmal ein Link
http://www.rpgstation.de/downloadscript/test3.php?subp=1
so das Problem ist das wenn man das Formular anklickt (also auf ok)
er dann wieder auf test3.php anstatten auf test3.php?subp=1(2 oder 3 eben die Seite auf er er ist)geht das ist das erste prob das 2. ist das keine Seitenlinks ausgegeben werden hier mal der code
die aller erste function war nur zum debuggen da wie gesagt habe es mit hilfe (also mit nachfragen )gecodet und bzw aber momentan keine Zeit mit ihm gefunden es mal anzugucken bzw hat er den fehler auch noch nicht endeckt was das formular angeht hoffe es kann mir hier jemand weiterhelfen
mfg
also ich habe folgendes Problem
Ich habe mit hilfe ein Ordnugssystem gescriptet was die Werte einer Tabelle auf Seiten aufteilen soll und mann dann selber wählen kann nach was sie sortiert werden
erstmal ein Link
http://www.rpgstation.de/downloadscript/test3.php?subp=1
so das Problem ist das wenn man das Formular anklickt (also auf ok)
er dann wieder auf test3.php anstatten auf test3.php?subp=1(2 oder 3 eben die Seite auf er er ist)geht das ist das erste prob das 2. ist das keine Seitenlinks ausgegeben werden hier mal der code
PHP:
<?
function error_msg($a, $b, $c, $d)
{
die("$a<br>$b<br>$c - $d");
}
include ('inc/db_inc.php');
//---------------------------------------------------------------
$per_page = "1";
$sql = mysql_connect ($adresse,$name,$pw);
if (!$sql) {
die('Verbindung nicht möglich : ' . mysql_error());
}
$db = mysql_select_db ("usr_web51_1");
function pagination($pages, $subp, $link)
{
$return = (($subp - '4') >= '1' ? '<a href="' . str_replace('{P}', '1', $link) . '">1</a> ... ' : '');
$return .= (($subp - '3') >= '1' ? '<a href="' . str_replace('{P}', ($subp - '3'), $link) . '">' . ($subp - '3') . '</a> ' : '');
$return .= (($subp - '2') >= '1' ? '<a href="' . str_replace('{P}', ($subp - '2'), $link) . '">' . ($subp - '2') . '</a> ' : '');
$return .= (($subp - '1') >= '1' ? '<a href="' . str_replace('{P}', ($subp - '1'), $link) . '">' . ($subp - '1') . '</a> ' : '');
$return .= '[ ' . $subp . ' ] ';
$return .= (($subp + '1') <= $pages ? '<a href="' . str_replace('{P}', ($subp + '1'), $link) . '">' . ($subp + '1') . '</a> ' : '');
$return .= (($subp + '2') <= $pages ? '<a href="' . str_replace('{P}', ($subp + '2'), $link) . '">' . ($subp + '2') . '</a> ' : '');
$return .= (($subp + '3') <= $pages ? '<a href="' . str_replace('{P}', ($subp + '3'), $link) . '">' . ($subp + '3') . '</a> ' : '');
$return .= (($subp + '4') <= $pages ? '... <a href="' . str_replace('{P}', $pages, $link) . '">' . $pages . '</a> ' : '');
return $return;
};
?>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<input type="hidden" name="subp" value="<?= $_REQUEST['id'] ?>">
Sortieren nach:<select name="sort" class="Auswahl" size="1">
<option value="date">Datum</option>
<option value="author">Autor</option>
<option value="name">Name</option>
<option value="difficultly">Schwierigkeit</option>
</select><select name="order" class="Auswahl" size="1">
<option value="ASC">aufsteigend</option>
<option value="DESC">Absteigend</option>
</select><br>
<input type="submit" name="button" value=" OK ">
<?
if ($button==" OK ") {
$abfrage = "SELECT count(`id`) FROM `tutorials`;";
$result = mysql_query($abfrage);
$count = mysql_fetch_row($result);
$pages = ceil($count['0'] / $per_page);
$start = $subp * $per_page - $per_page;
$subp = ($_REQUEST['subp'] >= '1' ? $_REQUEST['subp'] : '1');
$sql2 = "SELECT * FROM `tutorials` ORDER BY `" . $sort . "` " . $order . " LIMIT " . $start . ", " . $per_page . ";";
$ergebnis = mysql_query($sql2);
echo "<table width=\"100%\" border=\"1\">";
while ($row = mysql_fetch_object($ergebnis))
{
echo '
<tr>
<td width=\"50%\">' . $row->name . '</td><td width=\"50%\">' . $row->date . ' </td>
<tr>
<td>' . $row->description . '<BR> <b>Schwierigskeitgrad:' . $row->difficultly . '</b> </td>
</tr>
<tr>
<td width=\"25%\">' . $row->author . '</td><td width=\"75%\">ICQ:' . $row->icq . ', MSN:' . $row->msn .
' Email: ' . $row->email . '</td></tr><tr><td> <a href="' . $row->link . '"> Link </a>'.
'</td></tr>';
}
echo ' </td></tr> </table>';
}
else {
$abfrage = "SELECT count(`id`) FROM `tutorials`;";
$result = mysql_query($abfrage);
$count = mysql_fetch_row($result);
$pages = ceil($count['0'] / $per_page);
$start = $subp * $per_page - $per_page;
$subp = ($_REQUEST['subp'] >= '1' ? $_REQUEST['subp'] : '1');
$sql2 = "SELECT * FROM `tutorials` LIMIT " . $start . ", " . $per_page . ";";
$ergebnis = mysql_query($sql2);
echo "<table width=\"100%\" border=\"1\">";
while ($row = mysql_fetch_object($ergebnis))
{
echo '
<tr>
<td width=\"50%\">' . $row->name . '</td><td width=\"50%\">' . $row->date . ' </td>
<tr>
<td>' . $row->description . '<BR> <b>Schwierigskeitgrad:' . $row->difficultly . '</b> </td>
</tr>
<tr>
<td width=\"25%\">' . $row->author . '</td><td width=\"75%\">ICQ:' . $row->icq . ', MSN:' . $row->msn .
' Email: ' . $row->email . '</td></tr><tr><td> <a href="' . $row->link . '"> Link </a>'.
'</td></tr>';
}
echo ' </td></tr> </table>';
};
?>
mfg
Zuletzt bearbeitet: