<?php
// Define paths
$target_dir = __DIR__ . '/../assets/images/';
$placeholder_image = $target_dir . 'course-placeholder.jpg';
// Create directory if it doesn't exist
if (!file_exists($target_dir)) {
if (!mkdir($target_dir, 0777, true)) {
die("Failed to create directory for course images.");
}
}
// Create a simple text file as a placeholder
$placeholder_text = "This is a placeholder for the course image. Please replace this file with an actual image.";
if (file_put_contents($placeholder_image, $placeholder_text)) {
echo "Placeholder file created at: $placeholder_image";
} else {
echo "Failed to create placeholder file.";
}
?>