API ring game edit trouble

For discussion of the Poker Mavens server module and other administration topics

API ring game edit trouble

Postby coyote » Mon Aug 30, 2010 7:16 am

I seek to create a form edit table
call the file that way
edit-cash game.php? Name = ring game

I get an error always the same
Error: Ring Game not found
here is my code for the edition

Code: Select all
<?php

  include "API.php"; 
    if (isset($_REQUEST["Name"]))
    
    {

     $NewName = $_REQUEST["NewName"];
      $Game = $_REQUEST["Game"];
     $PW = $_REQUEST["PW"];
     $Private = $_REQUEST["Private"];
     $ObserverChat = $_REQUEST["ObserverChat"];
     $Seats = $_REQUEST["Seats"];
     $BuyInMin = $_REQUEST["BuyInMin"];
     $BuyInMax = $_REQUEST["BuyInMax"];
     $BuyInDef = $_REQUEST["BuyInDef"];
     $Rake = $_REQUEST["Rake"];
     $RakeEvery = $_REQUEST["RakeEvery"];
     $RakeMax = $_REQUEST["RakeMax"];
     $TurnClock = $_REQUEST["TurnClock"];
     $TimeBank = $_REQUEST["TimeBank"];
     $SmallBlind = $_REQUEST["SmallBlind"];
     $BigBlind = $_REQUEST["BigBlind"];
     $Description = $_REQUEST["Description"];
          $Auto = $_REQUEST["Auto"];
     $Name = $_GET["Name"];


  $params = "Password=$pw&Command=RingGamesEdit" .
        "&NewName=" . urlencode($NewName) .
                "&Game=" . urlencode(stripslashes($Game)) .
                "&PW=" . urlencode($PW) .
                "&Private=" . urlencode($Private) .
                "&ObserverChat=" . urlencode($ObserverChat) .
                "&Seats=" . urlencode(stripslashes($Seats)) .
                "&BuyInMin=" . urlencode($BuyInMin) .
                "&BuyInMax=" . urlencode($BuyInMax) .
                "&BuyInDef=" . urlencode($BuyInDef) .
                "&Rake=" . urlencode($Rake) .
                "&RakeEvery=" . urlencode($RakeEvery) .
                "&RakeMax=" . urlencode($RakeMax) .
                "&TurnClock=" . urlencode($TurnClock) .
                "&TimeBank=" . urlencode($TimeBank) .
                "&SmallBlind=" . urlencode($SmallBlind) .
                "&BigBlind=" . urlencode($BigBlind) .
                "&Description=" . urlencode($Description) .
                "&Auto=" . urlencode($Auto) .
       "&Name=" . urlencode($Name) .
      $api = Poker_API($url,$params,true);
      if ($api["Result"] == "Ok") echo "ok";
      else echo "Erreur: " . $api["Error"] . "<br>erreure <a href=\"cash-game.php\">RETOUR</a>.";
      exit;
}

?>


orry for my English translator :roll:
Thank you in advance for any help
coyote
 
Posts: 25
Joined: Wed Sep 30, 2009 4:10 am

Re: API ring game edit trouble

Postby Kent Briggs » Mon Aug 30, 2010 9:49 am

"&Auto=" . urlencode($Auto) .
"&Name=" . urlencode($Name) .
$api = Poker_API($url,$params,true);


One thing I see is you are appending $api to the end of the $params string. That middle line should be this to terminate the statement:

"&Name=" . urlencode($Name);

You might also need to use the stripslashes() function on the name, depending on if it's coming from a form that is escaping reserved html characters.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3805
Joined: Wed Mar 19, 2008 8:47 pm

Re: API ring game edit trouble

Postby coyote » Mon Aug 30, 2010 11:08 am

One thing I see is you are appending $api to the end of the $params string. That middle line should be this to terminate the statement:

"&Name=" . urlencode($Name);

You might also need to use the stripslashes() function on the name, depending on if it's coming from a form that is escaping reserved html characters.


I have to change the line but I still have this error
and even with
Code: Select all
  "&Name=" . urlencode(stripslashes($Name));

I was just a mistake any results
"Erreur: No table name specified"
coyote
 
Posts: 25
Joined: Wed Sep 30, 2009 4:10 am

Re: API ring game edit trouble

Postby Kent Briggs » Mon Aug 30, 2010 11:42 am

coyote wrote:"Erreur: No table name specified"


Are you passing the name via POST? Because your code shows it via GET:

$Name = $_GET["Name"];

Change $_GET to $_REQUEST (which works for both GET and POST) and see if that helps.
Kent Briggs - [email protected]
Briggs Softworks - http://www.briggsoft.com
Kent Briggs
Site Admin
 
Posts: 3805
Joined: Wed Mar 19, 2008 8:47 pm


Return to Site Administration

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests

cron