Jump to content

[SOLVED] need help with parameter


Joefunkx

Recommended Posts

Hey guys, here's my problem-

I am calling a page with a parameter and I want to be able to condition code on that page depending on the parameter.

 

The link i use is this-

<A HREF="test.php?agent=test">

 

the test.php file consists of the following-

 

<?php

echo $_GET['agent'];

if ($agent="blah") {

  echo "Have a nice weekend!";

}

?>

 

the output on that page is-

 

test Have a nice weekend!

 

As you can see, it shouldn't be outputting the "Have a nice weekend!" statement as the agent parameter is "test", not "blah". Any help with this would be appreciated Thanks!

Link to comment
https://forums.phpfreaks.com/topic/56230-solved-need-help-with-parameter/
Share on other sites

I tried that code.. It doesn't display the "Have a nice weekend!" at all, which is good because "blah" isn't the value of AGENT. However, when i change code to $agent == "test", it still doesn't display "Have a nice weekend!" even though the condition is true.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.