Jump to content
php.lv forumi

Password protect


-=HELLBENDER=-

Recommended Posts

session_start();
if($_POST['parole'] == 'rightīgā parole') $_SESSION['ielogojies'] = 'JĀ, $#@%!!!';
if(isset($_SESSION['ielogojies']) && $_SESSION['ielogojies'] == 'JĀ, $#@%!!!')
{
// ir ielogojies
} else {
// nav ielogojies
}

Link to comment
Share on other sites

Vinjs tagad reagjee uz visaam paroleem...

Mans login.php

 

 

<html>
<body bgcolor="black">
<font color="yellow"
<h2>Ievadi paroli!!!</h2>
<form method="POST" action="check.php">
<input type="parole" name="parole" value="Ievadi savu veelamo niku un uspied enter!">
<input type="submit" />
</form>
<p>
<a href="http://reper.oo.lv/news.php"><img src="buttons/saakums.gif"></a>
</p>

 

 

Mans check.php

 

 

<?php
session_start();
if($_POST['parole'] == 'asdasdasd') $_SESSION['ielogojies'] = 'J?, $#@%!!!';
if(isset($_SESSION['ielogojies']) && $_SESSION['ielogojies'] == 'J?, $#@%!!!')
{
// ir ielogojies
} else {
// nav ielogojies
}
?>
Welcome...

kkas ir nepareizi???

Link to comment
Share on other sites

jā!!!

 

to welcome textu liec tur kur pierakstīts komentārs ka ir ielogojies.

aa thanks :D

Kur tas buutu???

<?php

session_start();

if($_POST['parole'] == 'asdasdasd') $_SESSION['ielogojies'] = 'J?, $#@%!!!';

if(isset($_SESSION['ielogojies']) && $_SESSION['ielogojies'] == 'J?, $#@%!!!')

{ Welcome (TE????)

// ir ielogojies

} Welcome (VAI TE???) else { Welcome... ( VAI TE????)

// nav ielogojies

}

?>

A

Link to comment
Share on other sites

<?php
session_start();
if($_POST['parole'] == 'asdasdasd') $_SESSION['ielogojies'] = 'J?, $#@%!!!';
if(isset($_SESSION['ielogojies']) && $_SESSION['ielogojies'] == 'J?, $#@%!!!') {
// ir ielogojies
echo 'Nenormaali kruta - esi iekshaa...';
} else {
// nav ielogojies
  echo 'neesi ielogojies, ibio';
}
?>

Link to comment
Share on other sites

Hmm Bet kaa lai ielogojas atlasot no DB???

Piem

db raxtits person data

  шlauris3722@inbox.lvtesting

lauris3722@inbox.lv - e-pasts

testing - parole

Cerams ka saprataat :D

Itka kkas liidziigs tam scriptam bet droshi vien jaizmaina 1 vieta :D

ps. regjistreeshanos taisiiju peec shii- taka tur vajadziigs kkads ODBC kuru nemaaku ustadiit...

http://www.w3schools.com/php/php_mysql_insert.asp

protams ljoti daudzgo es izmainiiju...

Ielogoshanaas itka peec odbc (es pat nez kas ats taads ir) http://www.w3schools.com/php/php_db_odbc.asp

Edited by -=HELLBENDER=-
Link to comment
Share on other sites

×
×
  • Create New...