Poslao: 12 Apr 2007 19:52
|
offline
- Pridružio: 30 Sep 2006
- Poruke: 137
|
This is the problem.
I wroted a script for user authentication before 10 days and every thing was OK. If the username and password was correct you are redirected to the Logged.php page, if not you are redirected to the main page.
Now i open this page, and typed the username and the password, and now it's says that the username and password are wrong.
I dont know what to do now.
Also before a year i was writing a static html page and making some modification, but when i run the page there was the same page(without modification).Then i m going to another computer, running the same page, and now i got the page with modifications.
Anybody know what is this?
|
|
|
Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
|
|
Poslao: 12 Apr 2007 22:17
|
offline
- Blood

- Ugledni građanin
- Pridružio: 26 Jul 2003
- Poruke: 384
- Gde živiš: Beograd
|
The second problem is cache, you should clear cache when you make some modifications.
The first problem...are you sure that you didn`t forget your username/password?
|
|
|
|
Poslao: 13 Apr 2007 16:45
|
offline
- Pridružio: 30 Sep 2006
- Poruke: 137
|
first-How to clear the cache?
second- i found the mistake, it's ok now
Dopuna: 13 Apr 2007 16:45
Another problem.
I made a small forum, and when i fill the form with a topic and a question, everything is ok.When i click submit it redirected me to the page with New topics.Now if i click refresh it pop up's a window ..."The page you are trying to view contains POSTDATA......"..if i click OK it gives me another topic with the same name, so if the first topic is "What is this" , when i click refresh i get another topic with the same name......can any one explain me this? Is the same thing with the cache?.
I try google but i dont know how to search for this problem
|
|
|
|
Poslao: 14 Apr 2007 00:26
|
offline
- Rastafarii

- Moderator foruma
- Pridružio: 22 Mar 2006
- Poruke: 3760
- Gde živiš: 127.0.0.1
|
No, it's not related with cache
Look, when you send something via form, it uses POST method to transfer data from form to page who process it... and when you hit the REFRESH button on the page where form sends data, you are warned that there is some POSTDATA in the page (data you sent from form), and when you click OK it process it again, like you filled same form with very same data again... So, DO NOT, i mean DO NOT, HIT REFRESH button on the page where form redirected you
And how to clear a cache? In IE, click Tools, Internet Options, Delete Files... And to make sure that this wont happen again, click Settings in the same window (Tools -> Internet Options) and select "Every visit to the page". I dont know by heart how to clear it in FF, maybe because FF deals with updated pages much better than IE... I'll check later
|
|
|
|
Poslao: 14 Apr 2007 03:12
|
offline
- Pridružio: 30 Sep 2006
- Poruke: 137
|
Rastafarii ::No, it's not related with cache
Look, when you send something via form, it uses POST method to transfer data from form to page who process it... and when you hit the REFRESH button on the page where form sends data, you are warned that there is some POSTDATA in the page (data you sent from form), and when you click OK it process it again, like you filled same form with very same data again... So, DO NOT, i mean DO NOT, HIT REFRESH button on the page where form redirected you
I know that, the question was what script should i use, is it a two line script or something else, because every time when i want to refresh the page i need to click cancel.
On this forum or other when i submit the form and then refresh the page everythig is ok.
Some help or link for this....
Rastafarii ::
And how to clear a cache? In IE, click Tools, Internet Options, Delete Files... And to make sure that this wont happen again, click Settings in the same window (Tools -> Internet Options) and select "Every visit to the page". I dont know by heart how to clear it in FF, maybe because FF deals with updated pages much better than IE... I'll check later
Also i know this but i didnt know that this is the way for clearing the cache, i was thinking that there is a script for clearing the cache.
Anyway tnx
Dopuna: 14 Apr 2007 3:12
Citat:
$query="SELECT * FROM admins WHERE username='".$_POST['username']."' and password = Password('".$_POST['password']."') ";
Can anyone tell me, is there something wrong with this query?
|
|
|
|
Poslao: 15 Apr 2007 03:10
|
offline
- igor86

- Stručni saradnik
Web programiranje
- Pridružio: 24 Maj 2006
- Poruke: 1633
|
Are you sure about this
...Password('".$_POST['password']."')...
|
|
|
|
|
Poslao: 15 Apr 2007 18:04
|
offline
- igor86

- Stručni saradnik
Web programiranje
- Pridružio: 24 Maj 2006
- Poruke: 1633
|
I don't know mysql Password() function. Error is?
|
|
|
|
Poslao: 15 Apr 2007 20:26
|
offline
- Pridružio: 30 Sep 2006
- Poruke: 137
|
well that is because in mysql i use md5 encryption.
If the quesry in mysql is
create table user (ID int unsigned not null primary key auto_increment,
username varchar(20),
password varchar(20));
and the query for inserting new user using md5 should be
insert into user values(null, 'some user', Password('some password'));
then for the php script should be
........ password=password('".$_POST['password']."') ......
igor86 ::.....Error is?
there is no error, just returned "username/password is incorect" (this is from my script)
|
|
|
|
Poslao: 16 Apr 2007 01:19
|
offline
- Rastafarii

- Moderator foruma
- Pridružio: 22 Mar 2006
- Poruke: 3760
- Gde živiš: 127.0.0.1
|
RutiX ::and the query for inserting new user using md5 should be
insert into user values(null, 'some user', Password('some password'));
Did you try this?
insert into user values(null, 'some user', md5('some password'));
function Password() will work ONLY if you defined it in your PHP script, I think (I am pretty sure) that there is no function Password() in PHP... Maybe you wrote it, combining md5 with some other protection tricks, but if so, give us a code so when can help you. Otherwise, try replacing Password() with md5()
|
|
|
|