ThunderLee Posted November 11, 2009 Share Posted November 11, 2009 How would I write this into the database? <?php echo "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?> I tried this: $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! Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\inetpub\vhosts\mymediaupload.com\httpdocs\media.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?? Link to comment https://forums.phpfreaks.com/topic/181120-solved-problem-writing-url-into-database/ Share on other sites More sharing options...
Adam Posted November 11, 2009 Share Posted November 11, 2009 Missing a semi-colon: $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; // <-- here Link to comment https://forums.phpfreaks.com/topic/181120-solved-problem-writing-url-into-database/#findComment-955583 Share on other sites More sharing options...
ThunderLee Posted November 11, 2009 Author Share Posted November 11, 2009 Thanks for the fast responce, I still get this: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\inetpub\vhosts\mymediaupload.com\httpdocs\media.php on line 279 This is whats around that line.. <tr> <td height="0" width="6" background="images/LL.png" rowspan="3"> </td> <td height="29" width="97" bgcolor="#FFFFFF" valign="top"> <p align="center"> <img src="<?php echo "".$c['display_picture'].""; ?>" height="90" width="90" align="center"></td> <!-- LINE 279 --><td height="29" width="138" bgcolor="#FFFFFF" valign="top"> <div id="content"><b><?php echo "".$c['display_name'].""; ?></b><br> <?php echo date("D d M Y",strtotime($m['dateadded'])); ?><br><br><b>Views:</b> <?php echo "".$m['views'].""; ?><br><b>Rating:</b> <?php echo "".$m['rating'].""; ?><br><b>Media:</b> Music</div></td> <td height="0 width="6" background="images/RR.png" rowspan="3"> </td> </tr> Link to comment https://forums.phpfreaks.com/topic/181120-solved-problem-writing-url-into-database/#findComment-955586 Share on other sites More sharing options...
Adam Posted November 11, 2009 Share Posted November 11, 2009 Why are you adding empty quotes around a variable when you echo it? echo "".$c['display_picture'].""; Could just be: echo $c['display_picture']; Link to comment https://forums.phpfreaks.com/topic/181120-solved-problem-writing-url-into-database/#findComment-955587 Share on other sites More sharing options...
Adam Posted November 11, 2009 Share Posted November 11, 2009 As to avoid editing again, posted fresh! I think the problem lies before this part of the code. Could you post the full code? Link to comment https://forums.phpfreaks.com/topic/181120-solved-problem-writing-url-into-database/#findComment-955590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.