Hey, I´m a begginer at php developing. But I have knowledge in java. And it seem almoste the same.
My problem is that i dont know how to check if a variable exist.
I am creating a variable inside a if-statement. And outside the if-statement i want to check if the variable i created inside the if-statement exist.
Here is my code:
[php]<?php
if (isset($_POST[“submit”])) {
$subject = ‘LanCrate beställning!’;
$emaillc = ‘[email protected]’;
if(empty($_POST['name'])){
$errName = 'Du missade att fylla i ditt namn.';
}
if(empty($_POST['email'])){
$errEmail = 'Du missade att fylla i din mejladress.';
}
if(empty($_POST['message'])){
$errMessage = 'Du missade att fylla i ditt meddelande.';
}
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
if(mail($emaillc, $subject, $message, $name)){
}
}
?>[/php]