God knows what is the problem

1

God knows what is the problem

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.
offline
  • Blood  Male
  • 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?



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

offline
  • PHP developer
  • Pridružio: 22 Mar 2006
  • Poruke: 3688
  • Gde živiš: 127.0.0.1

No, it's not related with cache Smile

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 Smile

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 Smile

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

Rastafarii ::No, it's not related with cache Smile

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 Smile

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 Smile


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?

offline
  • igor86  Male
  • Stručni saradnik
    Web programiranje
  • Pridružio: 24 Maj 2006
  • Poruke: 1633

Are you sure about this

...Password('".$_POST['password']."')...

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

why is there something wrong?
I copy that from a site

offline
  • igor86  Male
  • Stručni saradnik
    Web programiranje
  • Pridružio: 24 Maj 2006
  • Poruke: 1633

I don't know mysql Password() function. Error is?

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)

offline
  • PHP developer
  • Pridružio: 22 Mar 2006
  • Poruke: 3688
  • 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() Smile

Ko je trenutno na forumu
 

Ukupno su 730 korisnika na forumu :: 35 registrovanih, 6 sakrivenih i 689 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: _Sale, A.R.Chafee.Jr., amstel2, Deneb, Doca, gasha, gile58, Insan, ivan979, ivica976, kolateralnasteta, krlebgd77, Kruger, kuntalo, kybonacci, mane123, MarKhan, Marko Marković, Markoni29, MIg, mushroom, Neutral-M, ozzy, Panonsky, RJ, sakota79, saputnik plavetnila, Smd, spektorsky, Steeeefan, Uciteljgoran, vladas87, vlvl, willie, zodiac94