0

Here is an extract of coding from my "main.php"

if ($_GET["action"]==1){
//Redirected from the login page
}
else if ($_GET["action"]==2){
//Redirected from other page
}
else if ($_GET["action"]==3){
//Redirected from other page
}
else if ($_GET["action"]==4){
print "Test";
}
else if ($_GET["action"]==5){
print "Test2";
}
<a href = "?action=4>Action 4</a>
<a href = "?action=5>Action 5</a>

Action 4 and Action 5 are hyperlinks that exists in main.php, however, when I press either one, nothing happened. The main.php just simply refreshed and did not print out the "Test" text.
However, action 1,2 and 3 work.

I'd like to know what's wrong with this?
Thanks for your kindly help!:icon_cheesygrin:

Edited by am5a03: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by am5a03
0

Other than the unclosed double-quotes in the <a> tags, I don't see anything too terribly wrong, though it may be bad form to have spaces around the "=" in the anchor tags.

0

Other than the unclosed double-quotes in the <a> tags, I don't see anything too terribly wrong, though it may be bad form to have spaces around the "=" in the anchor tags.

thx for answering!

will it be a session problem?
coz I use the session_start() function at the very beginning.

0

Finally I figure out the problem.
The single quote in the <a href> tag make things bad.

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.