Help Printing Variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hpandya
    New Member
    • Jan 2008
    • 9

    Help Printing Variable

    Here is my code :

    else if ($_POST['action'] == "getzoom") {

    do something here:::

    $xml = $client->GetMag($getmag );
    echo $xml;
    }

    How do i print this $xml variable in Webpage

    Thanks
  • aktar
    New Member
    • Jul 2006
    • 105

    #2
    What you've done looks fine to me. your problem could lie in the following statement:

    [PHP]$xml = $client->GetMag($getmag );[/PHP]

    If GetMag() returns nothing then $xml will contain nothing.


    Regards

    Comment

    • hpandya
      New Member
      • Jan 2008
      • 9

      #3
      But when i print or alert this Xml variable it shows me undefine what does that mean.

      Thanks



      Originally posted by aktar
      What you've done looks fine to me. your problem could lie in the following statement:

      [PHP]$xml = $client->GetMag($getmag );[/PHP]

      If GetMag() returns nothing then $xml will contain nothing.


      Regards

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Originally posted by hpandya
        But when i print or alert this Xml variable it shows me undefine what does that mean.

        Thanks
        That means that it doesn't exist or is empty. Seeing as you previously defined it, I am presuming it's empty. aktar is right about what he said, so I think you should look into $client->GetMag($getmag );
        If that gives NULL (or nothing) then it is useless. So can you post the code relating to this?

        Comment

        • hpandya
          New Member
          • Jan 2008
          • 9

          #5
          You were right - There was problem with my function itself


          Thanks for help though

          Comment

          Working...