Jump to content

php forms error


katsuowota

Recommended Posts

hey guys, can somebody help me with this problem?

 

sorry in advance if the problem is way too easy to figure out, I'm really new at php...

 

I try to get a dropdown list with content grabbed from a database. I then want to have it able to submit the value to another page (next_page.php), but when I try to run the website, it just shows up blank. the php error checker came up with this error:

 

PHP Syntax Check: Parse error: syntax error, unexpected '<' in your code on line 16

 

<form action="next_page.php" method="post">

my code is:

 

 

 

<!DOCTYPE html>

<html>
 
<head>
  <title>The Film Directory</title>
  <link href="site.css" rel="stylesheet">
</head>
<body>
<div>
  <h1>Film Directory</h1> 
  <h2>Choose your poison</h2>
 
  <?php
 
require "login.php";
 
<form action="next_page.php" method="post">
 
$sql="SELECT Name,FilmID FROM Films order by Name"; 
print "<select Name=Film_selection value=''>Film Name</option>";
foreach ($dbo->query($sql) as $row){
print "<option value=$row[id]>$row[Name]</option>";
}
print "</select>";
print '<input type="submit" value="Submit">';
</form>
 
$dbh = null;
?>
 
</div>
</body>
</html>
Link to comment
https://forums.phpfreaks.com/topic/294509-php-forms-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.