Exemple #1
0
<?php

/*
 * Help section: Rename subtopic name
 */
require_once '../../../../../includes/classes/Db.php';
$link = DBCxn::get('../../../../../_db/help.php');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $r = $link->prepare("UPDATE stopics SET stopic=? WHERE stopic_id=?");
    $r->execute(array($_POST['txt_stopic'], $_GET['stopicid']));
    if ($r->rowCount() == 1) {
        header('Location: /apps/help/');
    }
} else {
    # Show form
    $r = $link->prepare("SELECT stopic FROM stopics WHERE stopic_id=?");
    $r->execute(array($_GET['stopicid']));
    list($st) = $r->fetch(PDO::FETCH_NUM);
    require_once '../../../../../includes/classes/Forms.php';
    $forms = new forms('');
    $forms->textbox('Enter new name of new sub topic:', 'stopic', $st, 0, 0, '', 1);
    $forms->submitButton('Rename subtopic', 'update', 1);
    unset($forms);
    //echo "<p>&lt;&lt; {$driverapp->writeUrl($pagetoload, $p_help)}</p>";
}
// End if.