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

<?php

include 'connect.php'

$id = $_GET['id'];

?>

<form action="rate.php" method="POST">
Choose rating <br>
<select name="rating">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>

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

<p />

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

</form>

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,

Add semicolon after include

include 'connect.php';

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.

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

Are we solved yet?

commented: 2 posts - you'll be lucky! :) +14
Be a part of the DaniWeb community

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