Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error 3

Status
Not open for further replies.

Sardamil

Programmer
Apr 14, 2001
77
NL
Sorry to bother you with this, but I've been staring at this code for a few days now and can't find where I went wrong. I'm very new to php, so it might be something basic. Hope you won't mind helping me out.


Parse error: syntax error, unexpected $end in /var/ on line 44

<?php

//Betekent dat er met sessies word gewerkt

session_start();



/* Deze pagina heet: aanwezigcode.php */



//Query opstellen om gegevens uit de database te halen.

$que = "SELECT * FROM wedstrijden;

//Query uitvoeren

$uitvoeren1 = mysql_query($que) or die(mysql_error());

//rij maken zodat je gegevens kan gebruiken

while($rij = mysql_fetch_assoc($uitvoeren1)){



//Echo(laat zien simpel form)

echo '

<form action="aanwezig.php" method="POST">

Ben jij aanwezig bij de wedstrijd op '.htmlenspecialchars($rij['datum']).'?<br>

Thuis '.htmlenspecialchars($rij['thuis']).'!
Uit '.htmlenspecialchars($rij['uit']).'!

<input type="radio" name="aanwezig" value="aanwezig">Aanwezig</input>

<input type="radio" name="aanwezig" value="afwezig">Afwezig</input>

<input type="submit" name="submit" value="Verstuur" />

</form>';



//Even een dingetje opstellen voor de database

$wedstrijdid = $_POST['wedstrijdid'];



//Als form verstuurd is

if( isset($_POST['verstuur'])){



//Connecteren met aanwezigheid

$host = 'xxxxx'; //Host

$gebruikersnaam = 'xxxxx'; //Gebruikersnaam

$wachtwoord = 'xxxxx'; //Wachtwoord

$database = 'xxxxx'; //Naam database



$conn = mysql_connect($host, $gebruikersnaam, $wachtwoord);

mysql_select_db($database) or die(mysql_error());



//Een query maken en beveiligen met mysql_real_escape_string

$query = "UPDATE aanwezigheid SET spelerid='".mysql_real_escape_string($_SESSION['speler'])."', wedstrijdid = '".mysql_real_escape_string($_POST[$wedstrijdid])."'";

$uitvoeren = mysql_query($query) or die(mysql_error());

}

?>

Murphy's Law said:
Anything that can go wrong will go wrong

Window to my world
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top