<b>REGISTER</b>

GFX-Sector - PHP und MySQL Tutorials


 
GFX-Sector » Coding Area » Coding-Tutorials » PHP und MySQL Tutorials » [PHP/MySQL] PHP: If-Abfrage » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites

PHP und MySQL Tutorials

Tutorials über die serverseitige Programmierung mit PHP und der Datenbank MySQL
Post New Thread Post Reply

PHP: If-Abfrage

     Deutsche Version  English version
Author
Post « Previous Thread | Next Thread »

.Nail
Fingerwischer


.Nail hat kein Avatar

Registration Date: 14.11.2007
Posts: 27
Program: Photoshop

Spacer
PHP: If-Abfrage

PHP: If-Abfrage

      

Hallo ich erkläre euch wie die If-Abfrage geht...

aks erstes machen wir ein Formular...

mit

Benutzername(user)

Passowort(pw)

und den Login Button.
(form = check.php)

so jetzt kommen wir zum script

<?php //so fängt das php script an

$user = $_POST[user]; //die abfrage vom Forumlar

$pw = $_POST[pw]; //das gleiche

jetzt kommt die if abfrege if($user = "der benutzername" AND man kann auch OR oder XOR einsetzen AND bestimmt das alle beide richtig sein müssen OR eins von beiden doch bei XOR mus das entweder das(bei 3 formularen)

if($user = "der benutzername" AND $pw = "passswort")
{
echo"text wenn der benutzer erfolgreich eingeloggt ist";
}
else
{
echo"text wenn dei angaben false waren";
}

?>

script ende ich hoffe das hat anfängern geholfrn


MfG .Nail

This post has been edited 1 time(s), it was last edited by .Nail: 15.11.2007 20:25.

PHP: If-Abfrage 15.11.2007 15:55 .Nail is offline Search for Posts by .Nail

|~Râdîant~| |~Râdîant~| is a male
Polygonmeister


Avatar von |~Râdîant~|

Registration Date: 15.04.2007
Posts: 778
Location: Berlin
Program: Adobe Photoshop CS4
Deviantart: radiantgfx

Spacer

RE: If-Abfrage

      

quote:
Original von .Nail
...

$pw = $_POST[pw]; //das gleiche

...

if($user = "der benutzername" AND $pass = "passswort")
...


In der if-Abfrage müsste es auch $pw heißen.



PHP: If-Abfrage 15.11.2007 16:19 |~Râdîant~| is offline Search for Posts by |~Râdîant~|

.Nail
Fingerwischer


.Nail hat kein Avatar

Registration Date: 14.11.2007
Posts: 27
Program: Photoshop

Thread Starter Thread Started by .Nail
Spacer
      

glatt übersehn sry danke war wo anders Wink

PHP: If-Abfrage 15.11.2007 20:24 .Nail is offline Search for Posts by .Nail

Babbsdrebbler
Weichzeichner


Babbsdrebbler hat kein Avatar

Registration Date: 14.03.2007
Posts: 51

Spacer
      

$_POST['pw'] so isses richtig

Undzwar deswegen:
http://de2.php.net/manual/de/language.types.array.php

PHP: If-Abfrage 17.11.2007 19:30 Babbsdrebbler is offline Search for Posts by Babbsdrebbler

.Nail
Fingerwischer


.Nail hat kein Avatar

Registration Date: 14.11.2007
Posts: 27
Program: Photoshop

Thread Starter Thread Started by .Nail
Spacer
      

nein eben nicht das is falsch probiers doch selber lad dir xampp runter und teste o.O


arrays sind anders o.O

This post has been edited 1 time(s), it was last edited by .Nail: 18.11.2007 13:48.

PHP: If-Abfrage 18.11.2007 13:48 .Nail is offline Search for Posts by .Nail

Babbsdrebbler
Weichzeichner


Babbsdrebbler hat kein Avatar

Registration Date: 14.03.2007
Posts: 51

Spacer
      

Ich habe xampp und bei mir gehts. großes Grinsen

Und was meinste wohl was das ist?
Sowohl POST als auch GET sind Arrays von den anderen ganz zu schweigen.

http://de3.php.net/manual/de/reserved.va....variables.post

code:
1:
2:
3:
4:
<?php
print_r($_GET);                  
?>


ergibt:
Array ( [lol] => muhaha )

Wenn man http://localhost/datei.php?lol=muhaha ausprobiert.

PHP: If-Abfrage 18.11.2007 20:24 Babbsdrebbler is offline Search for Posts by Babbsdrebbler

Mr. Tool Mr. Tool is a male
Pfadfinder

Spender


Mr. Tool hat kein Avatar

Registration Date: 17.06.2007
Posts: 531
Location: Österreich
Program: Photoshop CS2
Deviantart: verel

Spacer
      

wobei ich glaube das man die eifnachen anführungszeichen nur bei strings benötigt bei so sachen wie integer oder boolean gehts glaub ich auch ohne hab ich jetzt aber ned getestet



PHP: If-Abfrage 18.11.2007 23:31 Mr. Tool is offline Homepage of Mr. Tool Search for Posts by Mr. Tool
 
Spacer
   
GFX-Sector
unregistered


 hat kein Avatar


Spacer

Have you enjoyed this topic?


If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.

After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.

In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.

Sign up now and enjoy the advantages as a registered member.

(This website will be ad-free after a complete free sign up.)

New Post 18.11.2007 23:31  
Tree Structure | Board Structure
Post New Thread Post Reply
GFX-Sector » Coding Area » Coding-Tutorials » PHP und MySQL Tutorials » [PHP/MySQL] PHP: If-Abfrage

Similar topics to PHP: If-Abfrage
Thread
Suche phpBB2 Style (Forum: Archiv)
HTML-Datei mit php auslesen und Zeilenumbrüche entfernen (Forum: PHP, MySQL)
Suche jemand der ein Gewinn Script in .php Codet (Forum: PHP, MySQL)
[Suche] PHP-Coder (Forum: Angebote und sonstige Anfragen)
[PHP/MySQL] [PHP+HTML] Kontaktformular [Anfänger] (Forum: PHP und MySQL Tutorials)