<?php
session_start();

// Generate a random 4-digit CAPTCHA
$captchaCode = rand(1000, 9999);

// Store it in session (unique for inquiry form)
$_SESSION['career_inquiry_captcha'] = $captchaCode;

// Create the image
$img = imagecreate(80, 30);
$bg = imagecolorallocate($img, 255, 255, 255);
$textColor = imagecolorallocate($img, 0, 0, 0);

// Add the CAPTCHA text
imagestring($img, 5, 20, 8, $captchaCode, $textColor);

// Output image headers
header('Content-type: image/png');
imagepng($img);
imagedestroy($img);

?>
