Page 1 of 1

API ring game edit trouble

Posted: Mon Aug 30, 2010 7:16 am
by coyote
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

Re: API ring game edit trouble

Posted: Mon Aug 30, 2010 9:49 am
by Kent Briggs
"&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.

Re: API ring game edit trouble

Posted: Mon Aug 30, 2010 11:08 am
by coyote
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"

Re: API ring game edit trouble

Posted: Mon Aug 30, 2010 11:42 am
by Kent Briggs
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.