Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   php Hilfe (https://www.delphipraxis.net/112460-php-hilfe.html)

ecHo89 21. Apr 2008 21:30


php Hilfe
 
eingabe.html
<form method="post" action="eingabe.php">

<pre>
Name: <input type="text" name="name" size="20" maxlength="30">

</pre>
<input type="submit" name="absenden" value="Absenden">
<input type="reset" name="loeschen" value="Eingaben löschen">
</form>

eingabe.php
$name =$HTTP_POST_VARS['vorname'];
$dbzugang = mysql_connect("localhost","user","pw");
mysql_select_DB("freunde",$dbzugang);
mysql_query("INSERT INTO telefonliste (Name) VALUES ('$name'));
mysql_close($dbzugang);


ausgabe.php
$dbzugang = mysql_connect("localhost","user","pw");
mysql_select_DB("freunde",$dbzugang);
$sql = mysql_query("SELECT * FROM telefonliste",$dbzugang);
while ($attribut=mysql_fetch_row($sql)){
echo "
$attribut[0], $attribut[1], $attribut[2], $attribut[3]";}
mysql_close($dbzugang);

suchen.php (siehe eingabe.html)
$dbzugang = mysql_connect("localhost","user","pw");
mysql_select_DB("freunde",$dbzugang);
$suchname =$HTTP_POST_VARS['name'];
$sql = mysql_query("SELECT * FROM telefonliste where name like '".$suchname."%'",$dbzugang);
echo "
";
while ($attribut=mysql_fetch_row($sql)){
printf("Nr: %s
Name: %s
Vorname: %s
Telefon: %s

",
$attribut[0], $attribut[1], $attribut[2], $attribut[3]);}
mysql_close($dbzugang);

Rechnen:
$a = $_GET['a'];
$b = $_GET['b'];
$addi = $a + $b;
echo "Addition: $addi

";

Andreas L. 21. Apr 2008 21:33

Re: php Hilfe
 
1. Bitte verwende Code-Tags
2. Sag uns was nicht funktioniert und wo der Fehler auftritt!

mkinzler 21. Apr 2008 21:34

Re: php Hilfe
 
Und was ist deine Frage?


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:36 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz