All pastes #280788 Raw Edit

Something

public text v1 · immutable
#280788 ·published 2006-12-16 04:27 UTC
rendered paste body
<?php 
include '../includes/db_connect.php';

$id = $_REQUEST['id'];
$submit = $_REQUEST['Submit'];
$content = $_REQUEST['content'];
$success_msg = "Changes Saved!";

if (isset($_REQUEST['Submit'])) {
$update_page = "UPDATE pages SET content='$content' WHERE id='$id'";
$update_result = mysql_query ($update_page);
}

$select_page_content = "SELECT * FROM pages WHERE id='$id'";
$page_select_result = mysql_query ($select_page_content);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Jordan Scott - Personal Portfolio</title>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<?php include '../includes/include_tinymce.php'; ?>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('../images/bttn_home_on.gif','../images/bttn_news_on.gif','../images/bttn_aboutme_on.gif','../images/bttn_webdesign_on.gif','../images/bttn_graphicdesign_on.gif','../images/bttn_contactme_on.gif')">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="header_bg">&nbsp;</td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="../images/logo.gif" width="278" height="55" /></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','../images/bttn_home_on.gif',1)"><img src="../images/bttn_home.gif" alt="Home" name="home" width="52" height="55" border="0" id="home" /></a></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('news','','../images/bttn_news_on.gif',1)"><img src="../images/bttn_news.gif" alt="News" name="news" width="48" height="55" border="0" id="news" /></a></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('aboutme','','../images/bttn_aboutme_on.gif',1)"><img src="../images/bttn_aboutme.gif" alt="About Me" name="aboutme" width="73" height="55" border="0" id="aboutme" /></a></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('webdesign','','../images/bttn_webdesign_on.gif',1)"><img src="../images/bttn_webdesign.gif" alt="Web Design" name="webdesign" width="82" height="55" border="0" id="webdesign" /></a></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('graphicdesign','','../images/bttn_graphicdesign_on.gif',1)"><img src="../images/bttn_graphicdesign.gif" alt="Graphic Design" name="graphicdesign" width="107" height="55" border="0" id="graphicdesign" /></a></td>
        <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contactme','','../images/bttn_contactme_on.gif',1)"><img src="../images/bttn_contactme.gif" alt="Contact Me" name="contactme" width="160" height="55" border="0" id="contactme" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="bg_slice">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="text"><p class="main-headings">Edit Page</p>
		<form action="page_editor.php" method="post">
		<?php while ($content = mysql_fetch_array ($page_select_result)) { ?>
          <table width="100%" border="0" cellspacing="0" cellpadding="4">
            <tr>
              <td><img src="../images/page.png" align="left"/> Page Content</td>
            </tr>
            <tr>
              <td><label>
                <textarea name="content" cols="85" rows="15" id="content"><?php echo $content['content']; ?></textarea>
              </label></td>
            </tr>
            <tr>
              <td><label>
                <input type="submit" name="Submit" value="Save Changes" />
              </label></td>
            </tr>
          </table>
		  <?php
		  }
		  ?> 
		  </form>         
          </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="footer_bg">&nbsp;</td>
  </tr>
</table>
</body>
</html>