Résolu Problème (SQL?)

Statut
N'est pas ouverte pour d'autres réponses.

ta tante.

The King.
Premium
Inscription
27 Janvier 2013
Messages
3 112
Réactions
721
Points
4 000
RGCoins
0
Salut à tous,

J'ai codé une page de login et tous ez ez (pour @Sethy ) et bien il ya .

Code source tu register.php :
PHP:
<?php
    include_once("config.php");
?>

<?php if( !(isset( $_POST['register'] ) ) ) { ?>


<!DOCTYPE html>
<html>
    <head>
        <title>Sethy Modding</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
   
    <body>
        <header id="head" >
            <p>Sethy Modding</p>
            <p><a href="register.php"><span id="register">Register</span></a></p>
        </header>
       
        <div id="main-wrapper">
            <div id="register-wrapper">
                <form method="post">
                    <ul>
                        <li>
                            <label for="usn">Username : </label>
                            <input type="text" id="usn" maxlength="30" required autofocus name="username" />
                        </li>
                   
                        <li>
                            <label for="passwd">Password : </label>
                            <input type="password" id="passwd" maxlength="30" required name="password" />
                        </li>
                       
                        <li>
                            <label for="conpasswd">Confirm Password : </label>
                            <input type="password" id="conpasswd" maxlength="30" required name="conpassword" />
                        </li>
                        <li class="buttons">
                            <input type="submit" name="register" value="Register" />
                            <input type="button" name="cancel" value="Cancel" onclick="location.href='index.php'" />
                        </li>
                   
                    </ul>
                </form>
            </div>
        </div>
   
    </body>
</html>

<?php
} else {
    $usr = new Users;
    $usr->storeFormValues( $_POST );
   
    if( $_POST['password'] == $_POST['conpassword'] ) {
        echo $usr->register($_POST);   
    } else {
        echo "Password and Confirm password not match";   
    }
}
?>

Je ne sais pas si c'est par a port à la SQL ou au PHP

Merci. <3

Skrayze.
 
Dernière édition:
PHP:
<?php
    include_once("config.php");
?>

<?php if( !(isset( $_POST['register'] ) ) ) { ?>


<!DOCTYPE html>
<html>
    <head>
        <title>Sethy Modding</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
  
    <body>
        <header id="head" >
            <p>Sethy Modding</p>
            <p><a href="register.php"><span id="register">Register</span></a></p>
        </header>
      
        <div id="main-wrapper">
            <div id="register-wrapper">
                <form method="post">
                    <ul>
                        <li>
                            <label for="usn">Username : </label>
                            <input type="text" id="usn" maxlength="30" required autofocus name="username" />
                        </li>
                  
                        <li>
                            <label for="passwd">Password : </label>
                            <input type="password" id="passwd" maxlength="30" required name="password" />
                        </li>
                      
                        <li>
                            <label for="conpasswd">Confirm Password : </label>
                            <input type="password" id="conpasswd" maxlength="30" required name="conpassword" />
                        </li>
                        <li class="buttons">
                            <input type="submit" name="register" value="Register" />
                            <input type="button" name="cancel" value="Cancel" onclick="location.href='index.php'" />
                        </li>
                  
                    </ul>
                </form>
            </div>
        </div>
  
    </body>
</html>

<?php
} else {
    $usr = new Users;
    $usr->storeFormValues( $_POST );
  
    if( $_POST['password'] == $_POST['conpassword'] ) {
        echo $usr->register($_POST);  
    } else {
        echo "Password and Confirm password not match";  
    }
}
?>

Ligne 5 :
PHP:
<?php if(!isset( $_POST['register'])) { ?>


Ensuite, c'est en POO, j'ai pas encore abordé ce côté du langage :s
 
Statut
N'est pas ouverte pour d'autres réponses.
Retour
Haut