0

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,

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Stefano Mtangoo
0

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'];
1

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.