[PHP] Defining Variables to use with a Function

2002-05-24 Thread chris reeper

Hi how can i set  a variable defining an email address in this function ?

Function SetTo($to)
{
  if (strlen($to)<=0)
return $this->Error(1, '"to" too short');
if (strlen($to)>=129)
return $this->Error(1, '"to" too long');
$this->mailto[]=$to;
return true;
}

-chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Defining Variables to use with a Function

2002-05-24 Thread chris reeper

Ok that works..
but I dont declare the variable and have it read it from a form but..
It can only execpt one email address at a time..
How can i take email address from each line in the form and use that..

I have been trying to adapt this to do it.. but it isnt working for me ?
$lines = split("\n",$response);
foreach($lines as $single_line) echo "$single_line";

thx - Chris

"Patrick Lynch" <[EMAIL PROTECTED]> wrote in message
news:!~!UENERkVCMDkAAQACABgAM/+wtTlkR0mNI0OgSgYDtcKA
[EMAIL PROTECTED]
> You can set a variable in a configuration file containing the email
> address as normal
>
> $to = "[EMAIL PROTECTED]";
>
> In the function, use the global statement to bring the variable into the
> function's scope.
>
> Function SetTo($to)
> {
> global $to;
>   if (strlen($to)<=0)
> return $this->Error(1, '"to" too short');
> if (strlen($to)>=129)
> return $this->Error(1, '"to" too long');
> $this->mailto[]=$to;
> return true;
> }
>
> Best Regards,
> Patrick Lynch.
>
> Optip Ltd, Internet & Mobile Development
> Co. Clare, Ireland.
> http://www.optip.com/
>
>
>
> -Original Message-
> From: chris reeper [mailto:[EMAIL PROTECTED]]
> Sent: 24 May 2002 18:45
> To: [EMAIL PROTECTED]
> Subject: [PHP] Defining Variables to use with a Function
>
>
> Hi how can i set  a variable defining an email address in this function
> ?
>
> Function SetTo($to)
> {
>   if (strlen($to)<=0)
> return $this->Error(1, '"to" too short');
> if (strlen($to)>=129)
> return $this->Error(1, '"to" too long');
> $this->mailto[]=$to;
> return true;
> }
>
> -chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Socks Scripting

2002-05-25 Thread chris reeper

Hi, Is there any good info out there on how to connect to socks servers via
php.
Trying to redo the backend of my site to access a mysql database thats on
the other side of socks5 server. ?

-Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php