Syntax error after downloading a php plugin
-
I’ve just downloaded “Allow PHP in Posts and Pages” plugin to allow me to enter php code in wordpress pages.
here’s my php code in my wordpress page:
[php]
$con = mysql_connect(“localhost”, “root”, “abc”);
if (!con)
{
die(‘Could not connect: ‘.mysql_error());
}
mysql_select_db(“wp”, $con);
$sql= “INSERT INTO ‘orderform’ (‘Cake’, ‘Quantity’, ‘Method’, ‘Date’, ‘Title’, ‘Fname’, ‘Lname’, ‘Email’, ‘Phone’, ‘Address’) VALUES (‘”.$Cake.”‘,'”.$Quantity.”‘,'”.$Method.”‘,'”.$Date.”‘,'”.$Title.”‘,'”.$Fname.”‘,'”.$Lname.”‘,'”.$Email.”‘,'”.$Phone.”‘,'”.$Address.”‘);
if (!mysql_query($sql, $con))
{
die(‘Error: ‘.mysql_error());
}
mysql_close($con);
[/php]What I am trying to do is to output user entered data from the form in the wordpress page into mySql database. But I get an error: Parse error: “syntax error, unexpected end of file in C:\xampp\htdocs\wordpress\wp-content\plugins\allow-php-in-posts-and-pages\allowphp.php(373) : eval()’d code on line 14”
- The topic ‘Syntax error after downloading a php plugin’ is closed to new replies.