Jump to content

php classes and functions


map200uk

Recommended Posts

Hi,

 

i seem to be having  a bit of trouble calling a function from an if statement?

 

i wanted to do

 

if(action==bla)

$whatever->function(param1,param2)

}

 

but it simply does not get executed

 

http://pastebin.ca/450502

 

 

if($action=="settag")

{

$ID32=new ID3v1x();

$ID32->write_tag(1, "Title Test", "Artist Test", "Album Test", "2004", "Fatih Hood Test", "2", "13","$mp3_file");

echo "\ntestito";

}

 

it echos test but then the write_tag doesnt get executed-yet it works if i call it from somewhere else?

 

Anyone able to shed some light-this has been frying my brain for ages

 

thanks guys

 

mark

Link to comment
https://forums.phpfreaks.com/topic/47951-php-classes-and-functions/
Share on other sites

Well i tested the code myself and from what I can tell the error is somewhere in the ID3v1x.php file for the function write_tag(). Either that or the wrong variables are being passed to it. If i comment out the two lines starting with $ID32 I see the output "testito". So check the that function and make sure it is working or that what you are giving it is correct.

 

if($action == "settag")

{

//$ID32=new ID3v1x();

//$ID32->write_tag(1, "Title Test", "Artist Test", "Album Test", "2004", "Fatih Hood Test", "2", "13","$mp3_file");

echo "\ntestito";

 

}

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.