abhishekphp6 Posted May 5, 2010 Share Posted May 5, 2010 I copy pasted the following php code <?php include('XMPPHP/XMPPHP/XMPP.php'); $conn = new XMPP('talk.google.com', 5222, 'bi.dw.architect@gmail.com', 'pappu617', 'xmpphp', 'gmail.com', printlog=False, $loglevel=LOGGING_INFO); $conn->connect(); $conn->processUntil('session_start'); $conn->message('abhishes@gmail.com', 'this is a test message'); $conn->disconnect(); ?> But it gives me error Parse error: syntax error, unexpected '=' in /var/www/foo.php on line 3 Do I need to install something before using new? I am using ubuntu linux 9.1.0 php 5.2.10-2ubuntu6.4 Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 5, 2010 Share Posted May 5, 2010 It might be $loglevel=LOGGING_INFO but not sure. You might need to install something.. although, I can say.. we aren't google. I can't help you on that one. Although I suggest.. taking your email and password out of the code.. Quote Link to comment Share on other sites More sharing options...
Alex Posted May 5, 2010 Share Posted May 5, 2010 Yeah, that is the problem. If you want to leave out those parameters just leave them blank. $conn = new XMPP('talk.google.com', 5222, 'bi.dw.architect@gmail.com', 'pappu617', 'xmpphp', 'gmail.com'); Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 5, 2010 Share Posted May 5, 2010 Yeah, that is the problem. If you want to leave out those parameters just leave them blank. $conn = new XMPP('talk.google.com', 5222, 'bi.dw.architect@gmail.com', 'pappu617', 'xmpphp', 'gmail.com'); What if he wanted them in? Quote Link to comment Share on other sites More sharing options...
Alex Posted May 5, 2010 Share Posted May 5, 2010 Then he would fill them in. From the looks of the code I'd guess that he copied the function declaration which includes default values for those parameters. Quote Link to comment Share on other sites More sharing options...
abhishekphp6 Posted May 5, 2010 Author Share Posted May 5, 2010 How to edit the message. I have copy pasted my email id and password. I have changed the password... but I want to remove it from here. Quote Link to comment Share on other sites More sharing options...
abhishekphp6 Posted May 5, 2010 Author Share Posted May 5, 2010 Also, can you please download this library from here http://code.google.com/p/xmpphp/ and try to make this code work? for me it simply states that Fatal error: Class 'XMPP' not found in /var/www/XY.php on line 99 I am pretty sure that I have included the path to XMPP.php correctly. Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 5, 2010 Share Posted May 5, 2010 In XY.php, you should have an include include("xmpp.php"); Quote Link to comment Share on other sites More sharing options...
abhishekphp6 Posted May 5, 2010 Author Share Posted May 5, 2010 I have the include statement. include('XMPPHP/XMPPHP/XMPP.php'); Here the file XMPP.php resides in a directory path XMPPHP/XMPPHP under the www directory where the XY.php file resides. I have also kept the case as-is Quote Link to comment Share on other sites More sharing options...
ignace Posted May 5, 2010 Share Posted May 5, 2010 I believe the error occurs due to: printlog=False Which possibly should have been: $printlog=False Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.