Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

[PHP Tutorial] Ep2 IsSet [HD]


Vennom
 Share

Recommended Posts

 

Coduri:

 

* Functia ISSET:

<form action="" method="post">
<input type="submit" name="arata" value="Apasa-l">
</form>
<?php
if(isset($_POST['arata'])) {
echo "Butonul a fost apasat !";
} else {
echo "Vennom nu a apasat inca butonul !<br><br>";
}
?>

 

* Register:

<?php
echo "<i><u><h2>*Register</h2></u></i>";
//Conexiunea la baza de date
if(isset($_POST['go'])) {
$user=$_POST['user'];
$tm=time();
$reg=mysql_query("INSERT INTO isset(time, username) VALUES ('$tm', '$user')");
if($reg) {
echo "<br>Conturl tau a fost creat cu succes";
} else {
echo "<br>Contul tau nu a fost creat";
}
} else {
?>
<form action="" method="post">
Username: <input type="text" name="user" size="50" maxlength="50">
<input type="submit" name="go" value="Register">
</form>
<br><br>
<?php } ?>

 

* Login:

<?php
echo "<i><u><h2>*Login</h2></u></i>";
if(isset($_POST['login'])) {
$username=$_POST['username'];
$c=mysql_query("SELECT * FROM isset WHERE username='$username'");
$check1=mysql_num_rows($c);
$check=mysql_fetch_row($c);
$time=date('d-m-Y  h:i:s',$check[0]);
echo "<br>Bun venit $check[1]. Contul tau a fost creat pe data de $time.";
} else {
?>
<form action="" method="post">
Username: <input type="text" name="username" size="50" maxlength="50">
<input type="submit" name="login" value="Login">
</form>
<?php } ?>

 

- Conexiunea la MySQL am explicat-o in tutorialul trecut.

 

Pentru a intelege ce am scris mai sus vezi clipul !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.