visionsign
Mitglied
Hi, ich habe mir ein kleines adressbuch gebaut.
So, hier stehen ja ALLE kontakte untereinander. Ich möchte jetzt oben eine leiste haben mit:
"alle | a | b | c...." wenn ich dann "a" anklicke dass ich nur alle namen bekomme die mit "a" anfangen, WIE GEHT DAS. Kann mir jemand das script so umschreiben und dann posten?
Code:
<?php
include 'include/config.inc.php';
?>
<?php
function delete(){ mysql_query("DELETE FROM group_contact WHERE ID='$_REQUEST[id]'");}
if($_REQUEST[action] == "delete"){ echo delete();}
?>
<a href="./index.php?site=add_contact">Neuen Kontakt hinzufügen</a><br>
<a href="./index.php?site=edit_contact">Kontakt bearbeiten</a>
<?
$resid = mysql_query ("SELECT * FROM group_contact ORDER BY name");
while ($record = mysql_fetch_array ($resid, MYSQL_ASSOC))
{
$ID ="$record[ID]"."<br>\n";
$firma ="$record[firma]"."<br>\n";
$position ="$record[position]"."<br>\n";
$name ="$record[name]"."<br>\n";
$vorname ="$record[vorname]"."<br>\n";
$str ="$record[str]"."<br>\n";
$plz ="$record[plz]"."<br>\n";
$ort ="$record[ort]"."<br>\n";
$tel ="$record[tel]"."<br>\n";
$fax ="$record[fax]"."<br>\n";
$mobil ="$record[mobil]"."<br>\n";
$email ="$record[email]"."<br>\n";
$www ="$record[www]"."<br>\n";
echo "
<div id=\"content_dyn\">
<table width=\"330px\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"3\">
<tr>
</td>
<td width=\"300px\">
<b> $firma </b>
$position
$name
$vorname
$str
$plz
$ort
$tel
$fax
$mobil
$email
$www
</td>
<td valign=top width=\"30px\">
<a href=\"".$_SERVER["SCRIPT_NAME"]."?site=".$_REQUEST["site"]."&action=delete&id=".$ID."\">löschen</a>
</td>
</div>
</tr>
</table>
</div> " ;
}
?>
So, hier stehen ja ALLE kontakte untereinander. Ich möchte jetzt oben eine leiste haben mit:
"alle | a | b | c...." wenn ich dann "a" anklicke dass ich nur alle namen bekomme die mit "a" anfangen, WIE GEHT DAS. Kann mir jemand das script so umschreiben und dann posten?