Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

problems with switching php <--> html

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

problems with switching php <--> html

Postby shewien » Mon Oct 14, 2002 7:06 am

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: Select all
  <?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
User avatar
shewien
New php-forum User
New php-forum User
 
Posts: 13
Joined: Wed Sep 25, 2002 6:13 am

Re: problems with switching php <--> html

Postby DoppyNL » Mon Oct 14, 2002 7:17 am

Code: Select all
  <?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
DoppyNL
 


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.