hi.
i wanna check a button if it clicked or not. what should i do in PHP?
check a button
Moderator: General Moderators
-
penkomitev
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 26, 2009 10:40 am
- Location: Plovdiv, Bulgaria
Re: check a button
You have to clarify what you exactly mean.
Checking whether a button has been clicked does not make sense unless you declare what you exactly need.
P.S. Please, for future posts, have in mind a sentence begins with capital letter. This makes the text much more pleasant for all people reading.
Penko
Checking whether a button has been clicked does not make sense unless you declare what you exactly need.
P.S. Please, for future posts, have in mind a sentence begins with capital letter. This makes the text much more pleasant for all people reading.
Penko
Re: check a button
In addition to penkomitev's comment, remember: PHP only works server-side, to generate the HTML that is sent to the user.M.K_Soft wrote:i wanna check a button if it clicked or not. what should i do in PHP?
Clicking a button is something that usually happens client-side, i.e. after the user received your PHP's result.
Re: check a button
Give the page an id (http://www.mysite.com/page.php?id=2344, then create a database with a table which can contain the page id's then create a column called click.
When the button is clicked run a script what updates the database WHERE page_id = "current page id" and SET click = 1.
Now on the original page you can use a conditional statement such as if to make the page change depending on if the button has been click E.G
When the button is clicked run a script what updates the database WHERE page_id = "current page id" and SET click = 1.
Now on the original page you can use a conditional statement such as if to make the page change depending on if the button has been click E.G
Code: Select all
if (click == 1)
{
echo "button has been clicked";
}
else{
Run page as normal