Problem writing URL into database

Posted on 16th Feb 2014 by admin

How would I write this into the database?

<?php echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>

I tried this:

Code: $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']

$ucheck = mysql_query("SELECT * FROM `shortcuts` WHERE `uid`='".$_SESSION['user_id']."' AND `url`='".$url."'") or die(mysql_error());
Everytime I keep getting errors!

Code: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:inetpubvhostsmymediaupload.comhttpdocsmedia.php on line 279
This is the error I get and it points to a part of my file which I didn't edit, if I remove the above the page works fine?

Other forums