Passing Blank Values in a Form - API

Discussion created by artdezign on Dec 3, 2012
Latest reply on Dec 5, 2012 by Mike_Mitchell

Hi There,


I have a form that is meant to create a new entry for a blog post. But once it is executed it creates a new record with only blank values. Can anyone tell what is missing here?


Form Code:



<form action="newEntryResponse.php" method="POST" name="newEntry">




<input name="title" type="text" id="title"><br />


<textarea name="body" cols="50" rows="8"></textarea><br />

<input type="submit" name="submit" value="Submit Post"><br />



Respose PHP code:



require_once ('../config.php');

require_once ('');





$newPostCmd = $fm->newAddCommand('BlogPosts'); // initialize the database for Add Command

$newPostCmd->setField('title',POST('title')); // Create the new Title Field

$newPostCmd->setField('body',POST('body')); // Create the new Body Field ($fmCommance->setField('fieldName', $value);

$newPost=$newPostCmd->execute(); //execute the command



if(FileMaker::isError($newPost)) {

die('Database Error: '.$newPost->getMessage());





<?php include('BlogHeader.php'); ?>






<p>Your Post was made Successfully, please go back to the <a href="index.php">Home Page</a></p>





<?php include('BlogFooter.php'); ?>


I greatly appreciate any suggestions you have.