I'm getting a T_String error in this code:

<?php
//DB Config
define('DB_USER', 'IM HIDING IT');
define('DB_PASS', 'noooo');
define('DB_NAME', 'lol);
define('DB_HOST', 'localhost');
$odb = new PDO('mysql: host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS);

//General Config
$sn = 'Free Source';
$url = 'http://localhost/cupcake/';
//Use that format or CSS will be broken

//Other Configs
if (!empty($_SERVER['HTTP_CF_CONNECTING_IP']))
{
$userIP = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$userIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if(!empty($_SERVER['HTTP_CLIENT_IP']))
{
$userIP = $_SERVER['HTTP_CLIENT_IP'];
}
else
{
$userIP = $_SERVER['REMOTE_ADDR'];
}
?>

Recommended Answers

define('DB_NAME', 'lol);

Count the single quotes in that line.

Jump to Post

All 2 Replies

define('DB_NAME', 'lol);

Count the single quotes in that line.

Hit me in the face :p That i didn't see that -.-

Thanks mate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.