[PHP] cant redeclare class.....

2001-10-20 Thread Sagar

Hi all,

I'm using jm_sms class in mysql 
dowhile($myrow=mysql_fetch_array($result)) loop.
the class is running fine for the first time. But when it is called for the 
second time i'm
getting an error saying cant redeclare the class. How to make this class 
work within
a loop.

i'm attaching the files if u want to look inside.

any help is highly appreciated.

thanks,

/sagar 

HTML
HEAD
TITLE Welcome to SMS reminder . . . . .  /TITLE

/HEAD

BODY
?
$db=mysql_connect(localhost,root,terminator);
mysql_select_db(smsdb,$db);

$da=getdate();
$datestamp=$da[year]-$da[mon]-$da[mday];
$custime= date(H:i);
list($ahour, $amin) = explode(:,$custime);
$sql=select * from sms where taskdate='$datestamp' and hour(tasktime)='$ahour' and 
minute(tasktime)='$amin' and delivered !='Y';
$result=mysql_query($sql);
if($myrow=mysql_fetch_array($result))
{   
// Example script using jm_sms class

$email = [EMAIL PROTECTED];// MTNSMS login email address
$password = rascal;   // MTNSMS password
$number = +91 . $myrow[cellno]; // GSM phone number to send to
$signature = SAGAR SMS;   // Signature for text message
$message = $myrow[smstext];;  // Content of text message
$debug = FALSE; // Debugging messages not displayed

// Add additional accounts if required
// $jm_sms-addLogin( [EMAIL PROTECTED], password2 );
// $jm_sms-addLogin( [EMAIL PROTECTED], password3 );

include( class.jm_sms.php );
$jm_sms = new jm_sms( $email, $password, $debug );

// Add Proxy Server details if required
// $jm_sms-setProxyServer( proxyserver );
// $jm_sms-setProxyPort( 81 );
// $jm_sms-setProxyUser( proxyusername );
// $jm_sms-setProxyPass( proxypassword );
// $jm_sms-setProxy( TRUE );

$jm_sms-sendSMS( $number, $signature, $message );  


}

?
/BODY
/HTML


?

/*
jm_sms 0.7 21/09/01
Copyright (C) 2001 James McGlinn [EMAIL PROTECTED]
jm_sms is a class for sending GSM text messages via the
free web-based service at http://www.mtnsms.com/.
Updates can be found at http://james.mcglinn.org/jm_sms/.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
(See http://www.gnu.org/copyleft/gpl.html)

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Changes:
0.7  21/09/01  Randomised login array for faster sending
  when over quota on first account.
  Speed optimisations in network code
   thanks to Mike Petrov ([EMAIL PROTECTED]).
0.6  06/06/01  Added check for incorrect login details.
0.5  31/05/01  Proxy support added
   thanks to Bas ([EMAIL PROTECTED]).
0.4  28/05/01  Provision for multiple mtnsms accounts.
   Bug fix for accounts defaulting to smsxtra.
0.3  27/04/01  New debug option outputs status data.
0.2  24/04/01  Re-attempts connection if server is busy.
0.1  23/04/01  Initial release.
*/
class jm_sms {

var $server;
var $cookies;
var $login;
var $curUrl;
var $debug = FALSE;
var $proxyServer;
var $proxyPort;
var $proxyUser;
var $proxyPass;
var $proxy = FALSE;

function getServer() { return $this-server; }
function setServer( $server ) { return $this-server = $server; }
function getCurUrl() { return $this-curUrl; }
function setCurUrl( $curUrl ) { return $this-curUrl = $curUrl; }
function getDebug() { return $this-debug; }
function setDebug( $debug ) { return $this-debug = $debug; }
function getProxyServer() { return $this-proxyServer; }
function setProxyServer( $proxyServer ) { return $this-proxyServer = 
$proxyServer; }
function getProxyPort() { return $this-proxyPort; }
function setProxyPort( $proxyPort ) { return $this-proxyPort = $proxyPort; }
function getProxyUser() { return $this-proxyUser; }
function setProxyUser( $proxyUser ) { return $this-proxyUser = $proxyUser; }
function getProxyPass() { return $this-proxyPass; }
function setProxyPass( $proxyPass ) { return $this-proxyPass = $proxyPass; }
function getProxy() { return $this-proxy; }
function setProxy( $proxy ) { return $this-proxy = $proxy; }

function jm_sms( $username, 

[PHP] cant redeclare class......

2001-10-20 Thread Sagar N Chand

Hi all,

I'm using jm_sms class in mysql 
dowhile($myrow=mysql_fetch_array($result)) loop.
the class is running fine for the first time. But when it is called for the 
second time i'm
getting an error saying cant redeclare the class. How to make this class 
work within
a loop.

i'm attaching the files if u want to look inside.

any help is highly appreciated.

thanks,

/sagar 

HTML
HEAD
TITLE Welcome to SMS reminder . . . . .  /TITLE

/HEAD

BODY
?
$db=mysql_connect(localhost,root,terminator);
mysql_select_db(smsdb,$db);

$da=getdate();
$datestamp=$da[year]-$da[mon]-$da[mday];
$custime= date(H:i);
list($ahour, $amin) = explode(:,$custime);
$sql=select * from sms where taskdate='$datestamp' and hour(tasktime)='$ahour' and 
minute(tasktime)='$amin' and delivered !='Y';
$result=mysql_query($sql);
if($myrow=mysql_fetch_array($result))
{   
// Example script using jm_sms class

$email = [EMAIL PROTECTED];// MTNSMS login email address
$password = rascal;   // MTNSMS password
$number = +91 . $myrow[cellno]; // GSM phone number to send to
$signature = SAGAR SMS;   // Signature for text message
$message = $myrow[smstext];;  // Content of text message
$debug = FALSE; // Debugging messages not displayed

// Add additional accounts if required
// $jm_sms-addLogin( [EMAIL PROTECTED], password2 );
// $jm_sms-addLogin( [EMAIL PROTECTED], password3 );

include( class.jm_sms.php );
$jm_sms = new jm_sms( $email, $password, $debug );

// Add Proxy Server details if required
// $jm_sms-setProxyServer( proxyserver );
// $jm_sms-setProxyPort( 81 );
// $jm_sms-setProxyUser( proxyusername );
// $jm_sms-setProxyPass( proxypassword );
// $jm_sms-setProxy( TRUE );

$jm_sms-sendSMS( $number, $signature, $message );  


}

?
/BODY
/HTML


?

/*
jm_sms 0.7 21/09/01
Copyright (C) 2001 James McGlinn [EMAIL PROTECTED]
jm_sms is a class for sending GSM text messages via the
free web-based service at http://www.mtnsms.com/.
Updates can be found at http://james.mcglinn.org/jm_sms/.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
(See http://www.gnu.org/copyleft/gpl.html)

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Changes:
0.7  21/09/01  Randomised login array for faster sending
  when over quota on first account.
  Speed optimisations in network code
   thanks to Mike Petrov ([EMAIL PROTECTED]).
0.6  06/06/01  Added check for incorrect login details.
0.5  31/05/01  Proxy support added
   thanks to Bas ([EMAIL PROTECTED]).
0.4  28/05/01  Provision for multiple mtnsms accounts.
   Bug fix for accounts defaulting to smsxtra.
0.3  27/04/01  New debug option outputs status data.
0.2  24/04/01  Re-attempts connection if server is busy.
0.1  23/04/01  Initial release.
*/
class jm_sms {

var $server;
var $cookies;
var $login;
var $curUrl;
var $debug = FALSE;
var $proxyServer;
var $proxyPort;
var $proxyUser;
var $proxyPass;
var $proxy = FALSE;

function getServer() { return $this-server; }
function setServer( $server ) { return $this-server = $server; }
function getCurUrl() { return $this-curUrl; }
function setCurUrl( $curUrl ) { return $this-curUrl = $curUrl; }
function getDebug() { return $this-debug; }
function setDebug( $debug ) { return $this-debug = $debug; }
function getProxyServer() { return $this-proxyServer; }
function setProxyServer( $proxyServer ) { return $this-proxyServer = 
$proxyServer; }
function getProxyPort() { return $this-proxyPort; }
function setProxyPort( $proxyPort ) { return $this-proxyPort = $proxyPort; }
function getProxyUser() { return $this-proxyUser; }
function setProxyUser( $proxyUser ) { return $this-proxyUser = $proxyUser; }
function getProxyPass() { return $this-proxyPass; }
function setProxyPass( $proxyPass ) { return $this-proxyPass = $proxyPass; }
function getProxy() { return $this-proxy; }
function setProxy( $proxy ) { return $this-proxy = $proxy; }

function jm_sms( $username,