I have searched to try to find out what is going on and I can't seem to figure it out.

I am trying to follow an online tutorial for a simple rating system and am having trouble.

here is the code


include 'connect.php'

$id = $_GET['id'];


<form action="rate.php" method="POST">
Choose rating <br>
<select name="rating">

<input type="hidden" name="id" value="<?php echo $id; ?>">

<p />

<input type="submit" name="submit" value="Rate">


Here is the error:

Parse error: syntax error, unexpected T_VARIABLE in /home/ahost307/public_html/domain.com/file/rate.php on line 5

any help. I am trying to pull data from my data base.

Thank you,

6 Years
Discussion Span
Last Post by Stefano Mtangoo

Add semicolon after include

include 'connect.php';

Yep, that is it! Since PHP interprets semicolon as fullstop then line it will interpret as one line, so you are illegally trying to concatenate string and variable without a dot:

include 'connect.php' $id = $_GET['id'];

Thanks, I had been looking and looking and totaly missed that.

Are we solved yet?

Votes + Comments
2 posts - you'll be lucky! :)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.