Save image same with the value of the form

can you please help me here I want save an image but the file name should be same with the value name of the form here is my code

[php]

ID number



   

   


[/php]

[php]<?php

require_once ‘post_id.php’;

$id_number = $_GET[‘id_number2’] . ‘.jpg’;

//$filename = date(‘YmdHis’) . ‘.jpg’;
$filename = $id_number;
$result = file_put_contents($filename, file_get_contents(‘php://input’));
if (!$result) {
echo “Can’t save image $filename \n”;
exit();
}

$url = ‘http://’ . $_SERVER[‘HTTP_HOST’] . dirname($_SERVER[‘REQUEST_URI’]) . ‘/’ . $filename;
print “$url\n”;
?>
[/php]

bump.
I need help here

Sponsor our Newsletter | Privacy Policy | Terms of Service