k,

i want to display error message from my php file to html file.
say i have this in contact.php

if(empty($visitormail)){ $message = "enter email"; }

now in html file do i have to have this include:

<?php include 'contact.php'?>;

and then where ever i want to display the error i write :

<?php echo "$message"?>

Am i correct here guyz?

A file ending with .html cannot have PHP code in it unless you have set up your server specifically for it.

Use a .php extension for our files. You can place HTML in those files and also "embed" PHP just as you have in your Original Post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.