-1

I am new to PHP and I discovered a new trick, I want to create a script and if $pagea=1 then it will display the contents of page a and so on but I want to know how to make a button or anything that is kinda like link and when users will click it, the values will change.

And help will be appreciated.

Thanks
Nahiyan

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by ProfessorPC
-1

Can you give me the example of the javascript required for doing this?

-1

I am new to PHP and I discovered a new trick, I want to create a script and if $pagea=1 then it will display the contents of page a and so on but I want to know how to make a button or anything that is kinda like link and when users will click it, the values will change.

And help will be appreciated.

Thanks
Nahiyan

You can add a button or a link and use a href

echo "<a href='page.php?page=a'>A</a>

On the landing page add this:

$display = $_GET['page'];
switch($display){
case "a":
do something;
break;
default:
do something else;
break;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.