Exemplo n.º 1
0
$date = date("D m/j/y g:iA");
$yourname = @stripslashes($_POST['yourname']);
$youremail = @stripslashes($_POST['youremail']);
$yourmessage = smiley_face($_POST['yourmessage']);
$myUBB = new UBBCodeN();
$yourmessage = $myUBB->encode($yourmessage);
$yourmessage = stripslashes($yourmessage);
//instantiate an instance of gbXML for working with the data file
$data_type = 'messages';
$record_delim = 'message';
$filename = '../data/data.xml';
$mygbXML = new gbXML($data_type, $record_delim, $filename);
//get our record ready to append
$tmp_array = array('id' => $id, 'name' => $yourname, 'date' => $date, 'email' => $youremail, 'msg' => $yourmessage);
//try to replace the existing record with the new one and display confirmation
if ($mygbXML->replace_record_in_file($id, $tmp_array)) {
    echo <<<HTML
     <center><h2>Record Saved</h2>

        <p>This modified record has been saved: </p>
        <div class="gbookRecordBanner"></div>
        <div class="gbookRecord">
                <p><span class="gbookRecordLabel">{$listnametxt}:</span> {$yourname}  </p>
                <p><span class="gbookRecordLabel">{$listemailtxt}:</span> <a href="mailto:{$youremail}" />{$youremail}</a>  </p>
                <p class="gbookRecordMsg"><span class="gbookRecordLabel">{$listMessagetxt}:</span> {$yourmessage}</p>
        </div>

    <p><a href="modify.php" title="return to edit/delete page">Edit or Delete another record?</a></p></center>

HTML;
    include '../includes/admin_footer.php';