perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wschr...@schroedernet.net
Subject [Fwd: Why doesn't this work?]DUH
Date Wed, 14 Apr 2004 21:00:18 GMT
DUH, if I fail to assign a value to the parameter the page will never know
about it. Sorry, I should have gone for coffee sooner.
Will

---------------------------- Original Message ----------------------------
Subject: Why doesn't this work?
From:    wschroed@schroedernet.net


Date:    Wed, April 14, 2004 12:32 pm
To:      embperl@perl.apache.org
--------------------------------------------------------------------------

HI,
 I have a form that dis.plays different HTML output based on selections
from a  list of dropdown menus. All but the very last work fine. The code
is shown below. I have removed the last if statement and the Execute
works. I have dropped the stats.epl into differnet if staements and that
works. What gives.


Will
<html>


<head>
<title>FireWatch- IPTables Log Display</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
[- use DBI; -]
[- $req = shift;  -]


[- $sth = $req->{DBHandle} -> prepare ("select distinct HostName from
Hosts order by HostName"); -]
[- $sth -> execute; -]


[- $LanChoice = $fdat{LanChoice} -]
[- $HostChoice = $fdat{HostChoice} -]
[- $Event = $fdat{Event} -]

<body bgcolor="#000000" text="#CCCCCC" link="#CCCCCC">
<table width="100%" height="3%"  border="0" cellpadding="0"
cellspacing="0"  id="Header">
  <tr>
  <td width="1%"> </td>
  <td width="5%" align="left" valign="middle" > </td>
  <td width="24%" align="center" valign="middle"> <p>Select
Interface/Direction/HostName or Select Statistics</p> </td>
  <td width="65%" align="left" valign="middle">
<form method="post"  style="background: #000000">

<select name="LanChoice">
<option value="">Interfaces</option>
<option value="External">External Interface</option>
<option value="Internal">Internal Interface</option>
<option value="PSS1">Public Service Segment One</option>
<option value="PSS2">Pubic Service Segment Two</option>
<option value="Fwd">Forwarding</option>
</select>

<select name="Event">
<option value="">Packet Direction on Interface</option>
<option value="Inbnd">Inbound</option>
<option value="Outbnd">Outbound</option>
<option value="Forward">Forward</option>

</select>
<select name="SData">
<option value="">Statistics</option>
<option value="NIC">NIC Data</option>
<option value="Accept">Packets Accepted</option>
<option value="Drop">Packets Dropped</option>
<option value="Reject">Packets Rejected</option>
<option value="Forward">Pakcets Forwarded</option>
</select>
<select name="HostChoice">
<option value="">HostName</option>
[$ while @row = $sth -> fetchrow_array $]
<option value="[+ (@row[0]) +]"> [+ (@row[0]) +] </option>
[$ endwhile $]
</select>
<input type="submit" value="Choose" style="color: #CCCCCC;
background-color: #000000">
</form>
 </td> </tr>
</table>
<table width="100%" height="31%" border="0" cellpadding="0"
cellspacing="1" bgcolor="#000000" id="Tabbed_Cols">
  <tr>
[#----First Time Page
Load----------------------------------------------------------#]
[$ if $LanChoice eq "" &&  $HostChoice eq "" && $Event eq "" && $SData
eq
"" $]
[- Execute ('new.epl') -]
[$ endif $]

[#--------------------------------------------------------------------------------------------------------------------#]

[$ if $LanChoice eq "Fwd" &&  $Event ne "Forward" || $LanChoice ne "Fwd"
&& $Event eq "Forward" $]
<p>Not a valid Combination of Choices: Select Forwarding and Forward from
the Drop Down Menus</p>
[$ endif $]

[$ if $LanChoice eq "Fwd" && $Event eq "Forward" $]

[# forward.epl contains all the links for views on forwarded packets #]

[- Execute ('forward.epl') -]

</tr>
</table>
</body>
</html>
[$ endif $]
[#--------------------------------------------------------------------------------------------------------------------#]

[$ if $LanChoice ne ""  && $Event ne "" && $SData eq "" $]

[# basic.epl contains all the links for views on int/ext interface and
inbound/outbnd packets #]

[- Execute ('basic.epl') -]

</tr>
</table>
</body>
</html>
[$ endif $]
[#--------------------------------------------------------------------------------------------------------------------#]
[$ if $LanChoice eq "" &&  $HostChoice eq "" && $Event eq "" $]

[- Execute ('stats.epl') -]

</tr>
</table>
</body>
</html>
[$ endif $]





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message