Jump to content

GET help


Vivid Lust

Recommended Posts

When the get "deleten" doesnt exist, the code still executes as if it did.

 

Basically, here's my code:

 

<?php
$get = $_GET['deleten'];
if($get !== ""){
echo "File deleted at: <a href=http://".$_SERVER["HTTP_HOST"].$get.">".$_SERVER["HTTP_HOST"].$get."</a>"; 
}
else
{
echo "<br>"; 
}
?>

 

All the time the "echo "File deleted at: <a href=http://".$_SERVER["HTTP_HOST"].$get.">".$_SERVER["HTTP_HOST"].$get."</a>";" displays, i think my coding is bad, please help xd

 

thanks in advanced!

Link to comment
https://forums.phpfreaks.com/topic/116155-get-help/
Share on other sites

Go with Johnnys way. Also, your link is wrong. You're (or were) missing a quote to the left of the URL.

 


if isset($_GET['deleten'])
{
    $get = $_GET['deleten'];
    echo "File deleted at: <a href=\"http://".$_SERVER["HTTP_HOST"].$get."\">".$_SERVER["HTTP_HOST"].$get."</a>"; 
}
else
{
    echo "<br>"; 
}

Link to comment
https://forums.phpfreaks.com/topic/116155-get-help/#findComment-597329
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.