dimanche 19 avril 2020

PHP variable not staying active between webpages

I am trying to use the below code:

<?php   
if ($error = false){   
echo "<p class='error' > Incorrect!</p>";   
}
?>

This is within the body of my HTML. The following page/code is triggered when pressing my submit button.

<?php
$error = false;
?>

Should this trigger the first piece of code to show my error message, i have tried just the echo and the error appears, although will not pick up my class='error' I suspect it is because i am forced to use '' instead of "". if i use "" it interrupts my echo "" and will not run.

css:

.error{
position:absolute;
color:red;
font-size: 40px;
text-align-last: centre;        
}

Any help is appreciated, I am a beginner be patient please.

Aucun commentaire:

Enregistrer un commentaire