PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I m new to php and trying to develop a basic application using php.
What I am trying to do :
1. Create a Button
2. Whenever user click that button it should display different message.
For example, 1st click -- Hi
2nd click -- How are you?
The session thing is working.....now the problem is....
when i click button then it shows...fact....and not button...
I want a button below the ouput and if the user click on that button than it should display other fact...
It looks to me like what is happening is that, since you don't have a switch case for $x==1, every time you invoke the function, it's going to go to the default and destroy the session.
When i click button first time then it will go in else loop....and echo fact1
later on when i click on button....then it goes into switch case....
so this logic is working properly.....
but once i click the button then I need to run index.php to get the button again....and i want button to present below the output.
For instance,
Fact 1
View =1
Button "Click Me"
Again if I click the button then it should look like this
Fact =2
View = 2
Button "Click Me"
rotavirus wrote:The session thing is working.....now the problem is....
when i click button then it shows...fact....and not button...
I want a button below the ouput and if the user click on that button than it should display other fact...
You are using two separate files. If you want the button to appear on every page view, either combine the code from index.php and count.php into a single file or use include.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 4:37 pm, edited 1 time in total.