WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

Validations in php | Loop and Break

Validations in php

Hopefully it now goes without saying (although I’ll do so anyway) that form-data validation is of the utmost importance, due to the possibility of users attempting to hack into your server.
 
In addition to maliciously formed input data, some of the things you also have to check are whether a file was actually received and, if so, whether the right type of data was sent. Taking all these things into account, previous example, index1.php, is a rewrite of index.php.

<!-- index1.php -->

<!DOCTYPE html> 
<html>
	<head>
		<title>PHP Form Upload</title>
	</head>
<body>

	<form method='post' action='index1.php' enctype='multipart/form-data'>
		Select a JPG, GIF, PNG or TIF File: 
		<input type='file' name='filename' size='10' /> 
		<input type='submit' value='Upload' />
	</form>

<?php
if ($_FILES) {
	$name = $_FILES ['filename'] ['name'];
	switch ($_FILES ['filename'] ['type']) {
		case 'image/jpeg' :
			$ext = 'jpg';
			break;
		case 'image/gif' :
			$ext = 'gif';
			break;
		case 'image/png' :
			$ext = 'png';
			break;
		case 'image/tiff' :
			$ext = 'tif';
			break;
		default :
			$ext = '';
			break;
	}
	if ($ext) {
		$n = "image.$ext";
		move_uploaded_file ( $_FILES ['filename'] ['tmp_name'], $n );
		echo "Uploaded image '$name' as '$n':<br />";
		echo "<img src='$n' />";
	} else
		echo "'$name' is not an accepted image file";
} else
	echo "No image has been uploaded";
?>

</body>
</html>
Share

You may also like...