Intrebari,proiecte,raspunsuri (Programare) Game !

Discutii despre tot ce nu se incadreaza in celelalte categorii.

Moderators: Moderatori ajutatori, Moderatori

User avatar
m2rkus
Fost moderator
Fost moderator
Posts: 1403
Joined: 28 Mar 2009, 13:51
Detinator Steam: Da
CS Status: BRB !
Detinator server CS: DR.eXtream.ro
SteamID: llegolas_rops
Reputatie: Membru Club eXtreamCS (2 luni)
Fost moderator
0.6 / 3 puncte
Fond eXtream: 7
Has thanked: 378 times
Been thanked: 39 times
Contact:

17 Apr 2009, 21:17

Scriptul este PHP. Functioneaza cu 2 fisiere .php:

login.php:

Code: Select all

<?php
//starteaza sesiunea
session_start();

//printeaza eroarea si deseteaza variabila de eroare
if (isset($_SESSION['error']) && strlen($_SESSION['error']>0)) {
    $error = $_SESSION['error'];
    unset($_SESSION['error']);
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://....completeaza....">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php if ($_SESSION['logged'] != 1) { ?>
    
    <!--nelogat?? avem eroare?? pprinteaza eroarea!!-->
    <?php if (strlen($error) > 0) { echo $error; } ?>

    <!--//nelogat? printeaza formularul de logare!!-->
    <form action="checker.php" method="post">
        <fieldset>
            <legend>Fromular autentificare</legend>
            
            <label for="username">Username:</label>
            <input type="text" name="username" id="username">

            <br><br>

            <label for="password">Password:</label>
            <input type="password" name="password" id="password">

            <br><br>
            
            <input type="hidden" name="action" value="login">
            <input type="submit" name="submit" value="Login">
        </fieldset>
    </form>

<?php } else { ?>
    <!-- Autentificat, sa ii uram bun venit -->
    Esti autentificat ca <?php $_SESSION['username']; ?>. Bine ai venit!

<?php } ?>

</body>
</html>
checker.php:

Code: Select all

<?php
    session_start();
    if (isset($_POST['action']) && $_POST['action'] == 'login') {
        //avem toate datele???
        if (!isset($_POST['username']) || !isset($_POST['passwrod'])) {
            $_SESSION['error'] = 'Campuri necesare lipsa!';
            header('location: login.php');    
        } else {
            //verificam in baza de date
            $q = 'SELECT * FROM users WHERE username=\'' . $_POST['username'] . '\' && password=\'' . md5($_POST['password']) . '\'';
            $r = mysql_query($q);

            if (mysql_num_rows($r) == 0) {
                $_SESSION['error'] = 'Username sau parola incorecte!';
                header('location: login.php');
            } else {
                //totul e ok, hai sa il logam pe nenea utilizatorul
                $res = mysql_fetch_array($r);

                $_SESSION['logged'] = 1;
                $_SESSION['username'] = $res['username'];
                $_SESSION['uid'] = $res['id'];

                header('location: login.php');
            }
            
        }    

    }



?>
www.4Metin.ro - Servere Metin2, Tutoriale Metin2, Clienturi, Resurse, Concursuri, Discutii
RoyalServer
User avatar
TIO
Fost moderator
Fost moderator
Posts: 1196
Joined: 26 Oct 2008, 09:48
Detinator Steam: Da
CS Status: Minunat.
Detinator server CS: Nu am
Reputatie: Fost moderator
Nume anterior : kg_kinder , Acid Burn
Location: Cluj
Has thanked: 19 times
Been thanked: 22 times

17 Apr 2009, 23:02

Corect
7 Un script care afişează un text.(JavaScript)
User avatar
dRuNNNk
Membru, skill +1
Membru, skill +1
Posts: 129
Joined: 13 Dec 2008, 18:36
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Reputatie: Ban permanent .
(Ban scos de 1 mai!)
Has thanked: 1 time
Been thanked: 12 times
Contact:

18 Apr 2009, 00:44

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JavaScript</title>
</head>

<body>
<script language="JavaScript" type="text/javascript">
document.write("JavaScript")
</script>
</body>
</html>
:-?
User avatar
TIO
Fost moderator
Fost moderator
Posts: 1196
Joined: 26 Oct 2008, 09:48
Detinator Steam: Da
CS Status: Minunat.
Detinator server CS: Nu am
Reputatie: Fost moderator
Nume anterior : kg_kinder , Acid Burn
Location: Cluj
Has thanked: 19 times
Been thanked: 22 times

18 Apr 2009, 12:40

Corect
8 Siteul
| Afiseaza codul
DanPuric.ro
are XSS?
User avatar
dRuNNNk
Membru, skill +1
Membru, skill +1
Posts: 129
Joined: 13 Dec 2008, 18:36
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Reputatie: Ban permanent .
(Ban scos de 1 mai!)
Has thanked: 1 time
Been thanked: 12 times
Contact:

18 Apr 2009, 13:56

XSS
:)

si mai este si la
/cauta.php
/editorial_detaliu.php
/text_detaliu.php
/video_detaliu.php
:) deci are vulnerabilitati :)
User avatar
TIO
Fost moderator
Fost moderator
Posts: 1196
Joined: 26 Oct 2008, 09:48
Detinator Steam: Da
CS Status: Minunat.
Detinator server CS: Nu am
Reputatie: Fost moderator
Nume anterior : kg_kinder , Acid Burn
Location: Cluj
Has thanked: 19 times
Been thanked: 22 times

18 Apr 2009, 14:22

Corect
9 O animatie in Visual basic
User avatar
dRuNNNk
Membru, skill +1
Membru, skill +1
Posts: 129
Joined: 13 Dec 2008, 18:36
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Reputatie: Ban permanent .
(Ban scos de 1 mai!)
Has thanked: 1 time
Been thanked: 12 times
Contact:

18 Apr 2009, 14:34

Code: Select all

Private Sub tmrMove_Timer()
    DistToMove = DistToMove - MOVE_OFFSET
    If DistToMove <= 0 Then
        CurX = NewX
        CurY = NewY
        tmrMove.Enabled = False
    Else
        CurX = CurX + Dx
        CurY = CurY + Dy
    End If

    DrawPicture
End Sub
alta idee n-am
User avatar
TIO
Fost moderator
Fost moderator
Posts: 1196
Joined: 26 Oct 2008, 09:48
Detinator Steam: Da
CS Status: Minunat.
Detinator server CS: Nu am
Reputatie: Fost moderator
Nume anterior : kg_kinder , Acid Burn
Location: Cluj
Has thanked: 19 times
Been thanked: 22 times

18 Apr 2009, 14:52

Prea simpla.. /:) Mai astept .
User avatar
dRuNNNk
Membru, skill +1
Membru, skill +1
Posts: 129
Joined: 13 Dec 2008, 18:36
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Reputatie: Ban permanent .
(Ban scos de 1 mai!)
Has thanked: 1 time
Been thanked: 12 times
Contact:

18 Apr 2009, 15:55

Code: Select all

Private Sub cmdDirection_Click()
  If cmdDirection.Caption = "go back" Then
    cmdDirection.Caption = "go"
    j = -60
  Else
    cmdDirection.Caption = "go back"
    j = 60
  End If
End Sub

Private Sub Form_Load()
  Set pic.Picture = LoadPicture("untitled1.bmp")
  i = 1
  j = 60
End Sub

Private Sub tmr_Timer()
  If i < 8 Then i = i + 1 Else i = 1
  If (pic.Left < Me.Width And j > 0) Or (pic.Left > 0 And j < 0) Then
    pic.Left = pic.Left + j
    Set pic.Picture = LoadPicture("cal" & i & ".bmp")
  End If
End Sub
imaginea este un cal
User avatar
MCosti
Fost moderator
Fost moderator
Posts: 2251
Joined: 28 Sep 2008, 06:58
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (2 luni)
Fost moderator
Nume anterior: DjMax
Has thanked: 139 times
Been thanked: 60 times
Contact:

18 Apr 2009, 20:15

Dim Ani1 As New Label
Dim PosX, Posy As Integer
Dim Awidth, Aheight As Integer

PosX = 300
Posy = 230
Awidth = 11
Aheight = 8

Ani1.BackColor = Color.LightSteelBlue
Ani1.ForeColor = Color.Black
Ani1.BorderStyle = BorderStyle.None
Ani1.TextAlign = ContentAlignment.MiddleCenter
Ani1.Font = New Font("Verdana", 38)
Ani1.BringToFront()
Label3.Text = "46"
Label3.BackColor = Color.Coral

For i = 1 To 255

If i >= 130 Then

Ani1.Width = Ani1.Width - 1
Ani1.Height = Ani1.Height - 1

Ani1.Width = Awidth
Ani1.Height = Aheight

Posy = Posy - 1
PosX = PosX + 1
Ani1.Location = New Point(PosX, Posy)
System.Threading.Thread.Sleep(10)
Label2.Update()
Label3.Update()
Ani1.BringToFront()

Else

Awidth = Awidth + 1
Aheight = Aheight + 1

Ani1.Width = Awidth
Ani1.Height = Aheight
Me.Controls.Add(Ani1)

Posy = Posy - 1
PosX = PosX + 1
Ani1.Location = New Point(PosX, Posy)
System.Threading.Thread.Sleep(12)
Ani1.BringToFront()
Refresh()
End If
Next

Me.Controls.Remove(Ani1)
Label3.Text = "$$"
Label3.BackColor = Color.LawnGreen
Post Reply

Return to “Discutii generale”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot], Nanu, Semrush [Bot] and 217 guests