close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

archive editable areas

Thread began 1/21/2011 1:37 pm by gruant2000381341 | Last modified 1/23/2011 1:08 am by gruant2000381341 | 1327 views | 3 replies


I figured I would post my remedy here in case anyone else needs to do something similar
I built a database named archlist with 3 fileds
id - int(11) -auto incr primary
name - varchar 255
dateTime - dateTime
that is so I can save out a path for a link to the archived area

I created a folder named archive
in that folder is a normal page with all the styles and stuff for your page and the developer notes pasted in just like normal...that will act as the template that I'm building off of. I named that page nltemplate.php

When the new static pages are created, they will reside inside that archive folder.

note that you may need to edit the path in the developer notes as this is now a subfolder.

in that archive folder is a basic connect_to_mysql.php script so you can connect to the new table we made for saving the path.

And then this file is also in the archive's named index.php
I commented it out as best I could
//connect to the database here
include ("connect_to_mysql.php");
//this is so we can rename the new html file with a system to prevent overwriting
//this will name the html dy date...month,day,year,hour,minute,second
$m = date(M);
$d = date(j);
$y = date(y);
$h = date(G);
$min = date(i);
$sec = date(s);
$newname = $m.$d.$y.$h.$min.$sec;

//seeing if someone hit the submit button on our form
if ($_POST['archiveit'] == "true"){
$archname = $_POST['archname'];
$archname = strip_tags($archname);
$archname = stripslashes($archname);
$archname = mysql_real_escape_string($archname);
//building a link to the new file
$fullpath = '<a target="_blank" href="archive/' . $newname . '.html">' . $archname . '</a>';
if (!$archname){
$msg = "Enter a name";
} else {
//inserting that link into the database
$sql_insert = mysql_query("INSERT INTO archlist (name, dateTime)
VALUES('$fullpath',now() )") or die (mysql_error());
//creating the html from php
//enter your sites url in place
//this is for deleting archives if you wish
if (!empty($_POST['checkbox'])) {
foreach($_POST['checkbox'] as $v) {
$del_id = mysql_real_escape_string($v);
$sql = "DELETE FROM archlist WHERE id ='$del_id'";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Archive Newsletter</title>
<div id="wrap">
<div id="form">
<!-- this form will post back to this page -->
<!-- this form is for the archiving process -->
<form action="index.php" method="post" >
<table width="100%" border="0">
<td>Choose a name for your archived newsletter.<br />
example: July 2010 Newsletter
<br />
<input name="archname" type="text" id="archname" size="50" /><br />
<td><input type="hidden" name="archiveit" id="archiveit" value="true"/>
<input type="submit" name="submit" value="Archive Newsletter" />
<?php echo $msg; ?></td>
<form id="form1" name="form1" method="post" action="index.php">
<!-- this form is for the deleting process -->
<table width="100%" border="0">
<td width="11%" align="center">#</td>
<td width="89%"><strong>You can delete archived newsletters below.</strong></td>
$sql="SELECT id,name FROM archlist";
<td align="center"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $rows['id']; ?>"></td>
<td><?php echo $rows['name']; ?></td>
<?php } ?>
<td align="center">&nbsp;</td>
<td><input type="submit" name="delete" id="delete" value="delete" /></td>
</table><br /><br />

all thats left to do is echo out those links that we added to the db wherever you want them to display

<?php include ("connect_to_mysql.php"); ?>
<h1>Newsletter Archive </h1>
$result3 = mysql_query("SELECT name,dateTime FROM archlist ORDER BY dateTime DESC");
$num_rows = mysql_num_rows($result3);
if($num_rows == 0) {
echo "No Newsletters Archived Yet.";
} else {
echo "<table border='0' cellspacing='0' cellpadding='0'>";
while($row3 = mysql_fetch_array( $result3 )) {
echo "<tr><td>";
echo $row3['name'];
echo "</td></tr>";
echo "</table>";

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...