Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how do i echo php code on html file

Featured Replies

Hello friends, I have a html form saved as join.html as below

<form id="form1" name="form1" method="post" action="check.php">
 Name:
 <label>
 <input name="name" type="text" id="name" />
 </label>
 <p>Email: 
   <label>
   <input name="email" type="text" id="email" />
   </label>
 </p>
 <p>
   <label>
   <input type="submit" name="Submit" value="Submit" />
   </label>
</p>
</form>

 

and a php file saved as ckeck.php as below;

<?php
if(!empty($_POST[submit]))
{
$name=mysql_real_escape_string($_POST[name]);
$email=mysql_real_escape_string($_POST[name]);
if($name=="")
echo "Enter your Name.<br>";
elseif ($email=="")
echo "Enter your Email.<br>";
else
echo "Thank you.";
}
?>

If any of the field is empty, I will be directed to check.php to see the error. I will want the error message to be echoed at the top of the form without be directed to the ckeck.php and without placing the php code on top of the form in join.html

 

Is this possible? if not which other option do i have?

 

regards

adsegzy

You could also do some pre-posting error checking to see if there is anything that needs amending using javascript or even ajax

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.