Parse error: syntax error, unexpected T_VARIABLE in D:\Softwares\Setups\xampp\htdocs\linkexchangesystem\install\sql\queries.php on line 48 on line 47 $set_config = "INSERT INTO `config` (`code`, `url`, `title`, `require_recip`, `adscode`, `showads`, `nlatest`, `nfeatured`, `showfeatured`, `showlatest`) VALUES on line 48 ('<a href="$_SESSION['form_url']" title="$_SESSION['form_title']">$_SESSION['form_title']</a>', '.$_SESSION['form_url'].', '.$_SESSION['adtitle'].', 'n', '', 'n', 5, 5, 'y', 'y');"; PHP:
Hello, It's because of the " Code (markup): in title="$_SESSION Code (markup): . You should escape and "'s within a string using a backslash (\) so it becomes \" Jay
great, now this error : Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Softwares\Setups\xampp\htdocs\linkexchangesystem\install\sql\queries.php on line 48 $set_config = "INSERT INTO `config` (`code`, `url`, `title`, `require_recip`, `adscode`, `showads`, `nlatest`, `nfeatured`, `showfeatured`, `showlatest`) VALUES ('<a href=\"$_SESSION['form_url']\" title=\"$_SESSION['form_title']\">$_SESSION['form_title']</a>', '.$_SESSION['form_url'].', '.$_SESSION['adtitle'].', 'n', '', 'n', 5, 5, 'y', 'y');"; PHP:
Just use, $set_config = "INSERT INTO `config` (`code`, `url`, `title`, `require_recip`, `adscode`, `showads`, `nlatest`, `nfeatured`, `showfeatured`, `showlatest`) VALUES ('<a href=".$_SESSION['form_url']." title=".$_SESSION['form_title'].">".$_SESSION['form_title']."</a>', '".$_SESSION['form_url']."', '".$_SESSION['adtitle']."', 'n', '', 'n', 5, 5, 'y', 'y');"; PHP:
I'm fairly certain that the problem is that: <a href=".$_SESSION[form_url]." instead of <a href=".$_SESSION['form_url]." T_ENCAPSED_AND_WHITSPACE is almost always a problem dealing with quotations
no wait, it doesnt work. when i write this code: echo $_SESSION['stepname'] . $_SESSION['form_dbhost'] . $_SESSION['form_dbuser'] . $_SESSION['form_dbpass'] . $_SESSION['form_dbname'] . $_SESSION['form_title'] . $_SESSION['form_url']. $_SESSION['form_email'] . $_SESSION['form_username']. $_SESSION['adminuser']. $_SESSION['adminpass'] ; $set_config = "INSERT INTO `config` (`code`, `url`, `title`, `require_recip`, `adscode`, `showads`, `nlatest`, `nfeatured`, `showfeatured`, `showlatest`) VALUES ('<a href=".$_SESSION['form_url']." title=".$_SESSION['form_title'].">".$_SESSION['form_title']."</a>', '".$_SESSION['form_url']."', '".$_SESSION['adtitle']."', 'n', '', 'n', 5, 5, 'y', 'y');"; echo $set_config; PHP: it gives this output : Admin Infohellohttp://xyz.comadmin@pzzz.comtesttestasdasINSERT INTO `config` (`code`, `url`, `title`, `require_recip`, `adscode`, `showads`, `nlatest`, `nfeatured`, `showfeatured`, `showlatest`) VALUES ('', '', '', 'n', '', 'n', 5, 5, 'y', 'y'); Code (markup): so, this code isnt parsing the session variables, while the session variables are already defined.. that means , its an incorrect code.. can anyone else help me please? Edited: Never mind, i fixed it myself.. thanks for help though..