Help My $_request gets nothing.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silentszeto
Forum Newbie
Posts: 3
Joined: Tue Sep 07, 2004 8:24 am

Help My $_request gets nothing.

Post by silentszeto »

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I just started learning PHP for about 1 week or so.. but i learned Pascal at skool last yr with turing so i know only so lil PHP and MYSQL Stuff...
but i dun understand why my $_request won't pass ...i tried printing my values but it prints either nothing or 0.

Please help

Code: Select all

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName"); 

function display ($result) {
$i = 0;
while ($number > $i) {
$thename = mysql_result($result,$i,"Char_Name");
$theemail = mysql_result($result,$i,"HighLevel");
print "<p><b>Name:</b> $thename<br><b>E-Mail:</b>
$theemail</p>";
$i++;}}

switch($_REQUEST['action']){ 
case "hof":{ 
$server= intval($get_['server']);
print "$server";
$class=intval($get_["class"]);
$highlevel=intval($get_["highlevel"]);
$sqlquery = "SELECT * FROM $table WHERE server =$server and Highlevel =$highlevel and Class= $class " ;
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
display ($result) ;}
}
$maximum = "SELECT MAX(highlevel) FROM $table where Report_Status=2";
$result =mysql_query($maximum);
$maxs=mysql_result ($result,  "Highlevel")+1;

$mins=50;

$server=1; 
$maxserver=4;

$mclass=5;


while ($maxs>$mins) { 
for ( $counter = 1; $counter <= 5; $counter ++) {
$sqlquery = "SELECT * FROM $table WHERE server = 1 and Highlevel =$mins and Class =$counter " ;
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

echo "<font face="Arial" color="#FF0000">DEP<a href="hof3.php?action=hof">$number</a></font>";
$sqlquery = "SELECT * FROM $table WHERE server = 2 and Highlevel =$mins and Class =$counter " ;
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

echo "<font face="Arial" color="#FF0000">LOA<a href="hof3.php?action=hof">$number</a></font>";

$sqlquery = "SELECT * FROM $table WHERE server = 3 and Highlevel =$mins and Class =$counter " ;
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

echo "<font face="Arial" color="#00FF00">Ken<a href="hof3.php?action=hof&server=3&highlevel=$mins&class=$counter">$number</a></font>";
echo $_request['server'];
$sqlquery = "SELECT * FROM $table WHERE server = 5 and Highlevel =$mins and Class =$counter " ;
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);

echo "<font face="Arial" color="#0000FF">Test<a href="hof3.php?action=hof">$number</a></font></br>";
}
echo "</br>";
$mins++;

}


?>
Just check

Code: Select all

echo "&lt;font face="Arial" color="#00FF00"&gt;Ken&lt;a href="hof3.php?action=hof&amp;server=3&amp;highlevel=$mins&amp;class=$counter"&gt;$number&lt;/a&gt;&lt;/font&gt;";
echo $_request&#1111;'server']; / this line gave me blank!!!
i dun understand why.....


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Code: Select all

intval($get_['server'])
should be

Code: Select all

intval($_GET['server'])
and $_request should be $_REQUEST (it is case sensitive).

NOTE:Please follow the forum guidelines as use the

Code: Select all

or

Code: Select all

tags, it makes reading the code a lot easier.
Indentation is also useful, especially when checking closing brackets
Last edited by CoderGoblin on Tue Sep 07, 2004 8:46 am, edited 1 time in total.
silentszeto
Forum Newbie
Posts: 3
Joined: Tue Sep 07, 2004 8:24 am

Post by silentszeto »

tytytytyty.
Post Reply