My form action page is PHP but I want to echo a clickable link and I think PHP doesn´t support this. I've embed this PHP code in HTML tags but it echos the tags in the page.
Code:
<?php
header('content-type: application/json; charset=utf-8');
header("access-control-allow-origin: *");
include 'connect.php';
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Allow certain file formats
if($imageFileType != "sql") {
echo "Sorry, only SQL files are allowed.
";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.
";
$sqlfile = fopen($target_file, "r") or die("Unable to open file!");
$contents = file($target_file);
foreach($contents as $line) {
$result = mysql_query($line) or die('Query failed: ' . mysql_error());
$file_name= str_replace("'", "", basename($target_file,".sql"));
}
echo "The new data was inserted in database.
";
echo "View your data in http://localhost/public_html/PAD/index.php?user=$file_name";
fclose($sqlfile);
} else {
echo "Sorry, there was an error uploading your file.";
}
}
?>
The problem is here:
echo "View your data in http://localhost/public_html/PAD/index.php?user=$file_name";
How can I make this link clickable?
Thanks!