i'm passing the variables from the form below:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<HTML>
<HEAD>
<TITLE>Streamware</TITLE>
<script language="JavaScript">
var finalquery=""
var conditionflag=false
function setresol(value)
{
frm=document.aqueryform
str=str = frm.Resolution.options[frm.Resolution.selectedIndex].value
}
function videotype(value)
{
frm=document.aqueryform
str=str = frm.videotype.options[frm.videotype.selectedIndex].value
}
function audiotype(value)
{
frm=document.aqueryform
str=str = frm.audiotype.options[frm.audiotype.selectedIndex].value
}
</script>
</HEAD>
<BODY background=images/ltgray_lines1.gif text=000000>
<center>
<?
$pstreamtype=@$_REQUEST['pstreamtype'];
$pstreamname=@$_REQUEST['pstreamname'];
$pprofile=@$_REQUEST['pprofile'];
$presolution=@$_REQUEST['presolution'];
$pclockrate=@$_REQUEST['pclockrate'];
$pvideopid=@$_REQUEST['pvideopid'];
$ppcrpid=@$_REQUEST['ppcrpid'];
$paudiopid=@$_REQUEST['paudiopid'];
$pvideotype=@$_REQUEST['pvideotype'];
$paudiotype=@$_REQUEST['paudiotype'];
$pac3bitrate=@$_REQUEST['pac3bitrate'];
$pac3mod=@$_REQUEST['pac3mod'];
$psamplerate=@$_REQUEST['psamplerate'];
$sstreamtype=@$_REQUEST['sstreamtype'];
$sstreamname=@$_REQUEST['sstreamname'];
$sprofile=@$_REQUEST['sprofile'];
$sresolution=@$_REQUEST['sresolution'];
$sclockrate=@$_REQUEST['sclockrate'];
$svideopid=@$_REQUEST['svideopid'];
$spcrpid=@$_REQUEST['spcrpid'];
$saudiopid=@$_REQUEST['saudiopid'];
$svideotype=@$_REQUEST['svideotype'];
$saudiotype=@$_REQUEST['saudiotype'];
$sac3bitrate=@$_REQUEST['sac3bitrate'];
$sac3mod=@$_REQUEST['sac3mod'];
$ssamplerate=@$_REQUEST['ssamplerate'];
$query="";
if(isset($all)) {
$query="streamtype,streamname,profile,resolution,clockrate,videopid,pcrpid,audiopid,videotype,audiotype,ac3bitrate,ac3mod,samplerate ";
}
if(isset($saudiotype)) {
$query.="audiotype,";
}
if(isset($svideotype)) {
$query.="videotype,";
}
if(isset($samplerate)) {
$query.="samplerate,";
}
}
$query1=substr($query,0,strlen($query)-1);
?>
<form name="createquery" method="post" action="runquery1.php">
<table border=0 cellpadding=4 cellspacing=1>
<td valign=top align=right><tt><b>Display Fields: </b></td>
<td valign=top>
<?
$qsize=strlen($query1)+1;
if ( $qsize > 66 ) $qsize=66;
echo "<input readonly name=\"query1\" value=$query1 size=$qsize >";
?>
<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
</td>
<?
if(isset($pstreamtype)) {
$db = mysql_connect("localhost", "root", "ramki");
mysql_select_db("streamware",$db);
$username = "root";
$password = "ramki";
$db_name = "streamware";
$hostname = "localhost";
$connection = mysql_connect("$hostname", "$username", "$password") or die("Invalid server or user.");
$db = @mysql_select_db($db_name) or die("Unable to select database");
$query = "SELECT * from type";
$result = mysql_query($query, $connection);
$num = mysql_numrows($result);
; mysql_close();
if ( $num== 0 ) {
mysql_close();
exit;
}
$i=0;
?>
<tr>
<td valign=top align=right><tt><b>Stream Type</b></td>
<td valign=top>
<select name="streamtype">
<?
while ( $i < $num ) {
$name=mysql_result($result,$i,"name");
$id=mysql_result($result,$i,"id");
?>
<option value=<? echo $id ?> ><? echo $name ?></option>
<?
$i++;
}
?>
</select><br>
</td>
<?
}
if(isset($pstreamname)) {
?>
<tr>
<td valign=top align=right><tt><b>Stream Name</b></td>
<td valign=top><input type="text" name="streamname" size="30"><br></td>
</tr>
<?
}
if(isset($pvideopid)) {
?>
<tr>
<td valign=top align=right><tt><b>Video Pid</b></td>
<td valign=top><input type="text" name="videopid" size="6"><br></td>
</tr>
<?
}
if(isset($pvideotype)) {
?>
<tr>
<td valign=top align=right><tt><b>Video Type</b></td>
<td valign=top>
<!-- <input type="text" name="videotype" size="8" onchange="videotype()"> -->
<select name="pvideotype" onchange="setstring(value)">
<option value="select">Select the type...</option>
<option value="MPEG-2 Video">MPEG-2 Video</option>
<option value="MPEG1">MPEG1</option>
<option value="H.264 Video">H.264 Video</option>
</select>
<br></td>
</tr>
<?
}
</TABLE>
</center>
</FORM>
</BODY>
</HTML>
I'm accessing the variables as in the form below:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<HTML>
<HEAD>
</HEAD>
<BODY background=images/ltgray_lines1.gif text=ffffff link=ffffff vlink=ff0000 >
<?php
$streamtype=$_REQUEST['streamtype'];
$streamname=@$_REQUEST['streamname'];
//echo "Streamname is $streamname";
$profile=$_REQUEST['profile'];
$Resolution=$_REQUEST['string'];
//echo "Resolution is $Resolution";
$samplerate=$_REQUEST['samplerate'];
$query= $_REQUEST['query1'];
echo "-------- Query is $query1-------";
$query2="where ";
if($query1=="all" ) {
//$query1="streamtype,streamname,resolution,clockrate,videopid,videotype,pcrpid,audiopid,audiotype,samplerate,ac3mod,ac3bitrate";
$query1="streamname,resolution,videopid,videotype,pcrpid,audiopid,audiotype,samplerate";
}
if (isset($streamid) ) {
$query2=sprintf("%s streamid='%s' and",$query2, $streamtype);
}
if (isset($streamname) ) {
if ($streamname == "" ) $temp="%";
else {
$temp=str_replace(" ","%",$streamname);
$temp=str_replace("*","%",$temp);
}
$query2=sprintf("%s streamname like '%s' and",$query2, $temp);
}
if ( isset($profile) ) {
if ($profile != "") $query2=sprintf("%s profile='%s' and",$query2, $profile);
else $query2=sprintf("%s profile like '%s' and",$query2,"%");
}
if (isset($Resolution) ) {
$temp1=str_replace(" ","%",$Resolution1);
$temp2=str_replace(" ","%",$Resolution2);
$query2=sprintf("%s resolution like '%s%sx%s%s' and",$query2, "%", $temp1, $temp2, "%");
}
if (isset($videotype) ) {
$temp=str_replace(" ","",$videotype);$temp=str_replace("*","%",$temp);
$query2=sprintf("%s videotype like '%s%s%s' and",$query2, "%", $temp, "%");
}
if (isset($audiotype) ) {
$temp=str_replace(" ","",$audiotype);$temp=str_replace("*","%",$temp);
$query2=sprintf("%s audiotype like '%s%s%s' and",$query2, "%", $temp, "%");
}
if (isset($samplerate) ) {
$temp=str_replace(" ","",$samplerate);$temp=str_replace("*","%",$temp);
$query2=sprintf("%s samplerate like '%s%s%s' and",$query2, "%", $temp, "%");
}
$query2=substr($query2,0,strlen($query2)-3);
$query=sprintf("SELECT * from streams %s order by streamname",$query2);
$db = mysql_connect("localhost", "root", "ramki");
mysql_select_db("streamware",$db);
$username = "root";
$password = "rai";
$db_name = "ware";
$hostname = "localhost";
$connection = mysql_connect("$hostname", "$username", "$password")
or die("Invalid Login:".mysql_error());
$db = @mysql_select_db($db_name) or die("Unable to select database:".mysql_error());
$result = mysql_query($query, $connection);
if($result==0)
{
echo "<font color=black><center><h3>Please Check: Your inputs are INVALID</h3></center></font>";
exit;
}
$num=mysql_numrows($result);
if ($num==0)
{
echo"<font color=black><center><h3>No Results Found</h3></center></font>";
exit;
}
if(strlen($query1)<=0)
{
echo "<font color=black><center><h3>No Field Selected</h3></center></font>";
exit;
}
echo "<font color=black><center><h4><b>Total Records Found:$num</b></h4></center></font>";
mysql_close();
$ifields=split(",",$query1);
$i=0;
$bgc="black";
echo "<center><font size=9 face=\"book antiqua\"><table cellspacing=1 border=3><tr bgcolor=000000><th>Sl #</th>";
echo "<th>StreamId</th>";
echo "<th>Directory Path</th>";
echo "<th>Name</th>";
echo "<th>For Details</th>";
foreach($ifields as $field)
{
if ($field=="typeid")
{
}
else
{
if ($field=="streamname")
{
}
else
{
echo "<th>$field</th>";
}
}
}
while ($i<=$num-1)
{
$type=mysql_result($result,$i,"streamid");
$directory=mysql_result($result,$i,"directoryid");
//$type=mysql_result($result,$i,"typeid");
$streamname=mysql_result($result,$i,"streamname");
$streampath=mysql_result($result,$i,"streampath");
$querytype = "SELECT * from type where id=$type";
$resulttype = mysql_query($querytype, $connection);
$typename=mysql_result($resulttype,0,"name");
//$dirname = "SELECT * from directory where id=$directory and typeid=$type";
//$resulttype = mysql_query($dirname, $connection);
//$directoryname=mysql_result($resulttype,0,"name");
echo "<tr bgcolor=$bgc><td>$i</td>";
echo "<td>$type</td>";
echo "<td>$streampath</td>";
echo "<td>$streamname</td>";
echo "<td><a href=\"details.php?type=$type&directory=$streampath&name=$streamname\" target=main>Click Here </a></td>";
foreach($ifields as $field)
{
if ($field=="type" || $field=="streamname" )
{
// Do Nothing.
}
else
{
$value=mysql_result($result,$i,$field);
$Hex="";
if ( $field=="pcrpid" || $field=="audiopid" || $field=="videopid" )
{
if ( hexdec($value) !=0 ) $Hex="0x";
}
else if ( $field=="ac3bitrate" || $field=="samplerate" )
{
if ( $value="0.000000") $value="";
}
echo "<td>$Hex$value</td>";
}
}
$next=$i+1;
if ($i%2==0)
{
$bgc="gray";
}
else
{
$bgc="black";
}
$i++;
}
echo"</table></font></center>";
?>
</BODY>
</HTML>
but i'm unable to access even a single variable, I just don't know why. plz help.