how can I prevent PHP from returning an Undefined error every time a variable is checked, if it contains content and that some variable is not used yet? In my previous setup, I can check $ _POST ['email'] even if I haven’t added anything yet. It simply returns an empty or empty result. That I want my PHP setup to work, but for the life of me, I cannot find how to configure it. :(
Example:
<?php
if ($_POST['info'] != '') {
}
?>
<form method="post">
<input type="text" name="info" />
<input type="submit" />
</form>
When you use the above script on one PHP page and run it in my current setup, it returns an Undefined error . In my previous setup, this script worked like a charm. Can anyone highlight this issue. If you need more information, just say it and I will try to add more information to this post.
I know about isset () validation , but I don't want to use it in all my scripts. I want it not to be restrictive on variables.
source
share