Problem writing URL into database


Posted on 16th Feb 2014 07:03 pm by admin

How would I write this into the database?

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

Did you know?Explore Trending and Topic pages for more stories like this.
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?
No comments posted yet

Your Answer:

Login to answer
247 Like 17 Dislike
Previous forums Next forums
Other forums

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

How to schedule the a job?
Hi,
I have prepared a task ( i.e. a procedure is prepare the file and send the same to con

writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

How to make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

How to show more than 1 users with this code...
Hello,
i have a table that shows users only if I, as Administrator, want to be shown. But its sho

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash