Hi
I’m really new to PHP, so forgive my lack of proper terminology.
Basically, I have a php script that is creating a few variables using $_GET. But I was wondering if there is a way to create a default variable when the parameter isn’t in the URL to begin with.
For example if the url was something like: “ww.somewebsite.com/form.php?name=john&surname=smith”
And php script was something like this:
$name = $_GET['name'];
$surname = $_GET['surname'];
if ($_GET['company'] == DOESNT-EXIST){
$company = "no company";
} else {
$company = $_GET['company'];
}
Any help would be greatly appreciated. Cheers.
Mark