Do you have $name
defined?
yes in my html form:
<input type="text" name="name" autocomplete="off" required />
<label for="name" class="label-name"></label>
<span class="content-name">Name</span>
Did you mean $_POST['name']
I had it written like that in my php page I believe
I guess you could do this:
$name = $_POST['name'];
Thats right… Try this trick, run your code through an online PHP debugger, like this:
That site came back with this error:
PHP Syntax Check: Parse error: syntax error, unexpected ‘$name’ (T_VARIABLE) in your code on line 2
$name = $_POST['name'];
I think I realised what’s wrong.
You just put ( isset( $_POST['submit'] ) )
It needs to be:
if( isset( $_POST['submit'] ) ){
//Define your variables here
}
Edit: The PHP Code checker website returns no errors with that fixed
Ah good catch! I don’t use isset as much as I should, I use the lazy
if($_POST['submit'] == null){
// Nothing
}else{
// Something
}
When using PHP, i use isset all the time, but it always has to be inside an if statement. I should have realised before! Hope this helps @jrstokes73!
Eddie
I wish isset was a thing in nodejs/express. Would help out a lot!
Is that really lazy - it looks like it would take longer to type
nah just using shortcuts available to you
@jrstokes73 If I fixed your issue, please mark my post as a ‘solution’ by pressing the button that says ‘solution’ below it. That means if people have the same issue can find the solution or people who want to help can see it has already been solved