map200uk Posted April 20, 2007 Share Posted April 20, 2007 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 More sharing options...
map200uk Posted April 20, 2007 Author Share Posted April 20, 2007 im sure its something retarded-someone must be able to help!:| Link to comment https://forums.phpfreaks.com/topic/47951-php-classes-and-functions/#findComment-234338 Share on other sites More sharing options...
rikker Posted April 21, 2007 Share Posted April 21, 2007 is it possible for you to post the class function for write_tag? Link to comment https://forums.phpfreaks.com/topic/47951-php-classes-and-functions/#findComment-234376 Share on other sites More sharing options...
rikker Posted April 21, 2007 Share Posted April 21, 2007 nevermind...duh i just saw the link to it all. Link to comment https://forums.phpfreaks.com/topic/47951-php-classes-and-functions/#findComment-234414 Share on other sites More sharing options...
rikker Posted April 21, 2007 Share Posted April 21, 2007 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"; } Link to comment https://forums.phpfreaks.com/topic/47951-php-classes-and-functions/#findComment-234493 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.