Jump to content

need help on setting up variables for my script


pixeltrace

Recommended Posts

guys,

i need help on this. kindly check
[a href=\"http://www.sinagtala.net/sinag3\" target=\"_blank\"]http://www.sinagtala.net/sinag3[/a]

on the sinagtala events section there is a pulldown menu.
what i wanted to happen there is when i select on the category
i will show the lists of events base on its category
but by default, when i am not selecting anything, it will
just show all the lists of events via date
hope you could help me with this because i really need it
badly
=============== - here is the script that i used for the index.php on that section
<? if (!isset($url)) { $url='eventsmain.php';} ?>

<table width="328" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" background="images/eventsheader.gif"><table width="312" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><img src="images/spacer.gif" width="328" height="10"></td>
</tr>
<tr>
<td width="153" valign="top"><img src="images/spacer.gif" width="10" height="18"></td>
<td width="175">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td width="311" height="225" bgcolor="E7E7DD">
<iframe id="eventsmain" src="<?=$url;?>" width=322 height=225 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=yes></iframe></td>
<td width="7"><img src="images/spacer.gif" width="6" height="10"></td>
</tr>
<tr>
<td colspan="3"><table width="328" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="323" align="right" bgcolor="#A2330F">
<table width="196" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" valign="top"><img src="images/spacer.gif" width="10" height="1"></td>
<td width="119" rowspan="3">
<form method="POST" style="margin:0" name="form" action="eventmain.php">
<table width="113" height="14" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="113" align="right" valign="middle">
<select class="sorteventlist" name="list" onFocus="selectedIndex = 0" onChange="if( options[selectedIndex].value != '') document.location = 'index.php?url='+form.list.value">
<option value="javascript:;">------------</option>
<option value="eventsmain.php?id=1">SPONSORED EVENTS</option>
<option value="eventsmain.php?id=2">TOUR EVENTS</option>
<option value="eventsmain.php?id=3">CORPORATE EVENTS</option>
<option value="eventsmain.php?id=4">PRIVATE EVENTS</option>
<option value="eventsmain.php?id=5">PAST EVENTS</option>
</select></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td width="68" class="textwhite">sort list by </td>
<td width="9" valign="top" class="textwhite"><img src="images/spacer.gif" width="3" height="17"></td>
</tr>
<tr>
<td height="2" colspan="2" valign="top"><img src="images/spacer.gif" width="10" height="2"></td>
</tr>
</table></td>
<td width="5"><img src="images/spacer.gif" width="5" height="10"></td>
</tr>
</table></td>
</tr>

<tr>
<td colspan="3"><img src="images/eventsbottom.gif" width="328" height="7"></td>
</tr>
</table>

============= here is the script that i used for the eventsmain.php

<link href="CSS.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #e7e7dd;
}
-->
</style>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<?
include 'db_connect.php';

$uSql = "SELECT event_title, event_description, event_image FROM events ORDER by event_date DESC";
$uResult = mysql_query($uSql, $connection);
if(!$uResult){
echo 'no data found';
}
else{
while($uRow = mysql_fetch_row($uResult)){
if ($id =='1'){ $uSql = '"SELECT event_title, event_description, event_image FROM events WHERE event_type = 'sponsored' DESC";';}
if ($id =='2'){ $uSql = '"SELECT event_title, event_description, event_image FROM events WHERE event_type = 'tour' DESC";';}
if ($id =='3'){ $uSql = '"SELECT event_title, event_description, event_image FROM events WHERE event_type = 'corporate' DESC";';}
if ($id =='4'){ $uSql = '"SELECT event_title, event_description, event_image FROM events WHERE event_type = 'private' DESC";';}
if ($id =='5'){ $uSql = '"SELECT event_title, event_description, event_image FROM events WHERE event_type = 'past' DESC";';}
}?>
<tr>
<td colspan="5"><img src="images/spacer.gif" width="10" height="10" /></td>
</tr>
<tr>
<td width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="10" /></td>
<td width="100" rowspan="2">
<div align="center">
<?
$e_image = '$event_images';
if ($event_image=='1') {$event_images = '';}
else {$event_images = '$uRow[2]';
echo '<table width="100" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666"><tr><td>';
echo "$e_images";
echo "</td></tr></table>";
}?>
</div></td>
<td width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="10" /></td>
<td width="170" align="left"><span class="bodytext3"><?= $uRow[0]?></span></td>
<td width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="10" /></td>
</tr>
<tr>
<td align="left"><span class="bodytext1"><?= $uRow[1]?></span></td>
</tr>
<tr>
<td colspan="5"><img src="images/spacer.gif" width="10" height="10" /></td>
</tr>
</table>
<?
}
}
?>

=================

hope you guys can help me fix this.
thanks in advance!



Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.