Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
php?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
edgar



Joined: 28 Dec 2003
Posts: 916
Location: Pred monitorom

PostPosted: 03.03.2004 18:16    Post subject: php? Add user to your forum ignore list Reply with quote

šta ovdje ne valja?

Code:


<?php

if(!isset($name) && !isset($password))
{
?>
<h1>Please Log In</h1>
This page is secret.
<form method="get" action="index.php">
<table border = "1">
<tr>
<th> username </th>
<td><input type = "text" name = "name"></td>
</tr>
<tr>
<th> password </th>
<td><input type = "password" name ="password" ></td>
</tr>
<tr>
<td colspan = "2" align = "center">
<input type = "submit" value = "log in">
</td>
</tr>
</table>
</form>
<?
}
else if($name=='user'&& $password=='pass')
{
    echo "<h1>in!</h1>";
}
else
{
    echo "go away!";
}

?>
[/i]

_________________
Digital Genetics | Koote | Nuspojava
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
orange



Joined: 21 Sep 2003
Posts: 622
Location: ST

PostPosted: 03.03.2004 18:22    Post subject: Add user to your forum ignore list Reply with quote

sta tebi uopce treba?

_________________
pwned!
Back to top
View user's profile Send private message Send e-mail
edgar



Joined: 28 Dec 2003
Posts: 916
Location: Pred monitorom

PostPosted: 03.03.2004 18:27    Post subject: Add user to your forum ignore list Reply with quote

ma to je testiranje logina sta mi je nekad radio...

ja lijepo stavim tu taj kod (iscupan je iz ostatka, ali nema veze) i trebalo bi radit po svoj logici koju znam.

index.php sam sebe poziva i provjerava jesu li postane varijable name i password. ako nisu onda ih pita, ako jesu onda je ok i provjeri jel tocno ili ne.

e sad, problem je sto govno svaki put misli da varijable nisu postane i svaki put pita da unesem....


fucktard!

_________________
Digital Genetics | Koote | Nuspojava
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
orange



Joined: 21 Sep 2003
Posts: 622
Location: ST

PostPosted: 03.03.2004 18:28    Post subject: Add user to your forum ignore list Reply with quote

ono sve sta je izvan <? ?> ce se svaki put izvrsit
i ja mislim da ne mozes ovim varijablama samo tako pristupit...

_________________
pwned!
Back to top
View user's profile Send private message Send e-mail
edgar



Joined: 28 Dec 2003
Posts: 916
Location: Pred monitorom

PostPosted: 03.03.2004 18:33    Post subject: Add user to your forum ignore list Reply with quote

orange wrote:
ono sve sta je izvan <? ?> ce se svaki put izvrsit
i ja mislim da ne mozes ovim varijablama samo tako pristupit...


nece...

_________________
Digital Genetics | Koote | Nuspojava
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 03.03.2004 18:34    Post subject: Add user to your forum ignore list Reply with quote

probaj s ovim:

Code:
<?php

if(!isset($_POST['name']) && !isset($_POST['password']))
{
?>
<h1>Please Log In</h1>
This page is secret.
<form method="get" action="index.php">
<table border = "1">
<tr>
<th> username </th>
<td><input type = "text" name = "name"></td>
</tr>
<tr>
<th> password </th>
<td><input type = "password" name ="password" ></td>
</tr>
<tr>
<td colspan = "2" align = "center">
<input type = "submit" value = "log in">
</td>
</tr>
</table>
</form>
<?
}
else if($_POST['name']=='user' && $_POST['password']=='pass')

    echo "<h1>in!</h1>";
}
else
{
    echo "go away!";
}

?>


ili ostavi ovo svoje, a u php-u upali register globals.
u php.ini nadji register_globals i stavi register_globals on ili u .htaccess dodaj php_flag register_globals on

Last edited by maxy on 03.03.2004 18:35; edited 1 time in total
Back to top
View user's profile Send private message
orange



Joined: 21 Sep 2003
Posts: 622
Location: ST

PostPosted: 03.03.2004 18:35    Post subject: Add user to your forum ignore list Reply with quote

edgar wrote:
nece...


ok Smile

_________________
pwned!
Back to top
View user's profile Send private message Send e-mail
edgar



Joined: 28 Dec 2003
Posts: 916
Location: Pred monitorom

PostPosted: 03.03.2004 18:35    Post subject: Add user to your forum ignore list Reply with quote

ma sjetio sam se...

$_POST['password']


fucktard....


never mind...

===
edit: zaboravio sam stavit globalse- tukac:) ; kad stalno neki vrag reinstaliram.. malo apache malo iis... grrr! Evil or Very Mad

tnx maxy. A taman sam se sjetio stavit $_POST:)

_________________
Digital Genetics | Koote | Nuspojava
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group