Jump to content
php.lv forumi

Flash PHP


Chupakabra

Recommended Posts

Sobrid esmu jau ticis tik talu ka registracija tiek izpildita un pat saglabajas datubazelough.gif Prieks manim tas jau ir daudz.
Tagad vel viena maza problemina.Kads varetu pierakstit pareizo rindinu(trukstoso)
 

 

on (release) {
     if(username.length >= 6 && pass.length >= 6){
        loadVariablesNum("register.php", 0, "POST");
     }else{
        _root.words = "Username must have between 6 and 12 characters.";
    }
}

Seit jau taka ir skaidrs.Kods ko esmu ierkastijis poga.Pietrukst rindina lai pec si izpildisanas ja ir ok tiek izpildita komanda

 

 

on (release)
{
    _root.gotoAndPlay("freima nosaukums");
}

Ka to pareizi savienot kopa?

Izmantots ActionScript 2
Link to comment
Share on other sites

Un vel dazi jautajumi...

 

Sobrid uzspiezot ok datubaze tiek saglabats tikai lietotaja vards un parole ka pareizi panakt to lai tiek saglabats ari limenis un speletaja "stati"?

 

Un otrs ka pareizi ievadot login informaciju izsaukt parbaudi no datubazes pa speletaja limeni un "statiem" un atcereties izmainas?Pagaidam lietoju sadu kodu.

LOGIN.PHP

 

 

<?php
mysql_connect("localhost","root","") or die();
mysql_select_db("datubaze") or die();

$check = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."'")or die();

$check2 = mysql_num_rows($check);
if ($check2 == 0) {
print "words=User doesn't exist.&checklog=3";
die();
}
while($info = mysql_fetch_array( $check ))
{

if ($_POST['pass'] != $info['password']) {
print "words=Incorrect Password.&checklog=4";
die();
}else
{
print "words=You are logged in.&checklog=5";
die();
}
}

?>

 

REGISTER.PHP

 

 

<?php
mysql_connect("localhost","root","") or die();
mysql_select_db("datubaze") or die();  

$usercheck = $_POST['username'];
$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")
or die();

$check2 = mysql_num_rows($check);
if ($check2 != 0) {
print "words=Username already exists.&checklog=1";
die();
}

$insert = "INSERT INTO users (username, password)
VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
$add_member = mysql_query($insert);
print "words=You are registered.&checklog=2";
die();
?>
Edited by aaxc
Link to comment
Share on other sites

ka pareizi panakt to lai tiek saglabats ari limenis un speletaja "stati"?

Labo šo kveriju:

$insert = "INSERT INTO users (username, password)
VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
Ja stati glabājas citā tabulā, pēc šī kverija pievieno citu, kurš saglabā status.

 

ka pareizi ievadot login informaciju izsaukt parbaudi no datubazes pa speletaja limeni un "statiem" un atcereties izmainas?

Kāda pārbaude? Kādi stati? Ko atcerēties? Edited by jurchiks
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...