insert current url in php mysql code example
Example: insert current url in php mysql
<html>
<body>
<?php
function getURL()
{
return '://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
?>
<form action="something.php" method = "POST" >
<p>
<input type="hidden" name="url" id="url" value="<?php echo getURL();?>" />
</p>
< /form>
</body>
</html>
/* in something.php*/
$query = "INSERT INTO tablename (name, email, phone, category,term,url) VALUES ('$name', '$email', '$phone', '$category','$checkbox','$url')";