$filename = "upload/" . $name;
$success = move_uploaded_file($temp,$filename);
$returnData = ['success'=>$success];
if($success) $returnData['filename'] = $filename;
header("Content-Type: application/json; charset=utf-8");
exit(json_encode($returnData));
$_SESSION['upload_filename'] = $filename;
header('Location: /your-url-page');
exit;
$sql = "
SELECT id, vendor
FROM `pudra`
GROUP BY vendor
ORDER BY RAND()
";
$res = mysql_query($sql);
if($res){
while($data = mysql_fetch_assoc($res)){
echo $data['id'] . "<br>".PHP_EOL;
echo "<a href=".NAMELINK."/?id=".$data['id'].">".htmlspecialchars($data['vendor'])."</a><br>".PHP_EOL;
}
mysql_free_result($res);
}