Jump to content

form example is not working for different fields


tech93

Recommended Posts

Hi,

 

Below example works for the below link:-

https://www.w3schools.com/php/php_forms.asp

But If i try to use different form name and some other field names it does not work as i can simply enter the values but unable to display them.

not sure what is wrong with my scripts here:-

script for l2.php:-
 

<!DOCTYPE html>
<html>
<head>
<title>Form</title>

</head>

<body>

<h1>The input name attribute</h1>

<form>

<form action=" " method="get">
  <label for="URL">A Media URL:</label>
  <input type="text" id="URL" name="URL"><br><br>
  <label for="Image">An Image:</label>
  <input type="text" id="Image" name="Image"><br><br>
  <label for="Title">Title:</label>
  <input type="text" id="Title" name="Title"><br><br>
  <input type="submit" value="Submit">

</form>

</body>
</html>

 

Script for action_page.php

<!DOCTYPE html>
<html>
<head>
<title>Form</title>

</head>

<body>

<h1>The input name attribute</h1>

<form>

<form action="action_page.php" method="get">
  <label for="URL">A Media URL:</label>
  <input type="text" id="URL" name="URL"><br><br>
  <label for="Image">An Image:</label>
  <input type="text" id="Image" name="Image"><br><br>
  <label for="Title">Title:</label>
  <input type="text" id="Title" name="Title"><br><br>
  <input type="submit" value="Submit">

</form>

</body>
</html>

 

Thanks..

 

 

 

 

Link to comment
Share on other sites

where's your php?

action=" "

means there needs to be php at the bottom of the file that represents your your first example 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...