<?php
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");

$title = isset($_POST["title"]) ? $_GET["title"] : "";
$body = isset($_POST["body"]) ? $_GET["body"]: "";
$author = isset($_POST["author"]) ? $_GET["author"]: "";
$url = isset($_POST["url"]) ? $_GET["url"]: "";

if (strlen($title) > 0) {
 $conn = iemdb("mesosite");
 pg_exec($conn, "INSERT into news(body, author, title, url) VALUES 
  ('$body', '$author', '$title', '$url')");
 pg_close($conn);
 echo "<p>Story entered!";
}
?>
<html>
<head>
  <title>IEM Admin | Add News Item</title>
</head>
<body>

<a href="/admin/">Back to admin home</a>

<p>
<form method="POST" action="add_news.phtml">

<p>Enter Title:<input type="text" name="title" size="30">

<p>Reference URL?:
<input type="text" name="url" size="50">

<p>Enter Story:
<textarea NAME='body' wrap="hard" ROWS="20" COLS="70"></textarea>

<p>Enter Author:
 <input type="text" name="author" value="Daryl Herzmann">

<p>Post Story:
 <input type="submit"><input type="reset">


</form>

<?php
include("../../config/settings.inc.php");
include("$rootpath/include/database.inc.php");

$title = isset($_POST["title"]) ? $_POST["title"] : "";
$body = isset($_POST["body"]) ? $_POST["body"]: "";
$author = isset($_POST["author"]) ? $_POST["author"]: "";
$url = isset($_POST["url"]) ? $_POST["url"]: "";

if (strlen($title) > 0) {
 $conn = iemdb("mesosite");
 pg_exec($conn, "INSERT into news(body, author, title, url) VALUES 
  ('$body', '$author', '$title', '$url')");
 pg_close($conn);
 echo "<p>Story entered!";
}
?>
<html>
<head>
  <title>IEM Admin | Add News Item</title>
</head>
<body>

<a href="/admin/">Back to admin home</a>

<p>
<form method="POST" action="add_news.phtml">

<p>Enter Title:<input type="text" name="title" size="30">

<p>Reference URL?:
<input type="text" name="url" size="50">

<p>Enter Story:
<textarea NAME='body' wrap="hard" ROWS="20" COLS="70"></textarea>

<p>Enter Author:
 <input type="text" name="author" value="Daryl Herzmann">

<p>Post Story:
 <input type="submit"><input type="reset">


</form>

Fix it so that it works!
Fix it so that it works!

