Re: unexplained parse error



"Matt" <matt@xxxxxxxxx> wrote in message
news:s6bbe.33189$gV.29725@xxxxxxxxxxxxx
> Thanks! It's always the simplist stuff. I took that part out of the HTML
> section and put it in an echo statement. That's why it errored out when
it
> was php code.
>
>
> "Oli Filth" <catch@xxxxxxxxxxxxxx> wrote in message
> news:K%abe.8313$p06.4195@xxxxxxxxxxxxxxxxxxxxxxx
> >>
> >> echo "</select">";
> > ^
> > Here is your error.
> >
>
>

You can simplify your coding too... take notice of using single quotes
instead of escaped double quotes... help keep the confusion down
(single quotes are perfectly fine in HTML):

<?

error_reporting(E_ALL);

//connect to database
require('connect.php');

// drop down menu to choose status filter returns $filter containing filter
data for mysql query

$query = "SELECT * from securitystatus ORDER by status_id";
$result = mysql_query($query);
$num = mysql_num_rows($result);

$i=0;

echo "<form name='form_status' method=post>
Filter by:

<select name='select_form'
onChange='JavaScript:document.form_status.submit()'>

<option></option>";

// list names
while ($i < $num) {

$statusname = mysql_result($result, $i, 'statusname');
$statusnumber = mysql_result($result, $i, 'status_id');

echo "<option value = '$statusnumber'>$statusname</option>";

$i++;

}

echo "</select>";

// creates filter for mysql query to only view necessary
$filter = NULL;

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

$filter = $_POST['select_form'];
$filter = "WHERE status = '$filter'";

}

Norm
FREE Avatar Hosting at www.easyavatar.com


.



Relevant Pages

  • [OT] handling both single and double quotes in HTML text inputs
    ... I know this is slightly off-topic (HTML) but I'll ask anyway. ... At the moment I filter out double quotes from my forms input. ... double quotes here I can embed single quotes, if I use single quotes I ...
    (comp.lang.php)
  • Re: "HTML Source" greyed out in View menu
    ... Your page is absolutely FULL of XML and vector markup language and all ... I can't remember all the settings available in HTML Filter 2, ... That lists all the filter switches you can use if you run the thing from the ... browsers will use the stretchable VML images, ...
    (microsoft.public.word.docmanagement)
  • Re: "HTML Source" greyed out in View menu
    ... Word does not write "HTML". ... Word has always written "XML", ... What HTML Filter 2 does is enable you to control "how much" simplification ... Microsoft MVP, ...
    (microsoft.public.word.docmanagement)
  • ANN: FastReport 3.11 released
    ... Turkish and Arabic languages in the PDF export filter ... verbose output of the server errors in the HTML mode ... fixed the bug of the diagonal line export ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: "HTML Source" greyed out in View menu
    ... not, I should probably use the filter on it, and on my other pages as well. ... Word does not write "HTML". ... sufficient "words" in its vocabulary to describe a Word document. ... Microsoft MVP, ...
    (microsoft.public.word.docmanagement)