SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Toronto
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help My $_request gets nothing.

    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
    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
    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']; / this line gave me blank!!! i dun understand why.....

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps all of your $get_ should really be $_REQUEST
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    Chessplayer kleineme's Avatar
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    where exactly does $get_['server'] come from? Do you mean $_GET['server']?
    Never ascribe to malice,
    that which can be explained by incompetence.
    Your code should not look unmaintainable, just be that way.

  4. #4
    SitePoint Member
    Join Date
    Sep 2004
    Location
    Toronto
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    omg ty tyt y... i $get_.. i got that form somewhere lol.. tytyty.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •