problems with switching php <--> html

A

Anonymous

Guest
This is pretty basic, but I can't figure out where my mistake is.
See my code below. When I run this, the site ignores the whole php-part.

Code:
  <?php
  
} 
mysql_close();
}

else{

  echo ' 
  <html><head><title>Win een DVD</title></head><body bgcolor="#FF9966">

 <p align="center"><font size="5">Je hebt gekozen voor</font><br>
<font size="4">Vul het formulier in en kijk of je deelnemer 50 bent!</p></font>

<?php

	function get_item_from_dvd($_get["keuze"]); 
{ 
if (!@mysql_connect()) return "Fout: geen verbinding met db"; 
if (!@mysql_select_db("indianpearls_nl_db")) return "Fout: kan db niet selecteren"; 
$sql="SELECT item FROM dvd WHERE nr=".$_get["keuze"]"; 
$result=@mysql_query($sql); 
if (!$result) return "Fout: query mislukt".mysql_error().; 		
$row=@mysql_fetch_row($result); 
return $row["item"]; 
echo $sql;

} 

echo ("get_item_from_dvd($_get["keuze"]"); 

?>

 <form method="post" action="testform.php">
 
etc.etc. on html
 
Code:
  <?php
  
} 
mysql_close();
}

else{

  echo ' 
  <html><head><title>Win een DVD</title></head><body bgcolor="#FF9966">

First: those 2 } around mysql_close() don't make any sense to me. also, an mysql_close at the beginning of you're script?!?!

Second thing, you're starting an echo statement (echo ') wich you are not closing, so everything from that point is echo-ed into the file.

Greetz Daan
 
Back
Top