Problem med at faa current url inserted i mysql
<?phperror_reporting(E_ALL ^ E_NOTICE);
define('IN_SCRIPT',1);
/* Get settings from the settings.php file */
require 'settings.php';
/* get dabase connectiom */
/* Start user session or output an error */
session_name('CCOUNT');
if (!session_start()) {
error('Cannot start a new PHP session. Please contact server administrator or webmaster!');
}
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
echo curPageURL();
echo '<br><br>';
require 'database.php';
$user_id = $settings['user_id'];
mysql_select_db("awc24h_links", $con);
// Insert a row of information into the table "log"
mysql_query("INSERT INTO log
(user_id, url) VALUES(''.$user_id.', 'curPageURL()' ) ")
or die(mysql_error());
// Insert a row of information into the table "example"
// mysql_query("INSERT INTO example
// (name, age) VALUES('Timmy Mellowman', '23' ) ")
// or die(mysql_error());
// mysql_close($con);
?>
Faar foelfende fejl:
Your url is: http://www.awc24h.com/click/installation/geturl.php
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.installation.', 'curPageURL()' )' at line 2