Jump to content

How to pass a variable to a page without loading it.

- - - - -

  • Please log in to reply
1 reply to this topic

#1
jamtraxx

jamtraxx

    Newbie

  • Members
  • Pip
  • 2 posts
Hey guys,

I need a little help cause I cant seem to pass a variable via the URL to another file.

	<?php

		$strDataURL = "xml.php?search={$serial}";

		echo renderChart("FCF_Pie2D.swf", $strDataURL, "", "Graph", 190,160);

	?>


Now on that xml.php file, I do:

<?php

   include("settings/connection.php");

   $serial = $_GET['search'];


   //$strXML will be used to store the entire XML document generated

   //Generate the graph element

   $strXML = "<graph caption='Kiis/Deaths' subCaption='' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>";


         

         $strQuery = "select sum(s_kill) as SoloKills, sum(p_kill) as PartyKills, sum(deaths) as deaths from table where id = {$serial}";

         $result = mysql_query($strQuery) or die(mysql_error());

         $ors = mysql_fetch_array($result);

         //Generate <set name='..' value='..' />

         $strXML .= "<set name='Kills' value='" . $ors['SoloKills'] . "' />";

		 $strXML .= "<set name='Support Kills' value='" . $ors['PartyKills'] . "' />";

		 $strXML .= "<set name='Deaths' value='" . $ors['deaths'] . "' />";

         //free the resultset

         mysql_free_result($result);


   //Finally, close <graph> element

   $strXML .= "</graph>";

   //Set Proper output content-type

   header('Content-type: text/xml');

   echo $strXML;

?>



My issue is, it doesnt seem like the value for search is actually being passed. I have tried some ways that I can possibly do a work around but failed so far. Any help would be appreciated.

#2
jamtraxx

jamtraxx

    Newbie

  • Members
  • Pip
  • 2 posts
Nevermind. Fixed. :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users