Answer the question
In order to leave comments, you need to log in
How to upload string from mysql database to url?
Here is the code
$bd = mysqli_connect('localhost', 'root', 'root', 'key'); // делаем коннект к базе данных
$sql = mysqli_query($bd, "SELECT number FROM `number`"); // $sql - переменная и делаем запрос ВЫБРАТЬ колонку(number) из Таблицы(number)
$row = mysqli_fetch_array($sql);
//echo $row ['number']; // возвращаем строку
if (!$row) { // выполняем условие, если не срабатывает предыдущее.
exit("Не возможно отобразить файл");
}
$path = substr ($_SERVER['PHP_SELF'],0,STRRPOS($_server['PHP_SELF'],"/"));
echo "<a href='http://localhost/".$_SERVER[''].$path."datatime.php?hash=".$row."'>http://localhost/".$_SERVER['HOST_HTTP'].$path."datatime.php?hash=".$row."</a>";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question