Ok, so i have researched some about disable a button and everyone says that u need to use js. now i dont know that much js so i wonderd if there is a way to do this in php only.
If not then please post a sample code that would temporary disable a button for "exampel 3 seconds".
This is ment to do:
example:
$rand = rand(0,10)
$brand = rand(0,10)
if ($brand == $rand)
{
$input = rand(7500,65000)
$sql="UPDATE konto SET pengar=$pengar + $input WHERE saved_id=$id";
$result = mysql_query($sql) or die(mysql_error());//Skicka info till tabell
header('Refresh: 3; url=refresh/two=two(main).php?saved_id='.$id);//Skickas till angiven sida. //and at the same time the button would be disabled
}
temporary disable button using php
Moderator: General Moderators
Re: temporary disable button using php
Not all browsers respect the Refresh header. Find another way.
Spoiler: you won't find one. JavaScript is required for some part of it.
Spoiler: you won't find one. JavaScript is required for some part of it.
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: temporary disable button using php
dont be intimidated by js its easy.
http://www.google.com/search?q=disable+ ... javascript
http://www.google.com/search?q=create+a ... +javscript
im not sure what you are trying to describe with your example though.
they click the button, it updates the database then redirects them?
http://www.google.com/search?q=disable+ ... javascript
http://www.google.com/search?q=create+a ... +javscript
im not sure what you are trying to describe with your example though.
they click the button, it updates the database then redirects them?
Re: temporary disable button using php
they click a button it randomize a number if they win they will be shown a message YOU WON!...
the problem is that when you win it redirect in a header "takes 3 seconds" but if u accidentaly click again this will not happend...
-Hope you understand
-Thomas
the problem is that when you win it redirect in a header "takes 3 seconds" but if u accidentaly click again this will not happend...
-Hope you understand
-Thomas
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: temporary disable button using php
okay i get it now. well follow those links and use javascript to do this. it's real easy i promise.
Re: temporary disable button using php
I will and thanks daed
(again)