Exemplo n.º 1
0
    $seriesID = $_REQUEST['seriesID'];
}
// Load in the requested SeriesManager from the DB
$seriesManager = new RowManager_SeriesManager($seriesID);
// if the form was submitted, then load Form Data:
if (isset($_REQUEST['submit'])) {
    $newTitle = $_REQUEST['title'];
}
// set default error Message
$titleError = '';
/***
 *** Process the Data
 ***/
if (isset($_REQUEST['submit'])) {
    if ($newTitle != '') {
        $seriesManager->setTitle($newTitle);
        $seriesManager->updateDBTable();
    } else {
        $titleError = 'Title can\'t be empty';
    }
}
/***
 *** get HTML for display
 ***/
// Now we create a Template object
// NOTE: (optional parameter is to set the path to your template file )
// ex   $template = new Template( "path/to/template/files/here.php" );
// if you don't set it, it assumes the template is in the same directory
// as your script.
//
$template = new Template();
Exemplo n.º 2
0
    // load the site objects
    $pathFile = 'General/gen_Includes.php';
    $extension = '';
    // Attempt to find proper directory from current page to Root ...
    $numAttempts = 0;
    while (!file_exists($extension . $pathFile) && $numAttempts < 5) {
        $extension = '../' . $extension;
        $numAttempts++;
    }
    require $extension . $pathFile;
    /*
     * This script expects that these files are in the same directory 
     */
    require 'SeriesManager.php';
    $series = new RowManager_SeriesManager();
    $series->setTitle($_REQUEST['Title']);
    $series->createNewEntry();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>FormExample</title>
</head>
<body>
<h1>Enter A new Series:</h1>
<form action="" method="post">
Name: <input name="title" type="text"><br>
<input type="submit" name="Submit" value="Submit">