In the provided PHP script, what potential issues can arise from using a relative path instead of an absolute path for file uploads?

Using a relative path for file uploads can lead to security vulnerabilities, as it allows an attacker to manipulate the path and potentially upload malicious files to sensitive directories. To solve this issue, it is recommended to use an absolute path for file uploads to ensure that files are saved in a secure location on the server.

// Incorrect relative path for file upload
$target_dir = "uploads/";

// Correct absolute path for file upload
$target_dir = "/var/www/html/uploads/";