0
Let’s go by parts, I’m making a site where I will read a database URL and then I will use it in an image, by clicking on it(image) will open this URL (within an iframe or in a new tab).
In the code, I have a page using HTML and PHP where I show the image with the link URL visible:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<?php
include ("connection.php");
$sql = "SELECT * FROM table";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<div class=\"gallery\">";
echo " <a target=\"iframe1\" href=\"".$row["url"]."\" onclick=\"openiframe()\">";
echo " <img src=\"images\\".$row["image"]."\" width=\"600\" height=\"400\">";
echo " </a>";
echo " <div class=\"desc\"><a href=\"".$row["url"]."\" target=\"_blank\">".$row["name"]."</a></div>";
echo "</div>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</div>
</body>
</html>
The result of the previous code is something like this:
So far so good, now what I intended was not to be visible the URL, in the next image I marked what I speak:
There is a way to hide the URL using for example PHP or some other way?
I made an edit on the question because the other arrow was not noticed very well, I also need to hide in "code" the URL
– Tmc
@Tmc I updated the answer by changing href from "#" to "javascript:void(0)"
– Sam
It turned out that the way you say to change does not appear the URL at the bottom of the page however missing in the "programmer options" see in the image of the question what I say if you do not understand me. I have two arrows in the picture.
– Tmc
@Tmc Got it, you want to hide in both places?
– Sam
exactly, needed it, there is way?
– Tmc
@Tmc Exists by creating a function and assigning a variable to the URL. But if the user views the source code he can see the URL in the function, but it is possible to delete the function in the "programmer options".
– Sam
@Tmc I added in the answer.
– Sam
Let’s go continue this discussion in chat.
– Tmc