Connecting Tech Pros Worldwide Forums | Help | Site Map

Help Printing Variable

Newbie
 
Join Date: Jan 2008
Posts: 9
#1: Mar 26 '08
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

Member
 
Join Date: Jul 2006
Posts: 92
#2: Mar 26 '08

re: Help Printing Variable


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
Newbie
 
Join Date: Jan 2008
Posts: 9
#3: Mar 26 '08

re: Help Printing Variable


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

Thanks



Quote:

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

TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 914
#4: Mar 26 '08

re: Help Printing Variable


Quote:

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?
Newbie
 
Join Date: Jan 2008
Posts: 9
#5: Mar 26 '08

re: Help Printing Variable


You were right - There was problem with my function itself


Thanks for help though
Reply


Similar PHP bytes