Sh3ll
OdayForums


Server : Apache
System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
User : apache ( 48)
PHP Version : 8.0.28
Disable Function : NONE
Directory :  /var/www/html/mmishra/mm/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/mmishra/mm/orphans.php
<?php
checkadmin($role);
?>
Edit content of webpages here. Familiarity with HTML tags is must to work at this advance level of content administration. Admin/user pages will be accessible after proper authentication. <br><br>
<?php
$rowid = $_REQUEST['rowid'];
$hypertext = $_POST['hypertext'];
$parentid = $_REQUEST['parentid'];
if (!$parentid) $parentid = 0; //top level link
$pagetitle = $_POST['pagetitle'];
$pageaccess = $_POST['pageaccess'];
$pagetype = $_POST['pagetype'];
if (!$pagetype) $pagetype = 'html'; //static webpage
$pagecontent = htmlsafe($_POST['pagecontent']);
if ($pagecontent) $pagecontent = str_replace("\"", "'", $pagecontent);
$keywords = $_POST['keywords'];
$dateexpiry = $_POST['dateexpiry'];
if (!$dateexpiry || $dateexpiry == '0000-00-00 00:00:00') $dateexpiry = get_next_month();//date('Y-m-d');
$status = $_POST['status'];
$userid = $_POST['userid'];
$submit = $_POST['submit'];

$tbl = 'webpages';

$contentcategories = array(0 => 'Homepage',99995=>'Format',99996=>'Tender',99997 =>'Profile',99998=>'Advertisement',99999=>'Announcement');
//$pagetypes = array('html','php','url','file');
$pagetypes = array('menu','html','url','file');
$pageaccesses = array('public','user','admin');
$statuss = array('online','offline');

switch ($submit) {
case "UP":
        if (mysql_num_rows(mysql_query("select * from $tbl where rowid=$rowid"))) {
		$sr = mysql_query("select * from $tbl where webid='$webid' and status='online' and parentid=$parentid and rowid<$rowid order by rowid desc limit 0,1");
		if (mysql_num_rows($sr)) {
			$o = mysql_fetch_object($sr);
			$prowid = $o->rowid;
                	mysql_query("update $tbl set parentid=100000 where parentid=$prowid");
                	mysql_query("update $tbl set rowid=100000 where rowid=$prowid");
                	mysql_query("update $tbl set parentid=$prowid where parentid=$rowid");
                	mysql_query("update $tbl set rowid=$prowid where rowid=$rowid");
                	mysql_query("update $tbl set parentid=$rowid where parentid=100000");
                	mysql_query("update $tbl set rowid=$rowid where rowid=100000");
		}
	}
	$rowid = $prowid;
	break;
case "DOWN":
        if (mysql_num_rows(mysql_query("select * from $tbl where rowid=$rowid"))) {
		$sr = mysql_query("select * from $tbl where webid='$webid' and status='online' and parentid=$parentid and rowid>$rowid order by rowid limit 0,1");
		if (mysql_num_rows($sr)) {
			$o = mysql_fetch_object($sr);
			$nrowid = $o->rowid;
                	mysql_query("update $tbl set parentid=100000 where parentid=$nrowid");
                	mysql_query("update $tbl set rowid=100000 where rowid=$nrowid");
                	mysql_query("update $tbl set parentid=$nrowid where parentid=$rowid");
                	mysql_query("update $tbl set rowid=$nrowid where rowid=$rowid");
                	mysql_query("update $tbl set parentid=$rowid where parentid=100000");
                	mysql_query("update $tbl set rowid=$rowid where rowid=100000");
		}
	}
	$rowid = $nrowid;
	break;
case "SAVE":
        if (mysql_num_rows(mysql_query("select * from $tbl where rowid=$rowid"))) {
		if (mysql_num_rows(mysql_query("select * from $tbl where rowid=$rowid and userid='$user'"))) {
	                mysql_query("update $tbl set hypertext='$hypertext',parentid=$parentid,
			pagetitle='$pagetitle',pagetype='$pagetype',pageaccess='$pageaccess',pagecontent='$pagecontent',
			keywords='$keywords',status='$status',dateupdation=now(),dateexpiry='$dateexpiry' 
			where rowid=$rowid");
		} else 
			echo "<div class='error'>Read only page</a>";
        } else {
                mysql_query("insert into $tbl
		(webid,hypertext,parentid,pagetitle,pagetype,pageaccess,pagecontent,keywords,datecreation,dateupdation,dateexpiry,dateaccess,status,userid) 
		values('$webid','$hypertext',$parentid,'$pagetitle','$pagetype','$pageaccess','$pagecontent','$keywords',now(),now(),'$dateexpiry',now(),'online','$user')");
        }
        break;

case "DELETE":
        mysql_query("delete from $tbl where rowid=$rowid");
	$hypertext = ''; $parentid = 0; $pagetitle = ''; $pagetype = 'html'; 
	$pageaccess = 'public'; $pagecontent = ''; $keywords = ''; 
	$rowid = 0;
        break;
}
if ($rowid > 0 && !$parentid) {
	$rs = mysql_query("select * from $tbl where rowid=$rowid");
	if ($rs) {
		$o = mysql_fetch_object($rs);
        	$parentid = $o->parentid;
	}
}
//get the parentid of page under updation

$parent = '';
foreach ($contentcategories as $key => $cc) {
       	if ($parentid == $key) { 
		$parent = $cc;
	} else
		$parents .= "[<a href='admin.php?conf=$conf&parentid=$key'>$cc</a>]";
}
/*
if (!$webpage) {
	$rs = mysql_query("select hypertext from $tbl where webid='$webid' and rowid=$parentid'");
	if ($o = mysql_fetch_object($rs)) {
       		$webpage = $o->hypertext;
	}
}
*/
echo "<div class='error'>Under&nbsp;";
if ($parent) {
       	echo "$parent <input type='hidden' name='parentid' value='$parentid'> $parents";
} else {
	echo "<select name='parentid' style='width: 200px' onchange=\"document.location.href='$PHP_SELF?conf=$conf&parentid='+this.value\">
	<option value='0'>Homepage</option>";
	$rs = mysql_query("select rowid,hypertext from $tbl where webid='$webid' and parentid<=$parentid and pagecontent='' and status='online' order by rowid");
	while ($o = mysql_fetch_object($rs)) {
       		echo "<option value='$o->rowid'";
       		if ($parentid == $o->rowid) echo " selected";
       		echo ">$o->hypertext</option>";
	}
	echo "</select>";
}
echo "</div>
<center>
<table cellpadding='5'>
<tr bgcolor='silver'>
<td>Web Link<br>
<select name='rowid' style='width: 200px' onchange=\"document.location.href='$PHP_SELF?conf=$conf&parentid=$parentid&rowid='+this.value\">
<option value='0'>New page</option>";

$rs = mysql_query("select * from $tbl where webid='$webid' and parentid=$parentid order by rowid");
while ($o = mysql_fetch_object($rs)) {
        echo "<option value='$o->rowid'";
	if ($o->rowid == $rowid) {
		echo " selected";
		$hypertext = $o->hypertext;
		$parentid = $o->parentid;
		$pagetitle = $o->pagetitle;
        	$pagetype = $o->pagetype;
        	$pageaccess = $o->pageaccess;
                $pagecontent = htmlunsafe($o->pagecontent);
                $keywords = $o->keywords;
                $status = $o->status;
                $dateexpiry = $o->dateexpiry;
                $userid = $o->userid;
        }
        echo ">$o->hypertext</option>";
}
echo "</select></td>
<td>Access Scope<br> 
<select name='pageaccess' style='width: 100px'>";
foreach ($pageaccesses as $pa) {
        echo "<option value='$pa'";
        if ($pageaccess == $pa) echo ' selected';
        echo ">$pa</option>";
}
echo "</select></td>
<td>Content Type<br> 
<select name='pagetype' style='width: 100px'>";
foreach ($pagetypes as $pt) {
        echo "<option value='$pt'";
        if ($pagetype == $pt) echo ' selected';
        echo ">$pt</option>";
}
echo "</select></td>
<td>Expiry Date<br>";
//datepicker class
require_once('classes/tc_calendar.php');

$yr = date("Y",strtotime($dateexpiry));
$mth = date("m",strtotime($dateexpiry));
$dt = date("d",strtotime($dateexpiry));

//instantiate class and set properties
$myCalendar = new tc_calendar("dateexpiry", true, false);
$myCalendar->setIcon("images/calendar.gif");
$myCalendar->setDate($dt, $mth, $yr);
$myCalendar->setPath("classes/");
$myCalendar->setYearInterval(2010, 2025);
$myCalendar->dateAllow('2010-01-01', '2025-12-31');
$myCalendar->setDateFormat('j F Y');
//output the calendar
$myCalendar->writeScript();

echo "</td>
<td>Status<br>
<select name='status' style='width: 100px'>";
foreach ($statuss as $st) {
        echo "<option value='$st'";
        if ($status == $st) echo ' selected';
        echo ">$st</option>";
}
echo "</select>
</td></tr>
</table>
<table>
<tr>
<td>Link Text (Hypertext under menus)<br>
<input type='text' name='hypertext' size='60' value='$hypertext'>";
if ($rowid) echo "<input type='submit' name='submit' value='UP' style='width: 80px'>";
echo "</td></tr>

<tr><td>Page Title (Appears at top of the page)<br>
<input type='text' name='pagetitle' size='60' value='$pagetitle'>";
if ($rowid) echo "<input type='submit' name='submit' value='DOWN' style='width: 80px'>";
echo "</td></tr>

<tr valign='top'><td>Page Content<br>";

if ($pagetype == 'html') 
	echo "<textarea id='content' name='pagecontent' style='width: 100%'>$pagecontent</textarea>";
else
	echo "<input type='text' id='content' name='pagecontent' size='60' value='$pagecontent'>";

echo "</td></tr>

<tr><td>Keywords (Useful for content indexing)<br>
<input type='text' name='keywords' size='60' value='$keywords'>
</td></tr>
<tr><th>";
//if ($userid == $user) {
	echo "<input type='submit' name='submit' value='SAVE' style='width: 80px'> ";
	if ($rowid) echo "<input type='submit' name='submit' value='DELETE' style='width: 80px'>";
	//echo "<input type='submit' name='submit' value='DELETE' style='width: 80px'>";
//}
echo "</th></tr>
</table>
</center>";

?>
These pages are stored in the database and is accessible through click of some menu link.
To be used in identification and filtering of obsolete content by delivery platform.



ZeroDay Forums Mini