Jump to content

[SOLVED] help making an if statement


cs1h

Recommended Posts

Hi,

 

I'm trying to make a if statement that does one thing when there is a GET variable present like this

www.somesite.com/index.php?thing=1234

 

and when no GET variable is there (like this

www.somesite.com/index.php

it does another thing.

 

I tried this but it doesn't work

<?php 
$switch = $_GET["c1"];

if($switch==" "){
echo "Hello Worker";
}else{ 
echo "Goodbye Worker";}


?>

 

Does anyone know how to do this?

 

Thanks,

Colin

 

 

Link to comment
https://forums.phpfreaks.com/topic/131348-solved-help-making-an-if-statement/
Share on other sites

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.