[PHP] Error with Absolute URLs

2003-12-23 Thread Brad
Hi,

I keep getting errors on my websites, that contain absolute URLs, e.g. 
http://www.url.com/blah.html. With most, being in the folder of my 
website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but 
there's a script I use to display the network statistics of an IRC 
network, which is located on a different server, so i can't use the 
$_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to 
this. I'm almost to the stage of just asking the script owner if I can 
have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT'] 
variable.

It was working fine until the server admin updated to PHP 4.3.4, but he 
is not the best with PHP/HTML programming, so he can't help much.

Hope someone can help.

Thanks!

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


[PHP] running python in php timeout

2008-12-29 Thread brad

Hi,

I'm executing a python script from php that runs quite a long time (15+ 
minutes) and ends up timing out. Is there a way I can execute the python 
code and move on executing the remaining php code on the page?

Thanks!

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



[PHP] Eregi error

2007-02-28 Thread Brad


Hey all,
I have been having some trouble with the "eregi" function. I have the 
following piece of code in my application:


   function standard_input($input, $min=0, $max=50){
   if (strlen($input) <= $max and strlen($input) >= $min ) {
   $pattern = '^[a-z0-9\!\_ \.- ,/]*$';
   if(!eregi($pattern, $input)){
   return false;
   }else{
   return true;
   }
   }else{
   return false;
   }
  
   }


And i am running PHP version 5.2.1

I receive the following error:
*Warning*: eregi() [function.eregi 
]: 
REG_ERANGE in *[File Location]* on line *287


*Any ideas what might cause this? Googling REG_ERANGE only showed more 
questions.


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



[PHP] header error without whitespace issue

2007-10-12 Thread Brad
Error =

WARNING: Cannot modify header information - headers already sent by (output
started at /home/zoneof5/public_html/index-dev.html:10) in line 1528 of file
common.inc.php

 

Which comes from me trying to take a login script and put it into an
existing .html file with .htaccess configured to parse php scripts.

 

Research yields that the header needs to be loaded before anything.

The header is being called by another file “common.inc.php”

 

How do I safely extract this call from the existing script and place the
call at the beginning of the .html or just simply fix the error?

 

Php code;

 

 

get_user_payments(intval($_SESSION['_amember_id']), 1);

usort($payments, 'rcmp_begin_date');

$now = date('Y-m-d');

$urls = array();

foreach ($payments as $k=>$v){

if (($v['expire_date'] >= $now) && ($v['begin_date'] <= $now)) {

$p = get_product($v['product_id']);

$url = $p->config['url'];

if (strlen($url)){

$urls[] = $url;

}

}

}

if ($_SESSION['amember_redirect_url']) {

$redirect = $_SESSION['amember_redirect_url'];

unset($_SESSION['amember_redirect_url']);

} elseif (count(array_unique($urls)) == 1){

if (in_array('htpasswd_secure', $plugins['protect'])){

$member_login_pw = 

htpasswd_secure_get_login($_SESSION['_amember_user']['login']).

':'.

htpasswd_secure_get_passwd($_SESSION['_amember_user']['pass']);

$redirect = add_password_to_url($urls[0], $member_login_pw);

} else {

if ($config['display_member_pw_urls']) {

 $member_login_pw = 

 $_SESSION['_amember_user']['login'].

 ':'.

 $_SESSION['_amember_user']['pass'];

 $redirect = add_password_to_url($urls[0], $member_login_pw);

} else {

$redirect = add_password_to_url($urls[0]);

}

}

} else {

$redirect = $config['root_url'] . "/amember/member.php";

}

#print_r($urls);

html_redirect("$redirect", 0, 'Redirect', _LOGIN_REDIRECT);

?>


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.8/1064 - Release Date: 10/11/2007
3:09 PM
 


RE: [PHP] re-post (unanswered) Tables, flash and text

2007-11-07 Thread Brad
Sure thing,

The site is http://www.gaymillionaire.net

You can see that I have a bunch of text underneath the flash animation in
the middle.
I am trying to fill the dead space to the right of it.

In the code, I can see where to widen the table.
One would think that php would fill the dead space if the is nothing
blocking it.
But it is not.

Here is the snippet I think is controlling it.
Just seeking an answer or got reading material to understand it.




loadTemplate("boxes/simple.tpl", false, array('secheader' =>
$this->language['welcome'], 'class' => 'brown'), true); ?>  

http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=7,0,19,0" 
declare="declare" name="gay personals, lesbian dating" 
width="325" height="310" title="flash">


http://www.macromedia.com/go/getflashplayer"; 
type="application/x-shockwave-flash" width="325" height="310">
  

Not a member yet? Please click here to
join 
for FREE or push the button "Join now" below to apply and start networking
with more then
35,000 members of GayMillionaire.net!


-Original Message-
From: Per Jessen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 07, 2007 8:20 AM
To: php-general@lists.php.net
Subject: Re: [PHP] re-post (unanswered) Tables, flash and text

Brad wrote:

> I just picked up an account to fix a website and the code is making no
> sense.

Brad, it's been barely six hours since you first posted that question.  

1) be patient. 
2) it's a lot of code to ask someone else to look at for you.  I would
start by narrowing down the problem/code a bit, then perhaps ask the
question again.


/Per Jessen, Zürich

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


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.23/1113 - Release Date: 11/6/2007
10:04 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.24/1115 - Release Date: 11/7/2007
9:21 AM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-10 Thread Brad
I am not sure that would help.
Just another can of worms.
The $_REQUEST is tied into a whole bunch of database functions.

My present code


link ';
 $headers  = 'MIME-Version: 1.0' . "\r\n";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  mail( $email, "Your FREE book from Zone of Success Club .com",
$headers, $message, "From: $email" );
?>

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 10, 2007 3:44 PM
To: Brad
Subject: Re: [PHP] Cannot send a hyperlink

this will help: http://phpmailer.sourceforge.net/

Brad wrote:
> I am having trouble send an email with a hyperlink
> 
> Php is parsing html as text
> 
> If I add the proper header information to ?make it work? The email no
longer
> goes through?
> 
>  
> 
> Here is the code
> 
>  
> 
>  
>   $email = $_REQUEST['email'] ;
> 
> $body = 'link ';
> 
> $headers  = 'MIME-Version: 1.0' . "\r\n";
> 
>  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
> 
>   mail( $email, "Your FREE book from Zone of Success Club .com",
> 
> $headers, $message, "From: $email" );
> 
> ?>
> 
>  
> 
> Thanks
> 
> Brad
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date:
11/10/2007
> 10:41 AM
>  
> 


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-10 Thread Brad
I am reading up on it now.
I am going to take your advice.

Be prepared for a few questions as I make it past the learning curve!

:o)

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 10, 2007 4:47 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> I am not sure that would help.

I am.

> Just another can of worms.

no, not really, not at all.

> The $_REQUEST is tied into a whole bunch of database functions.

wtf. $_REQUEST is a super global - nothing what so ever to do
with databases.

> 
> My present code
> 

 is about as robust as a soap bubble. in a world where 60-70
of all mail is SPAM how far do you think the crufty output your generating
is going to get? my guess is generally just as far as /dev/null
on the recipient machine.

which is why I suggested a mailer class that is known to work and wraps
up all the tricky crap (and protects you from making stupid mistakes like
opening up the mail() function to mail header injection attacks.

most people will probably be using a DB as the source of dynamic content
for generated emails, your situation is nothing special in that regard.

> 
>$email = $_REQUEST['email'] ;

oh yeah and taking the 'to' email address from the request is just asking
for your script to be turned into spambot.

>   $message = 'link ';
>  $headers  = 'MIME-Version: 1.0' . "\r\n";
>  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
>   mail( $email, "Your FREE book from Zone of Success Club .com",
> $headers, $message, "From: $email" );
> ?>
> 
> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, November 10, 2007 3:44 PM
> To: Brad
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> this will help: http://phpmailer.sourceforge.net/
> 

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-10 Thread Brad
Explanation of code

$email = $_REQUEST['email'] ;
(generated by dreamweaver that pulls in the database functions)

$message = 'link ';
(my nemesis, I can not figure out this puppy. If it works at all, php will
generate it at text and not html. Taken from example I find on the web.)

$headers  = 'MIME-Version: 1.0' . "\r\n";  $headers .= 'Content-type:
text/html; charset=iso-8859-1' . "\r\n";
(found on the web to solve my html problem???)

mail( $email, "Your FREE book from Zone of Success Club .com", $headers,
$message, "From: $email" ); ?>
(Send the mail, when I put $headers in, the function quits working all
together.)

I hope this helps explain where my head is!

Brad


-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 10, 2007 4:55 PM
To: Brad
Cc: 'Jochem Maas'; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> I am not sure that would help.
> Just another can of worms.
> The $_REQUEST is tied into a whole bunch of database functions.

I have no idea what you mean by this. It makes no sense to me.

> My present code
> 
> 
>$email = $_REQUEST['email'] ;
>   $message = 'link ';
>  $headers  = 'MIME-Version: 1.0' . "\r\n";
>  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
>   mail( $email, "Your FREE book from Zone of Success Club .com",
> $headers, $message, "From: $email" );
> ?>

You *really* need to read the manual page for function before you use 
them. For example a quick glance at http://php.net/function.mail reveals 
that you have the parameters in an almost completely wrong order.

And please tell me you're not really setting the to address directly 
from an external variable with verifying that it's just an email address 
and nothing else. Really bad idea.

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, November 10, 2007 3:44 PM
> To: Brad
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> this will help: http://phpmailer.sourceforge.net/
> 
> Brad wrote:
>> I am having trouble send an email with a hyperlink
>>
>> Php is parsing html as text
>>
>> If I add the proper header information to ?make it work? The email no
> longer
>> goes through?
>>
>>  
>>
>> Here is the code
>>
>>  
>>
>> >
>>   $email = $_REQUEST['email'] ;
>>
>> $body = 'link ';
>>
>> $headers  = 'MIME-Version: 1.0' . "\r\n";
>>
>>  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
>>
>>   mail( $email, "Your FREE book from Zone of Success Club .com",
>>
>> $headers, $message, "From: $email" );
>>
>> ?>
>>
>>  
>>
>> Thanks
>>
>> Brad
>>
>>
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition. 
>> Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date:
> 11/10/2007
>> 10:41 AM
>>  
>>
> 
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date:
11/10/2007
> 10:41 AM
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date:
11/10/2007
> 10:41 AM

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.28/1122 - Release Date: 11/10/2007
10:41 AM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-14 Thread Brad
I implemented the proposed code, and emails are not being sent?

Any suggestions?

Here is the code

".$eol;
  $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
  $headers .= "X-Mailer: PHP ".phpversion().$eol;
  $msg .= "--".$htmlalt_mime_boundary.$eol;
  $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
  $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
  $body.='link ';
  $msg .= $body.$eol.$eol;
  mail($to, $subject, $msg, $headers);

?>

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 11, 2007 7:43 AM
To: 'M. Sokolewicz'
Cc: 'Brad'; php-general@lists.php.net
Subject: RE: [PHP] Cannot send a hyperlink

Brad I'm sorry.

Instead of insulting you and telling you to go read a book I simply
explained an option. 

Yes you do not need quotes in the mail() function.

As for the declared variables I was trying to show you an example. 

You will find many explanations for how or what is best practice.
Remember that some people like to toot a horn that can be reputed in many
ways. These are the same people who again and again are not the ones who
answer the questions, yet try to take credit by belittling the answer with
gibberish. 
The answer was intended to take you in a better direction when constructing
a email application in php.
 
  $eol="\r\n";
  $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
  $headers .= "X-Mailer: PHP v".phpversion().$eol;
  $msg .= "--".$htmlalt_mime_boundary.$eol;
  $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
  $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
  $msg .= $body.$eol.$eol;
  mail($to, $subject, $msg, $headers);





-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Sunday, November 11, 2007 4:07 AM
To: [EMAIL PROTECTED]
Cc: 'Brad'; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

[EMAIL PROTECTED] wrote:
> The Answer is quiet simple.
> 
> 
> $E_MAIL = "[EMAIL PROTECTED]";
> $to  = "[EMAIL PROTECTED]";
> $headers  = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "To: Their Name<[EMAIL PROTECTED]> \r\n";
> $headers .= "From: your email <[EMAIL PROTECTED]>\r\n";
> $link = "http://www.zoneofsuccessclub.com";;
> $mailmsg = "BLAH BLAH BLAH link:zoneofsuccessclub";
> $mailsubject = "what ever you want to say";

Well, anyone doing this:
> mail("$E_MAIL", "$mailsubject", "$mailmsg", "$headers");
makes ME very unhappy. I don't get it, what's so hard to understand 
about NOT HAVING TO USE ANY QUOTES HERE ? Are you defining any type of 
string-like values here? no. Then you don't need quotes, right? no, you 
don't. SO DON'T USE THEM HERE THEN.
You're defining a $to and an $E_MAIL, you're not using $to anywhere, and 
only using $E_MAIL in one place (out of two), thus creating a mismatch 
between your headers and the To parameter for mail (which is used in 
SMTP traffic). [iz bad (tm)]

- Tul

> 
> 
> 
> You can use the database to generate the $E_MAIL address and the $to
> Never Ever had this to not work.
> Your problem is the Headers are missing which allows the html content to
> embed into the email.
> 
> Try that I think you will be happy.
> 
> 
> 
> 
> -Original Message-
> From: Brad [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, November 10, 2007 2:36 PM
> To: php-general@lists.php.net
> Subject: [PHP] Cannot send a hyperlink
> 
> I am having trouble send an email with a hyperlink
> 
> Php is parsing html as text
> 
> If I add the proper header information to ?make it work? The email no
longer
> goes through?
> 
>  
> 
> Here is the code
> 
>  
> 
>  
>   $email = $_REQUEST['email'] ;
> 
> $body = 'link ';
> 
> $headers  = 'MIME-Version: 1.0' . "\r\n";
> 
>  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
&g

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
Hm,
Still no hyperlink?

$email = $_REQUEST['email'] ;
$fromaddress .= '[EMAIL PROTECTED]';
$fromname .= 'Zone of success Club';
$eol="\r\n";
$headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol; $headers .=
"--".$htmlalt_mime_boundary.$eol; $headers .= "Content-Type: text/html;
charset=iso-8859-1".$eol; $headers .= "Content-Transfer-Encoding:
8bit".$eol.$eol; $body = "http://www.zoneofsuccessclub.com\";>link
\n"; mail($email, $subject, $body, $headers);

Produces and email that does this.

--
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit



http://www.zoneofsuccessclub.com";>link 

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM




-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 11:09 AM
To: Brad
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad,

That code is a mess and highly incorrect, even at a novice level.
Let me give you a hand

On Nov 14, 2007 10:31 AM, Brad <[EMAIL PROTECTED]> wrote:
> I implemented the proposed code, and emails are not being sent?
>
> Any suggestions?
>
> Here is the code
>
> 
>   $email = $_REQUEST['email'] ;
>   $eol="\r\n";
>   $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>   $headers .= "X-Mailer: PHP ".phpversion().$eol;
>   $msg .= "--".$htmlalt_mime_boundary.$eol;
>   $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>   $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>   $body.='link ';
>   $msg .= $body.$eol.$eol;
>   mail($to, $subject, $msg, $headers);
>
> ?>

[snip]

1.) You reference $to in the mail() function, but there is no $to
defined.  Instead, either change $email to $to or vice-versa.
2.) You don't need to start the first line of a variable off with
a .= --- this will append to an existing variable of the same name, if
it exists.
3.) You change your quoting style where it's not necessary.  All
$msg lines should be using double quotes in your code above.
4.) ".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "--".$htmlalt_mime_boundary.$eol;
$headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body = "http://www.zoneofsuccessclub.com\";>link \n";
mail($email, $subject, $body, $headers);
?>

Prior to asking a bunch of questions on the list, which seriously
puts you at risk for being flamed or ignored, check out these
references:
http://www.bath.ac.uk/bucs/email/anatomy.shtml  [Anatomy of an
Email Message]
http://www.php.net/mail  [PHP Mail Functions]
http://www.htmlgoodies.com/primers/html/  [Beginner's Guide to HTML]

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.31/1128 - Release Date: 11/13/2007
11:09 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
We are sending email now,
But we are back to the original problem,
No hyperlink!

  $email = $_REQUEST['email'] ;
  $fromaddress .= '[EMAIL PROTECTED]';
  $fromname .= 'Zone of success Club';
  $eol="\r\n";
  $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
  $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
  $headers .= "X-Mailer: PHP v".phpversion().$eol;
  $msg .= "--".$htmlalt_mime_boundary.$eol;
  $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
  $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
  $body.= 'http://www.zoneofsuccessclub.com'">link ';
  $msg .= $body.$eol.$eol;
  mail($email, $subject, $msg, $headers);


Yields

Parse error: parse error, unexpected T_STRING in
/home/zoneof5/public_html/index.php on line 76

-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 11:09 AM
To: Brad
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad,

That code is a mess and highly incorrect, even at a novice level.
Let me give you a hand

On Nov 14, 2007 10:31 AM, Brad <[EMAIL PROTECTED]> wrote:
> I implemented the proposed code, and emails are not being sent?
>
> Any suggestions?
>
> Here is the code
>
> 
>   $email = $_REQUEST['email'] ;
>   $eol="\r\n";
>   $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>   $headers .= "X-Mailer: PHP ".phpversion().$eol;
>   $msg .= "--".$htmlalt_mime_boundary.$eol;
>   $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>   $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>   $body.='link ';
>   $msg .= $body.$eol.$eol;
>   mail($to, $subject, $msg, $headers);
>
> ?>

[snip]

1.) You reference $to in the mail() function, but there is no $to
defined.  Instead, either change $email to $to or vice-versa.
2.) You don't need to start the first line of a variable off with
a .= --- this will append to an existing variable of the same name, if
it exists.
3.) You change your quoting style where it's not necessary.  All
$msg lines should be using double quotes in your code above.
4.) ".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "--".$htmlalt_mime_boundary.$eol;
$headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body = "http://www.zoneofsuccessclub.com\";>link \n";
mail($email, $subject, $body, $headers);
?>

Prior to asking a bunch of questions on the list, which seriously
puts you at risk for being flamed or ignored, check out these
references:
http://www.bath.ac.uk/bucs/email/anatomy.shtml  [Anatomy of an
Email Message]
http://www.php.net/mail  [PHP Mail Functions]
http://www.htmlgoodies.com/primers/html/  [Beginner's Guide to HTML]

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.31/1128 - Release Date: 11/13/2007
11:09 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
Still parsing as text and not html!

http://www.zoneofsuccessclub.com";>link 
//http://www.zoneofsuccessclub.com";>link 

$email = $_REQUEST['email'] ;
$fromaddress .= '[EMAIL PROTECTED]';
$fromname .= 'Zone of success Club';
$eol="\r\n";
$headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$body .= "--".$htmlalt_mime_boundary.$eol;
$body .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$body .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body = "http://www.zoneofsuccessclub.com\";>link \n";
mail($email, $subject, $body, $headers);

-Original Message-
From: Per Jessen [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 9:48 AM
To: php-general@lists.php.net
Subject: RE: [PHP] Cannot send a hyperlink

Brad wrote:

> Beginning with
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> It starts to read it as text and not html??
> 
> Could this be a server side problem?

Nope.

> $email = $_REQUEST['email'] ;
> $fromaddress .= '[EMAIL PROTECTED]';
> $fromname .= 'Zone of success Club';
> $eol="\r\n";
> $headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
> $headers .= "X-Mailer: PHP ".phpversion().$eol;
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> $headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> $headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
> $body = "http://www.zoneofsuccessclub.com\";>link \n";

You have a MIME boundary where it doesn't belong.  MIME boundaries are
for the body, not the header. 


/Per Jessen, Zürich

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
No access to the server command line to install it!
And, I am into this guy too deep to switch technologies. For the next time
around, no problem, this time I am just trying to get php to do what it is
supposed to do.

The suggestion of mime was presented to me from another kind sole trying to
help that knows more than I and recommended on other help files.

Why is php refusing to parse as html?

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 9:46 AM
To: Brad
Cc: 'Daniel Brown'; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> Beginning with 
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> It starts to read it as text and not html??
> 
> Could this be a server side problem?
> 
> $email = $_REQUEST['email'] ;
> $fromaddress .= '[EMAIL PROTECTED]';
> $fromname .= 'Zone of success Club';
> $eol="\r\n";
> $headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
> $headers .= "X-Mailer: PHP ".phpversion().$eol;
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> $headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> $headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
> $body = "http://www.zoneofsuccessclub.com\";>link \n";
> mail($email, $subject, $body, $headers);

You should not have a mime boundary in your headers. Why not use 
PHPMailer? All this (apparently) complicated stuff is already 
implemented for you. Either that or spend a few days learning about the 
structure of emails by following the links Daniel Brown sent you a few 
emails ago.

PHPMailer can be found here: http://phpmailer.sf.net/

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Daniel Brown [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 14, 2007 11:09 AM
> To: Brad
> Cc: [EMAIL PROTECTED]; php-general@lists.php.net
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> Brad,
> 
> That code is a mess and highly incorrect, even at a novice level.
> Let me give you a hand
> 
> On Nov 14, 2007 10:31 AM, Brad <[EMAIL PROTECTED]> wrote:
>> I implemented the proposed code, and emails are not being sent?
>>
>> Any suggestions?
>>
>> Here is the code
>>
>> >
>>   $email = $_REQUEST['email'] ;
>>   $eol="\r\n";
>>   $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>>   $headers .= "X-Mailer: PHP ".phpversion().$eol;
>>   $msg .= "--".$htmlalt_mime_boundary.$eol;
>>   $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>>   $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>>   $body.='link ';
>>   $msg .= $body.$eol.$eol;
>>   mail($to, $subject, $msg, $headers);
>>
>> ?>
> 
> [snip]
> 
> 1.) You reference $to in the mail() function, but there is no $to
> defined.  Instead, either change $email to $to or vice-versa.
> 2.) You don't need to start the first line of a variable off with
> a .= --- this will append to an existing variable of the same name, if
> it exists.
> 3.) You change your quoting style where it's not necessary.  All
> $msg lines should be using double quotes in your code above.
> 4.)  5.) You have things in the message body that should be in the headers.
> 6.) You don't need to do a carriage return and newline in the
> message body.  A simple \n will suffice.
> 7.) I'm not sure what you hoped to achieve with the
> "'.www.domain.com.'" conglomerate, but don't.  That makes PHP
> think that the domain is some sort of internally-defined variable of
> horrible construct.
> 8.) You should use http:// prior to the FQDN.
> 
> Taking hints from what appears to be your code, this is how it should
> be:
>  $email = $_REQUEST['email'] ;
> $eol="\r\n";
> $headers  = "From: ".$fromname."<".$fr

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
Beginning with 
$headers .= "--".$htmlalt_mime_boundary.$eol;
It starts to read it as text and not html??

Could this be a server side problem?

$email = $_REQUEST['email'] ;
$fromaddress .= '[EMAIL PROTECTED]';
$fromname .= 'Zone of success Club';
$eol="\r\n";
$headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "--".$htmlalt_mime_boundary.$eol;
$headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body = "http://www.zoneofsuccessclub.com\";>link \n";
mail($email, $subject, $body, $headers);

-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 14, 2007 11:09 AM
To: Brad
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad,

That code is a mess and highly incorrect, even at a novice level.
Let me give you a hand

On Nov 14, 2007 10:31 AM, Brad <[EMAIL PROTECTED]> wrote:
> I implemented the proposed code, and emails are not being sent?
>
> Any suggestions?
>
> Here is the code
>
> 
>   $email = $_REQUEST['email'] ;
>   $eol="\r\n";
>   $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>   $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>   $headers .= "X-Mailer: PHP ".phpversion().$eol;
>   $msg .= "--".$htmlalt_mime_boundary.$eol;
>   $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>   $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>   $body.='link ';
>   $msg .= $body.$eol.$eol;
>   mail($to, $subject, $msg, $headers);
>
> ?>

[snip]

1.) You reference $to in the mail() function, but there is no $to
defined.  Instead, either change $email to $to or vice-versa.
2.) You don't need to start the first line of a variable off with
a .= --- this will append to an existing variable of the same name, if
it exists.
3.) You change your quoting style where it's not necessary.  All
$msg lines should be using double quotes in your code above.
4.) ".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "--".$htmlalt_mime_boundary.$eol;
$headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$body = "http://www.zoneofsuccessclub.com\";>link \n";
mail($email, $subject, $body, $headers);
?>

Prior to asking a bunch of questions on the list, which seriously
puts you at risk for being flamed or ignored, check out these
references:
http://www.bath.ac.uk/bucs/email/anatomy.shtml  [Anatomy of an
Email Message]
http://www.php.net/mail  [PHP Mail Functions]
http://www.htmlgoodies.com/primers/html/  [Beginner's Guide to HTML]

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.31/1128 - Release Date: 11/13/2007
11:09 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
Thank you so much!

It worked like a champ first try!
I would have never seen that and have been looking everywhere on the net for
a working example!

Funny thing is, right after is work perfectly twice, my database crashed!

But, this is the technology we play with!

Problem solved and I am going to post this code on the php website for
others to reference!

Thank you!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 10:16 AM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> No access to the server command line to install it!
> And, I am into this guy too deep to switch technologies. For the next time
> around, no problem, this time I am just trying to get php to do what it is
> supposed to do.

You don't need command line access to install it. PHPMailer consists of 
PHP only - nothing to install but PHP files. See here: 
http://phpmailer.sourceforge.net/install.php

> The suggestion of mime was presented to me from another kind sole trying
to
> help that knows more than I and recommended on other help files.
> 
> Why is php refusing to parse as html?

And here lies the basic problem. PHP is *not* the thing that's refusing 
to parse it as HTML. Since you don't know that you really should do a 
lot of reading before you try sending HTML emails without using 
something like PHPMailer.

For beeps and farts I've "fixed" your code, but even though it will now 
"work" it is nowhere near the right way to send this type of email, but 
my life is probably going to be too short to tell you what you could 
easily find out yourself.

$email = $_REQUEST['email'];
$fromaddress = '[EMAIL PROTECTED]';
$fromname = 'Zone of success Club';
$eol = "\r\n";
$headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'X-Mailer: PHP '.phpversion().$eol;
$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$headers .= 'Content-Transfer-Encoding: 8bit';
$subject = 'This is my spam, worship me';
$body = 'http://www.zoneofsuccessclub.com/";>link';
mail($email, $subject, $body, $headers);

Some *important* notes...

* I defined $subject because it tries to use it.
* You don't need to provide the MessageID - your mail server will do 
that for you... correctly.
* You don't need to add two carriage returns at the end of the headers - 
PHP will do that for you.
* This email will be in HTML only which makes it a lot more likely to 
get flagged as spam.
* If you're on a unix-based platform you really should be using the 5th 
parameter to mail, but that's probably going to confuse the hell out of 
you so I won't mention it. D'oh!
* This code is not secure. It's trivial to inject headers (and a body 
too) into the message. You should be validating that $_REQUEST['email'] 
is a valid email address and just a valid email address.

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 15, 2007 9:46 AM
> To: Brad
> Cc: 'Daniel Brown'; php-general@lists.php.net
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> Brad wrote:
>> Beginning with 
>> $headers .= "--".$htmlalt_mime_boundary.$eol;
>> It starts to read it as text and not html??
>>
>> Could this be a server side problem?
>>
>> $email = $_REQUEST['email'] ;
>> $fromaddress .= '[EMAIL PROTECTED]';
>> $fromname .= 'Zone of success Club';
>> $eol="\r\n";
>> $headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
>> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>> $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>> $headers .= "X-Mailer: PHP ".phpversion().$eol;
>> $headers .= "--".$htmlalt_mime_boundary.$eol;
>> $headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>> $headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>> $body = "http://www.zoneofsuccessclub.com\";>link \n";
>> mail($email, $subject, $body, $headers);
> 
> You should not have a mime boundary in your headers. Why not use 
> PHPMailer? All this (apparently) complicated stuff is already 
> implemented for you. Either that or spend a few days learning about the 
> structure of emails by following the links Daniel Brown sent you a few 
> emails ago.
> 
> PHPMailer can be found here: http://phpmailer.sf.net/
> 
> -Stut
> 

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
Not a single reference to sending a hyperlink on that page!

-Original Message-
From: Dimiter Ivanov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 11:27 AM
To: Brad
Cc: Stut; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

On Nov 15, 2007 5:34 PM, Brad <[EMAIL PROTECTED]> wrote:
> Thank you so much!
>
> It worked like a champ first try!
> I would have never seen that and have been looking everywhere on the net
for
> a working example!
>
> Funny thing is, right after is work perfectly twice, my database crashed!
>
> But, this is the technology we play with!
>
> Problem solved and I am going to post this code on the php website for
> others to reference!
>
> Thank you!
>

I think there is already a good example of sending mails with html :
http://php.net/manual/en/function.mail.php

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
No problem!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 10:37 AM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> Thank you so much!
> 
> It worked like a champ first try!
> I would have never seen that and have been looking everywhere on the net
for
> a working example!
> 
> Funny thing is, right after is work perfectly twice, my database crashed!
> 
> But, this is the technology we play with!
> 
> Problem solved and I am going to post this code on the php website for
> others to reference!

If you do please don't mention me. This might work but as I said in my 
email (which you clearly read very carefully!) it's not the right way to 
do it.

Please pay particular notice to my last "important note" below... THIS 
CODE IS NOT SECURE. It's easily used as a mail relay script, so please 
don't use it in production or $DEITY will kill a bunch of kittens.

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 15, 2007 10:16 AM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> Brad wrote:
>> No access to the server command line to install it!
>> And, I am into this guy too deep to switch technologies. For the next
time
>> around, no problem, this time I am just trying to get php to do what it
is
>> supposed to do.
> 
> You don't need command line access to install it. PHPMailer consists of 
> PHP only - nothing to install but PHP files. See here: 
> http://phpmailer.sourceforge.net/install.php
> 
>> The suggestion of mime was presented to me from another kind sole trying
> to
>> help that knows more than I and recommended on other help files.
>>
>> Why is php refusing to parse as html?
> 
> And here lies the basic problem. PHP is *not* the thing that's refusing 
> to parse it as HTML. Since you don't know that you really should do a 
> lot of reading before you try sending HTML emails without using 
> something like PHPMailer.
> 
> For beeps and farts I've "fixed" your code, but even though it will now 
> "work" it is nowhere near the right way to send this type of email, but 
> my life is probably going to be too short to tell you what you could 
> easily find out yourself.
> 
> $email = $_REQUEST['email'];
> $fromaddress = '[EMAIL PROTECTED]';
> $fromname = 'Zone of success Club';
> $eol = "\r\n";
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> $headers .= 'Content-Transfer-Encoding: 8bit';
> $subject = 'This is my spam, worship me';
> $body = 'http://www.zoneofsuccessclub.com/";>link';
> mail($email, $subject, $body, $headers);
> 
> Some *important* notes...
> 
> * I defined $subject because it tries to use it.
> * You don't need to provide the MessageID - your mail server will do 
> that for you... correctly.
> * You don't need to add two carriage returns at the end of the headers - 
> PHP will do that for you.
> * This email will be in HTML only which makes it a lot more likely to 
> get flagged as spam.
> * If you're on a unix-based platform you really should be using the 5th 
> parameter to mail, but that's probably going to confuse the hell out of 
> you so I won't mention it. D'oh!
> * This code is not secure. It's trivial to inject headers (and a body 
> too) into the message. You should be validating that $_REQUEST['email'] 
> is a valid email address and just a valid email address.
> 
> -Stut
> 

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date: 11/14/2007
4:54 PM
 

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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Brad
My bad,
You do not need command line access!
I should have read more.

I just need to get this puppy working is all.
Php should be able to do this by it's self!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 9:46 AM
To: Brad
Cc: 'Daniel Brown'; php-general@lists.php.net
Subject: Re: [PHP] Cannot send a hyperlink

Brad wrote:
> Beginning with 
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> It starts to read it as text and not html??
> 
> Could this be a server side problem?
> 
> $email = $_REQUEST['email'] ;
> $fromaddress .= '[EMAIL PROTECTED]';
> $fromname .= 'Zone of success Club';
> $eol="\r\n";
> $headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
> $headers .= "X-Mailer: PHP ".phpversion().$eol;
> $headers .= "--".$htmlalt_mime_boundary.$eol;
> $headers .= "Content-Type: text/html; charset=iso-8859-1".$eol;
> $headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
> $body = "http://www.zoneofsuccessclub.com\";>link \n";
> mail($email, $subject, $body, $headers);

You should not have a mime boundary in your headers. Why not use 
PHPMailer? All this (apparently) complicated stuff is already 
implemented for you. Either that or spend a few days learning about the 
structure of emails by following the links Daniel Brown sent you a few 
emails ago.

PHPMailer can be found here: http://phpmailer.sf.net/

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Daniel Brown [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 14, 2007 11:09 AM
> To: Brad
> Cc: [EMAIL PROTECTED]; php-general@lists.php.net
> Subject: Re: [PHP] Cannot send a hyperlink
> 
> Brad,
> 
> That code is a mess and highly incorrect, even at a novice level.
> Let me give you a hand
> 
> On Nov 14, 2007 10:31 AM, Brad <[EMAIL PROTECTED]> wrote:
>> I implemented the proposed code, and emails are not being sent?
>>
>> Any suggestions?
>>
>> Here is the code
>>
>> >
>>   $email = $_REQUEST['email'] ;
>>   $eol="\r\n";
>>   $headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
>>   $headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
>>   $headers .= "X-Mailer: PHP ".phpversion().$eol;
>>   $msg .= "--".$htmlalt_mime_boundary.$eol;
>>   $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
>>   $msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
>>   $body.='link ';
>>   $msg .= $body.$eol.$eol;
>>   mail($to, $subject, $msg, $headers);
>>
>> ?>
> 
> [snip]
> 
> 1.) You reference $to in the mail() function, but there is no $to
> defined.  Instead, either change $email to $to or vice-versa.
> 2.) You don't need to start the first line of a variable off with
> a .= --- this will append to an existing variable of the same name, if
> it exists.
> 3.) You change your quoting style where it's not necessary.  All
> $msg lines should be using double quotes in your code above.
> 4.)  5.) You have things in the message body that should be in the headers.
> 6.) You don't need to do a carriage return and newline in the
> message body.  A simple \n will suffice.
> 7.) I'm not sure what you hoped to achieve with the
> "'.www.domain.com.'" conglomerate, but don't.  That makes PHP
> think that the domain is some sort of internally-defined variable of
> horrible construct.
> 8.) You should use http:// prior to the FQDN.
> 
> Taking hints from what appears to be your code, this is how it should
> be:
>  $email = $_REQUEST['email'] ;
> $eol="\r\n";
> $headers  = "From: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
> $headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eo

[PHP] two small issues with php mail

2007-11-19 Thread Brad
Implementing Bcc and smtp.

 

#1 email is only being sent to a few recipients.

I need to implement 

$smtp = ‘localhost’; 

Somewhere, but I keep getting parse errors?

 

#2 trying to do a Bcc but that gives me parse errors as well

It should be as easy as?

$Bcc [EMAIL PROTECTED]; $eol = "\r\n";

 

Here is the working code, but if I implement the above needed inserts
anywhere, I get a big ‘ol fat parse error

 

Any assistance would be truly appreciated.

An explanation of why would really help since this is for a school project.

 

Working code as is:

 

'.$eol;

// $headers = 'bcc: '[EMAIL PROTECTED]';

$headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;

$headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;

$headers .= 'X-Mailer: PHP '.phpversion().$eol;

$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;

$headers .= 'Content-Transfer-Encoding: 8bit';

$subject = 'Your free book!';

$body = 'http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
ME"  Here is your FREE autopilot book';

mail($email, $subject, $body, $headers);

?>


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 


RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
$headers = 'bcc: [EMAIL PROTECTED]';

Works but corrupts the "from" portion and changes it to "nobody"
Which I think goes back too the smtp portion.
Let me try that!

Thank you!

-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 12:49 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.
> 
>  
> 
> #1 email is only being sent to a few recipients.
> 
> I need to implement 
> 
> $smtp = ‘localhost’; 

if the previous line is a cut/paste, it looks like you are using M$ special
quotes or back tics maybe.

make sure they are single or double quotes and you should be good to go.

> 
> Somewhere, but I keep getting parse errors?
> 
>  
> 
> #2 trying to do a Bcc but that gives me parse errors as well
> 
> It should be as easy as?
> 
> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";
> 
>  
> 
> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
> 
>  
> 
> Any assistance would be truly appreciated.
> 
> An explanation of why would really help since this is for a school
project.
> 
>  
> 
> Working code as is:
> 
>  
> 
>  
> $email = $_REQUEST['email'];
> 
> $fromaddress = '[EMAIL PROTECTED]';
> 
> $fromname = 'Zone of success Club'; $eol = "\r\n";
> 
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> // $headers = 'bcc: '[EMAIL PROTECTED]';
You have an extra single quote in the previous line.  Hence your parse
error.

> 
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> 
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> 
> $headers .= 'Content-Transfer-Encoding: 8bit';
> 
> $subject = 'Your free book!';
> 
> $body = ' href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
> ME"  Here is your FREE autopilot book';
> 
> mail($email, $subject, $body, $headers);
> 
> ?>
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  
> 


-- 
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
 by William Shakespeare

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
No parse error, but still "nobody".

Here is my new code.

How do you tell the difference between the need for '' and ""?

Working "kind of" code

'.$eol;
$headers = 'bcc: [EMAIL PROTECTED]';
$headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'X-Mailer: PHP '.phpversion().$eol;
$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$headers .= 'Content-Transfer-Encoding: 8bit';
$subject = 'Your free book!';
$body = 'http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
ME"  Here is your FREE autopilot book';
mail($email, $subject, $body, $headers);
?>



-Original Message-
From: Brad [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 1:26 PM
To: 'Jim Lucas'
Cc: php-general@lists.php.net
Subject: RE: [PHP] two small issues with php mail

$headers = 'bcc: [EMAIL PROTECTED]';

Works but corrupts the "from" portion and changes it to "nobody"
Which I think goes back too the smtp portion.
Let me try that!

Thank you!

-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 12:49 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.
> 
>  
> 
> #1 email is only being sent to a few recipients.
> 
> I need to implement 
> 
> $smtp = ‘localhost’; 

if the previous line is a cut/paste, it looks like you are using M$ special
quotes or back tics maybe.

make sure they are single or double quotes and you should be good to go.

> 
> Somewhere, but I keep getting parse errors?
> 
>  
> 
> #2 trying to do a Bcc but that gives me parse errors as well
> 
> It should be as easy as?
> 
> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";
> 
>  
> 
> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
> 
>  
> 
> Any assistance would be truly appreciated.
> 
> An explanation of why would really help since this is for a school
project.
> 
>  
> 
> Working code as is:
> 
>  
> 
>  
> $email = $_REQUEST['email'];
> 
> $fromaddress = '[EMAIL PROTECTED]';
> 
> $fromname = 'Zone of success Club'; $eol = "\r\n";
> 
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> // $headers = 'bcc: '[EMAIL PROTECTED]';
You have an extra single quote in the previous line.  Hence your parse
error.

> 
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> 
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> 
> $headers .= 'Content-Transfer-Encoding: 8bit';
> 
> $subject = 'Your free book!';
> 
> $body = ' href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
> ME"  Here is your FREE autopilot book';
> 
> mail($email, $subject, $body, $headers);
> 
> ?>
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  
> 


-- 
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
 by William Shakespeare

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Apperently my smtp portion is "not" working.
This did not solve my problem of sending email to only 50% of the
recipients, just no parse error
This is what the php mail manual page suggest?

And

Where should the bcc go if not the header?



-Original Message-
From: Per Jessen [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 1:55 PM
To: php-general@lists.php.net
Subject: RE: [PHP] two small issues with php mail

Brad wrote:

> $headers = 'bcc: [EMAIL PROTECTED]';
> 
> Works but corrupts the "from" portion and changes it to "nobody"
> Which I think goes back too the smtp portion.

There is no bcc: header. BCC'ing someone is normally done by sending
them the email without listing them explicitly in to: or cc:.


/Per Jessen, Zürich

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


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
PHP mailer is not in the assignment and will be counted against me!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 3:43 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.

"Here we go again"

> #1 email is only being sent to a few recipients.
> 
> I need to implement 
> 
> $smtp = ‘localhost’; 
> 
> Somewhere, but I keep getting parse errors?

Those are not normal quotes, but I'm guessing you actually typed that in 
the evil that is Outlook.

> #2 trying to do a Bcc but that gives me parse errors as well
> 
> It should be as easy as?
> 
> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";

That's not valid code. Ok, the second bit is, but still rather pointless.

> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
> 
> Any assistance would be truly appreciated.
> 
> An explanation of why would really help since this is for a school
project.

Ahh, suddenly everything becomes clear. You can't use PHPMailer because 
that would mean that you didn't learn it yourself you just used somebody 
elses work. So instead you ask here rather than reading the PHPMailer 
source code. Nice.

> Working code as is:
> 
>  
> $email = $_REQUEST['email'];
> 
> $fromaddress = '[EMAIL PROTECTED]';
> 
> $fromname = 'Zone of success Club'; $eol = "\r\n";
> 
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> // $headers = 'bcc: '[EMAIL PROTECTED]';

This should work. However, because you're assigning this to $headers 
rather than concatenating it you're trampling over the From line above.

BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
problems but has the potential to stop it working.

> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> 
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> 
> $headers .= 'Content-Transfer-Encoding: 8bit';
> 
> $subject = 'Your free book!';
> 
> $body = ' href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
> ME"  Here is your FREE autopilot book';

"Click ME" indeed. I'm guessing this isn't an HCI course you're doing.

> mail($email, $subject, $body, $headers);
> 
> ?>

Try the veal.

-Stut

-- 
http://stut.net/

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
This information is pulled directly off the php website when used for other
applications, so if I am wrong, then so are they.

As for php mailer, my professor explained it very well today,
Learn the in's and out's of the programming and it's quarks to understand
the logic and then he will show us the tricks.

Yes, here we go again!

I am just seeking valid knowledge and understanding. Reading material is
great too as long as it is relevant.

Sarcasm does not help with the learning curve sir!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 3:43 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.

"Here we go again"

> #1 email is only being sent to a few recipients.
> 
> I need to implement 
> 
> $smtp = ‘localhost’; 
> 
> Somewhere, but I keep getting parse errors?

Those are not normal quotes, but I'm guessing you actually typed that in 
the evil that is Outlook.

> #2 trying to do a Bcc but that gives me parse errors as well
> 
> It should be as easy as?
> 
> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";

That's not valid code. Ok, the second bit is, but still rather pointless.

> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
> 
> Any assistance would be truly appreciated.
> 
> An explanation of why would really help since this is for a school
project.

Ahh, suddenly everything becomes clear. You can't use PHPMailer because 
that would mean that you didn't learn it yourself you just used somebody 
elses work. So instead you ask here rather than reading the PHPMailer 
source code. Nice.

> Working code as is:
> 
>  
> $email = $_REQUEST['email'];
> 
> $fromaddress = '[EMAIL PROTECTED]';
> 
> $fromname = 'Zone of success Club'; $eol = "\r\n";
> 
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> // $headers = 'bcc: '[EMAIL PROTECTED]';

This should work. However, because you're assigning this to $headers 
rather than concatenating it you're trampling over the From line above.

BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
problems but has the potential to stop it working.

> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> 
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> 
> $headers .= 'Content-Transfer-Encoding: 8bit';
> 
> $subject = 'Your free book!';
> 
> $body = ' href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
> ME"  Here is your FREE autopilot book';

"Click ME" indeed. I'm guessing this isn't an HCI course you're doing.

> mail($email, $subject, $body, $headers);
> 
> ?>

Try the veal.

-Stut

-- 
http://stut.net/

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
This is why I am on this mailing instead of the php site for their mailer
which is utterly useless!

I could probably recite the entire page by heart and gained nothing compared
to the insight and reading material offered by this list.

Just seeking knowledgeable guidance!

Any assistance on methods to solve my issue would be duly appreciated!

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 4:17 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> This information is pulled directly off the php website when used for
other
> applications, so if I am wrong, then so are they.
> 
> As for php mailer, my professor explained it very well today,
> Learn the in's and out's of the programming and it's quarks to understand
> the logic and then he will show us the tricks.

I wouldn't call PHPMailer a trick as such, but your professor is 
absolutely right about learning the in's and out's of programming. 
Unfortunately your posts so far have demonstrated that you haven't yet 
grasped the syntactic basics yet but it doesn't seem to bother you.

> Yes, here we go again!
> 
> I am just seeking valid knowledge and understanding. Reading material is
> great too as long as it is relevant.

The use of BCC with the PHP mail function is pretty well-explained on 
the PHP manual page for said function.

> Sarcasm does not help with the learning curve sir!

You will find that if you read my reply carefully the answers you seek 
are in there. I rarely answer a question with sarcasm alone, but I'm a 
little ashamed to say that it does happen occasionally.

I hang about on this list for entertainment. I get that from helping 
people and mocking those I think deserve it. If you don't like it feel 
free to ignore me or add me to your kill list, but don't ask me to stop.

-Stut

-- 
http://stut.net/

> -Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 3:43 PM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> Brad wrote:
>> Implementing Bcc and smtp.
> 
> "Here we go again"
> 
>> #1 email is only being sent to a few recipients.
>>
>> I need to implement 
>>
>> $smtp = ‘localhost’; 
>>
>> Somewhere, but I keep getting parse errors?
> 
> Those are not normal quotes, but I'm guessing you actually typed that in 
> the evil that is Outlook.
> 
>> #2 trying to do a Bcc but that gives me parse errors as well
>>
>> It should be as easy as?
>>
>> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";
> 
> That's not valid code. Ok, the second bit is, but still rather pointless.
> 
>> Here is the working code, but if I implement the above needed inserts
>> anywhere, I get a big ‘ol fat parse error
>>
>> Any assistance would be truly appreciated.
>>
>> An explanation of why would really help since this is for a school
> project.
> 
> Ahh, suddenly everything becomes clear. You can't use PHPMailer because 
> that would mean that you didn't learn it yourself you just used somebody 
> elses work. So instead you ask here rather than reading the PHPMailer 
> source code. Nice.
> 
>> Working code as is:
>>
>> >
>> $email = $_REQUEST['email'];
>>
>> $fromaddress = '[EMAIL PROTECTED]';
>>
>> $fromname = 'Zone of success Club'; $eol = "\r\n";
>>
>> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
>>
>> // $headers = 'bcc: '[EMAIL PROTECTED]';
> 
> This should work. However, because you're assigning this to $headers 
> rather than concatenating it you're trampling over the From line above.
> 
> BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
> problems but has the potential to stop it working.
> 
>> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
>>
>> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
>>
>> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
>>
>> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
>>
>> $headers .= 'Content-Transfer-Encoding: 8bit';
>>
>> $subject = 'Your free book!';
>>
>> $body = '> href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
>> ME"  Here is your FREE autopilot book';
> 
> "Click ME" indeed. I'm guessing this isn't an HCI course you're doing.
> 
>> mail($email, $subject, $body, $headers);
>>
>> ?>
> 
> Try the veal.
> 
> -Stut

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Well, since

http://forums.hostmysite.com/about1171.html

states

$headers .= "CC: [EMAIL PROTECTED]";

Which does not work for me AT ALL and Stut called me a [EMAIL PROTECTED] for 
doing
it, I am assuming that all this key wording on google is not going to and
the problem appears to be else where!



-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 4:39 PM
To: Brad
Cc: php-general@lists.php.net; 'Stut'
Subject: RE: [PHP] two small issues with php mail

Since it is not in the assignment, find out how to do things within the
parameters of your assignment.

http://www.google.com
php: {issue}

Googling "PHP: mail bcc" (sans quotes) has 5 viable workings on how to do
it.  If it fails, then you need to be examing the php.ini file for
information or talking with the server admins as to what piece is wrong.
Also, if you are error checking your own stuff, then the error log should be
able to tell you what has failed out.

I'm glad your professor is teaching you how to learn, but shouldn't this be
something you should be able to do already?  

And wasn't this whole thing started with you looking for something that you
were "already too much money into" to change for the next roll-out?  So now
you are fessing up to trying to get the PHP board to do your assignments for
you?

I sure hope your instructor is on this board too...

Wolf

 Brad <[EMAIL PROTECTED]> wrote: 
> PHP mailer is not in the assignment and will be counted against me!
> 
> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 3:43 PM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> Brad wrote:
> > Implementing Bcc and smtp.
> 
> "Here we go again"
> 
> > #1 email is only being sent to a few recipients.
> > 
> > I need to implement 
> > 
> > $smtp = ‘localhost’; 
> > 
> > Somewhere, but I keep getting parse errors?
> 
> Those are not normal quotes, but I'm guessing you actually typed that in 
> the evil that is Outlook.
> 
> > #2 trying to do a Bcc but that gives me parse errors as well
> > 
> > It should be as easy as?
> > 
> > $Bcc [EMAIL PROTECTED]; $eol = "\r\n";
> 
> That's not valid code. Ok, the second bit is, but still rather pointless.
> 
> > Here is the working code, but if I implement the above needed inserts
> > anywhere, I get a big ‘ol fat parse error
> > 
> > Any assistance would be truly appreciated.
> > 
> > An explanation of why would really help since this is for a school
> project.
> 
> Ahh, suddenly everything becomes clear. You can't use PHPMailer because 
> that would mean that you didn't learn it yourself you just used somebody 
> elses work. So instead you ask here rather than reading the PHPMailer 
> source code. Nice.
> 
> > Working code as is:
> > 
> >  > 
> > $email = $_REQUEST['email'];
> > 
> > $fromaddress = '[EMAIL PROTECTED]';
> > 
> > $fromname = 'Zone of success Club'; $eol = "\r\n";
> > 
> > $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> > 
> > // $headers = 'bcc: '[EMAIL PROTECTED]';
> 
> This should work. However, because you're assigning this to $headers 
> rather than concatenating it you're trampling over the From line above.
> 
> BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
> problems but has the potential to stop it working.
> 
> > $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> > 
> > $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> > 
> > $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> > 
> > $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> > 
> > $headers .= 'Content-Transfer-Encoding: 8bit';
> > 
> > $subject = 'Your free book!';
> > 
> > $body = ' >
href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf";>"Click
> > ME"  Here is your FREE autopilot book';
> 
> "Click ME" indeed. I'm guessing this isn't an HCI course you're doing.
> 
> > mail($email, $subject, $body, $headers);
> > 
> > ?>
> 
> Try the veal.
> 
> -Stut
> 
> -- 
> http://stut.net/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/u

RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
You say

> The use of BCC with the PHP mail function is pretty well-explained on 
> the PHP manual page for said function.

I say,

No it doesn't, I tried everything on that page and it either parse error'ed
or didn't work.

The php manual page goes from baby basics to crazy smtp authentication
processes with a snippet of my issue "which when extracted" does not work.
When add lib is added, it does not work, when the entire code piece is
extracted, it does not work, when attempted to clean it up and cater to my
environment, it parse errors.

How about a relational examination or how they got from point a to point d?

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 4:41 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> This is why I am on this mailing instead of the php site for their mailer
> which is utterly useless!
> 
> I could probably recite the entire page by heart and gained nothing
compared
> to the insight and reading material offered by this list.
> 
> Just seeking knowledgeable guidance!
> 
> Any assistance on methods to solve my issue would be duly appreciated!

Once again... my reply contained everything you needed to get your code 
to work properly. Please read it again.

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 4:17 PM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> Brad wrote:
>> This information is pulled directly off the php website when used for
> other
>> applications, so if I am wrong, then so are they.
>>
>> As for php mailer, my professor explained it very well today,
>> Learn the in's and out's of the programming and it's quarks to understand
>> the logic and then he will show us the tricks.
> 
> I wouldn't call PHPMailer a trick as such, but your professor is 
> absolutely right about learning the in's and out's of programming. 
> Unfortunately your posts so far have demonstrated that you haven't yet 
> grasped the syntactic basics yet but it doesn't seem to bother you.
> 
>> Yes, here we go again!
>>
>> I am just seeking valid knowledge and understanding. Reading material is
>> great too as long as it is relevant.
> 
> The use of BCC with the PHP mail function is pretty well-explained on 
> the PHP manual page for said function.
> 
>> Sarcasm does not help with the learning curve sir!
> 
> You will find that if you read my reply carefully the answers you seek 
> are in there. I rarely answer a question with sarcasm alone, but I'm a 
> little ashamed to say that it does happen occasionally.
> 
> I hang about on this list for entertainment. I get that from helping 
> people and mocking those I think deserve it. If you don't like it feel 
> free to ignore me or add me to your kill list, but don't ask me to stop.
> 
> -Stut

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
I am very much aware of phpinfo()
Which has nothing to do with being able to edit the php.ini file!

-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 4:59 PM
To: Brad; php-general
Subject: RE: [PHP] two small issues with php mail

1.  Always copy the list back
2.  HERE is the right word you want, since you can't HEAR someone's on email
or when reading the system files.  Maybe you should take English & Grammar
101 for your next course.
3.  Who says you need access to the server backend...  Google phpinfo() - >
very basic,  ALL books say to make this page when verifying PHP is installed
correctly.

I didn't assume anything, merely followed the threads.  And since from the
looks of things the thread has not changed, the back-story has...  Well draw
your own conclusions there.

Wolf

 Brad <[EMAIL PROTECTED]> wrote: 
> Wolf write!
> ###
> Since it is not in the assignment, find out how to do things within the
> parameters of your assignment.
> 
> http://www.google.com
> php: {issue}
> 
> Googling "PHP: mail bcc" (sans quotes) has 5 viable workings on how to do
> it.  If it fails, then you need to be examing the php.ini file for
> information or talking with the server admins as to what piece is wrong.
> 
> ##
> 
> Me
> 
> No access to the server backend!
> 
> #
>   Also, if you are error checking your own stuff, then the error log
should
> be able to tell you what has failed out.
> 
> ###
> Me
> 
> Doing it, but since these are situational and specific to my problem
alone,
> I am batting zero and now on the list!
> 
> 
> I'm glad your professor is teaching you how to learn, but shouldn't this
be
> something you should be able to do already?  
> 
> And wasn't this whole thing started with you looking for something that
you
> were "already too much money into" to change for the next roll-out?  So
now
> you are fessing up to trying to get the PHP board to do your assignments
for
> you?
> 
> ###
> Me
> 
> You are assuming hear and one guarantee about assumptions is that they are
> 99% incorrect.
> 
> ##
> 
> I sure hope your instructor is on this board too...
> 
> Wolf
>  

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
 mod_auth_passthrough/2.1 mod_bwlimited/1.4 PHP/5.2.2 
_SERVER["SERVER_NAME"] www.zoneofsuccessclub.com 
_SERVER["SERVER_ADDR"] 206.71.52.104 
_SERVER["SERVER_PORT"] 80 
_SERVER["REMOTE_ADDR"] 66.176.174.125 
_SERVER["DOCUMENT_ROOT"] /home/zoneof5/public_html 
_SERVER["SERVER_ADMIN"] [EMAIL PROTECTED] 
_SERVER["SCRIPT_FILENAME"] /home/zoneof5/public_html/temp.php 
_SERVER["REMOTE_PORT"] 1929 
_SERVER["GATEWAY_INTERFACE"] CGI/1.1 
_SERVER["SERVER_PROTOCOL"] HTTP/1.1 
_SERVER["REQUEST_METHOD"] GET 
_SERVER["QUERY_STRING"] no value 
_SERVER["REQUEST_URI"] /temp.php 
_SERVER["SCRIPT_NAME"] /temp.php 
_SERVER["PHP_SELF"] /temp.php 
_SERVER["REQUEST_TIME"] 1195510732 
_SERVER["argv"] Array
(
)
 
_SERVER["argc"] 0 
_ENV["CPANEL"] active 
_ENV["USER"] root 
_ENV["LD_LIBRARY_PATH"] /usr/local/apache/lib: 
_ENV["PATH"] /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin 
_ENV["PWD"] / 
_ENV["WHM50"] 10.8.0 
_ENV["SHLVL"] 1 
_ENV["HOME"] /root 
_ENV["RESTARTSRV"] 1 
_ENV["_"] /usr/local/apache/bin/httpd

-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 5:15 PM
To: Brad
Cc: php-general@lists.php.net
Subject: RE: [PHP] two small issues with php mail

I didn't say TO edit the php.ini file, but it will tell you what the setup
of said server is, including compiled in pieces and smtp settings.

Are you aware of .htaccess files?  google override php.ini using .htaccess
and you should get some good hits there.  But then that is probably outside
the scope of your assignment.  However some professors see that as
insightful, YMMV.

Wolf


 Brad <[EMAIL PROTECTED]> wrote: 
> I am very much aware of phpinfo()
> Which has nothing to do with being able to edit the php.ini file!
> 
> -Original Message-
> From: Wolf [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 4:59 PM
> To: Brad; php-general
> Subject: RE: [PHP] two small issues with php mail
> 
> 1.  Always copy the list back
> 2.  HERE is the right word you want, since you can't HEAR someone's on
email
> or when reading the system files.  Maybe you should take English & Grammar
> 101 for your next course.
> 3.  Who says you need access to the server backend...  Google phpinfo() -
>
> very basic,  ALL books say to make this page when verifying PHP is
installed
> correctly.
> 
> I didn't assume anything, merely followed the threads.  And since from the
> looks of things the thread has not changed, the back-story has...  Well
draw
> your own conclusions there.
> 
> Wolf
> 
>  Brad <[EMAIL PROTECTED]> wrote: 
> > Wolf write!
> > ###
> > Since it is not in the assignment, find out how to do things within the
> > parameters of your assignment.
> > 
> > http://www.google.com
> > php: {issue}
> > 
> > Googling "PHP: mail bcc" (sans quotes) has 5 viable workings on how to
do
> > it.  If it fails, then you need to be examing the php.ini file for
> > information or talking with the server admins as to what piece is wrong.
> > 
> > ##
> > 
> > Me
> > 
> > No access to the server backend!
> > 
> > #
> >   Also, if you are error checking your own stuff, then the error log
> should
> > be able to tell you what has failed out.
> > 
> > ###
> > Me
> > 
> > Doing it, but since these are situational and specific to my problem
> alone,
> > I am batting zero and now on the list!
> > 
> > 
> > I'm glad your professor is teaching you how to learn, but shouldn't this
> be
> > something you should be able to do already?  
> > 
> > And wasn't this whole thing started with you looking for something that
> you
> > were "already too much money into" to change for the next roll-out?  So
> now
> > you are fessing up to trying to get the PHP board to do your assignments
> for
> > you?
> > 
> > ###
> > Me
> > 
> > You are assuming hear and one guarantee about assumptions is that they
are
> > 99% incorrect.
> > 
> > ##
> > 
> > I sure hope your instructor is on this board too...
> > 
> > Wolf
> >  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
As per your email!

#

Brad wrote:

> $headers = 'bcc: [EMAIL PROTECTED]';
> 
> Works but corrupts the "from" portion and changes it to "nobody"
> Which I think goes back too the smtp portion.

There is no bcc: header. BCC'ing someone is normally done by sending them
the email without listing them explicitly in to: or cc:.


/Per Jessen, Zürich



-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 5:18 PM
To: Brad
Cc: 'Wolf'; php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> Well, since
> 
> http://forums.hostmysite.com/about1171.html
> 
> states
> 
> $headers .= "CC: [EMAIL PROTECTED]";
> 
> Which does not work for me AT ALL and Stut called me a [EMAIL PROTECTED] for 
> doing
> it, I am assuming that all this key wording on google is not going to and
> the problem appears to be else where!

I don't believe I did that at all (if I did can someone else please let 
me know - it's never my intention).

Since you don't seem willing to properly read my original reply to you, 
the one with the answer in it, I give up. I wish your professor luck.

-Stut

-- 
http://stut.net/

> -Original Message-
> From: Wolf [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 4:39 PM
> To: Brad
> Cc: php-general@lists.php.net; 'Stut'
> Subject: RE: [PHP] two small issues with php mail
> 
> Since it is not in the assignment, find out how to do things within the
> parameters of your assignment.
> 
> http://www.google.com
> php: {issue}
> 
> Googling "PHP: mail bcc" (sans quotes) has 5 viable workings on how to do
> it.  If it fails, then you need to be examing the php.ini file for
> information or talking with the server admins as to what piece is wrong.
> Also, if you are error checking your own stuff, then the error log should
be
> able to tell you what has failed out.
> 
> I'm glad your professor is teaching you how to learn, but shouldn't this
be
> something you should be able to do already?  
> 
> And wasn't this whole thing started with you looking for something that
you
> were "already too much money into" to change for the next roll-out?  So
now
> you are fessing up to trying to get the PHP board to do your assignments
for
> you?
> 
> I sure hope your instructor is on this board too...
> 
> Wolf
> 
>  Brad <[EMAIL PROTECTED]> wrote: 
>> PHP mailer is not in the assignment and will be counted against me!
>>
>> -Original Message-
>> From: Stut [mailto:[EMAIL PROTECTED] 
>> Sent: Monday, November 19, 2007 3:43 PM
>> To: Brad
>> Cc: php-general@lists.php.net
>> Subject: Re: [PHP] two small issues with php mail
>>
>> Brad wrote:
>>> Implementing Bcc and smtp.
>> "Here we go again"
>>
>>> #1 email is only being sent to a few recipients.
>>>
>>> I need to implement 
>>>
>>> $smtp = ‘localhost’; 
>>>
>>> Somewhere, but I keep getting parse errors?
>> Those are not normal quotes, but I'm guessing you actually typed that in 
>> the evil that is Outlook.
>>
>>> #2 trying to do a Bcc but that gives me parse errors as well
>>>
>>> It should be as easy as?
>>>
>>> $Bcc [EMAIL PROTECTED]; $eol = "\r\n";
>> That's not valid code. Ok, the second bit is, but still rather pointless.
>>
>>> Here is the working code, but if I implement the above needed inserts
>>> anywhere, I get a big ‘ol fat parse error
>>>
>>> Any assistance would be truly appreciated.
>>>
>>> An explanation of why would really help since this is for a school
>> project.
>>
>> Ahh, suddenly everything becomes clear. You can't use PHPMailer because 
>> that would mean that you didn't learn it yourself you just used somebody 
>> elses work. So instead you ask here rather than reading the PHPMailer 
>> source code. Nice.
>>
>>> Working code as is:
>>>
>>> >>
>>> $email = $_REQUEST['email'];
>>>
>>> $fromaddress = '[EMAIL PROTECTED]';
>>>
>>> $fromname = 'Zone of success Club'; $eol = "\r\n";
>>>
>>> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
>>>
>>> // $headers = 'bcc: '[EMAIL PROTECTED]';
>> This should work. However, because you'

RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Why is this?

It makes no sense?

Can anyone show me where an "order of operations" for php mail might be
hidden?
Or is this "top secret" information requiring clearance "which I have"?


Wrong bit. I also said...

 > // $headers = 'bcc: '[EMAIL PROTECTED]';

This should work. However, because you're assigning this to $headers rather
than concatenating it you're trampling over the From line above.

BTW, Bcc usually has a capital letter. Probably wouldn't cause any problems
but has the potential to stop it working.

Fin.

-Stut
###

-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 5:25 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> You say
> 
>> The use of BCC with the PHP mail function is pretty well-explained on 
>> the PHP manual page for said function.
> 
> I say,
> 
> No it doesn't, I tried everything on that page and it either parse
error'ed
> or didn't work.

Wrong bit. I also said...

 > // $headers = 'bcc: '[EMAIL PROTECTED]';

This should work. However, because you're assigning this to $headers 
rather than concatenating it you're trampling over the From line above.

BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
problems but has the potential to stop it working.

Fin.

-Stut

-- 
http://stut.net/

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Why are you being to belligerent?
English 101-104 I have aced.
Top secret security clearance I maintain.
Concatenate I know well (why would I combine the from, and the bcc?)

A logical explanation as to the order these guys get plugged into in an
array and why one requires a "" another a '' and the other a "\r\n" with
little to no documentation available on google or the text book,
If this is representation to my ignorance in syntax, then yes, I am guilty!

I am simply trying to understand..



-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 6:23 PM
To: Brad
Cc: php-general@lists.php.net; 'Stut'
Subject: RE: [PHP] two small issues with php mail

Why is what?  Sorry, you are going to have to go back and phrase this into a
complete sentence.

"it makes no sense" refers to what exactly?

No, you don't have clearance since you haven't passed syntax 101 along with
English and Grammar 101.  Once you have completed these courses, the answers
to your questions should be as obvious as the keyboard in front of you.

If Stut's answer does not make sense to you, google concatenate in the
dictionary (dictionay: concatenate), then re-read his answer.

Your professor MUST have a bottle stored somewhere...

Wolf


 Brad <[EMAIL PROTECTED]> wrote: 
> Why is this?
> 
> It makes no sense?
> 
> Can anyone show me where an "order of operations" for php mail might be
> hidden?
> Or is this "top secret" information requiring clearance "which I have"?
> 
> 
> Wrong bit. I also said...
> 
>  > // $headers = 'bcc: '[EMAIL PROTECTED]';
> 
> This should work. However, because you're assigning this to $headers
rather
> than concatenating it you're trampling over the From line above.
> 
> BTW, Bcc usually has a capital letter. Probably wouldn't cause any
problems
> but has the potential to stop it working.
> 
> Fin.
> 
> -Stut
> ###
> 
> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 5:25 PM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> Brad wrote:
> > You say
> > 
> >> The use of BCC with the PHP mail function is pretty well-explained on 
> >> the PHP manual page for said function.
> > 
> > I say,
> > 
> > No it doesn't, I tried everything on that page and it either parse
> error'ed
> > or didn't work.
> 
> Wrong bit. I also said...
> 
>  > // $headers = 'bcc: '[EMAIL PROTECTED]';
> 
> This should work. However, because you're assigning this to $headers 
> rather than concatenating it you're trampling over the From line above.
> 
> BTW, Bcc usually has a capital letter. Probably wouldn't cause any 
> problems but has the potential to stop it working.
> 
> Fin.
> 
> -Stut
> 
> -- 
> http://stut.net/
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
11/18/2007
> 5:15 PM
>  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Thank you so much!
That really helps and makes sense!

Thank you.

I will try that now

Concatenate with the dot will not cancel them out!
Now this makes sense!
And clears up some other questions I had!.

Thank you.


-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 7:00 PM
To: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

On Nov 19, 2007 5:52 PM, Brad <[EMAIL PROTECTED]> wrote:

> Why are you being to belligerent?
> English 101-104 I have aced.
> Top secret security clearance I maintain.
> Concatenate I know well (why would I combine the from, and the bcc?)


I will refrain from the rest of the posts/slams and stick to your question
in the (...).

"From" and "Bcc" are *BOTH* part of the headers - that's why you want to
concatenate them. By not using the . (dot), you are over-writing the "From"
line.

Bad/Pointless assignment:
$headers = "From: ...";
$headers = "Bcc: ...";

Good/Useful assignment:
$headers = "From: ...";
$headers .= "Bcc: ...";

Good luck.
~Philip

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
It makes sense, but the Bcc is still not making it through.

Not sure if the smtp portion is correct either.
No parse errors, but no email from the bcc either.

'.$eol;
$headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = "\r\n";
$headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
$headers .= 'X-Mailer: PHP '.phpversion().$eol;
$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$headers .= 'Content-Transfer-Encoding: 8bit';
$subject = 'Your free book!';
$body = 'http://www.g.com/freePDF/autopilotebook.pdf";>"Click
ME"  Here is your FREE autopilot book';
mail($email, $subject, $body, $headers);
?>



-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 7:00 PM
To: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

On Nov 19, 2007 5:52 PM, Brad <[EMAIL PROTECTED]> wrote:

> Why are you being to belligerent?
> English 101-104 I have aced.
> Top secret security clearance I maintain.
> Concatenate I know well (why would I combine the from, and the bcc?)


I will refrain from the rest of the posts/slams and stick to your question
in the (...).

"From" and "Bcc" are *BOTH* part of the headers - that's why you want to
concatenate them. By not using the . (dot), you are over-writing the "From"
line.

Bad/Pointless assignment:
$headers = "From: ...";
$headers = "Bcc: ...";

Good/Useful assignment:
$headers = "From: ...";
$headers .= "Bcc: ...";

Good luck.
~Philip

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



FW: [PHP] two small issues with php mail

2007-11-19 Thread Brad
 

 

   _  

From: Brad [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 8:26 PM
To: 'David Giragosian'
Subject: RE: [PHP] two small issues with php mail

 

My original issue is trying to implement a Bcc and 

 

Emails are only making it to 50% of the recipients.

Research and past experience says that I need to implement smtp into my
code.

 

Testing of the present “parse free” code show that email addresses on the
same server: To: works Bcc: does not

 

Once Bcc: works on same server, I will need to test Bcc on another server
which I am sure requires the proper smtp configuration.

 

Working code:

 

'.$eol;

$headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = "\r\n";

$headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;

$headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;

$headers .= 'X-Mailer: PHP '.phpversion().$eol;

$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;

$headers .= 'Content-Transfer-Encoding: 8bit';

$subject = 'Your free book!';

$body = 'http://www..com/freePDF/autopilotebook.pdf";>"Click
ME"  Here is your FREE autopilot book';

mail($email, $subject, $body, $headers);

?>

 

   _  

From: David Giragosian [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 7:25 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

 

 

On 11/19/07, Philip Thompson mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]> wrote: 

On Nov 19, 2007 5:52 PM, Brad mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]> wrote:

> Why are you being to belligerent? 
> English 101-104 I have aced.
> Top secret security clearance I maintain.
> Concatenate I know well (why would I combine the from, and the bcc?)


I will refrain from the rest of the posts/slams and stick to your question 
in the (...).

"From" and "Bcc" are *BOTH* part of the headers - that's why you want to
concatenate them. By not using the . (dot), you are over-writing the "From"
line.

Bad/Pointless assignment:
$headers = "From: ...";
$headers = "Bcc: ...";

Good/Useful assignment:
$headers = "From: ...";
$headers .= "Bcc: ...";

Good luck. 
~Philip

 

Brad, 

 

If Philip's suggestion doesn't fix the problem, please post the relevant
code, again. 

 

I've lost track of your original question.   

 

David
 

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM



No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 


RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
This is a new trick for me, can you kindly explain?
I know what you are getting at, I am just not real sure on th method?

Do I just replace "mail" and the end with print?
Aka
mail($email, $subject, $body, $headers);
with
print($email, $subject, $body, $headers);

??

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 8:44 PM
To: Brad
Subject: RE: [PHP] two small issues with php mail

well, you need to do some basic debugging.

a) replace your mail() function with print statements and review the
output to make certain that it is correct. [this will require that
you look at appropriate documentation to see how message headers/body
should be formatted.]

b) if "a)" looks right, then look at your mail server's logs to see
what shows up there.

  - Rick


 Original Message 
> Date: Monday, November 19, 2007 08:19:49 PM -0500
> From: Brad <[EMAIL PROTECTED]>
> To: 'Philip Thompson' <[EMAIL PROTECTED]>
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] two small issues with php mail
> 
> It makes sense, but the Bcc is still not making it through.
> 
> Not sure if the smtp portion is correct either.
> No parse errors, but no email from the bcc either.
> 
>  $email = $_REQUEST['email'];
> $fromaddress = '[EMAIL PROTECTED]';
> $fromname = 'Zone of success Club'; $eol = "\r\n";
> $smtp = "localhost";
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = "\r\n";
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> $headers .= 'Content-Transfer-Encoding: 8bit';
> $subject = 'Your free book!';
> $body = ' href="http://www.g.com/freePDF/autopilotebook.pdf";>"Cli
> ck ME"  Here is your FREE autopilot book';
> mail($email, $subject, $body, $headers);
> ?>
> 
> 
> 
> -Original Message-
> From: Philip Thompson [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 7:00 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> On Nov 19, 2007 5:52 PM, Brad <[EMAIL PROTECTED]> wrote:
> 
>> Why are you being to belligerent?
>> English 101-104 I have aced.
>> Top secret security clearance I maintain.
>> Concatenate I know well (why would I combine the from, and the
>> bcc?)
> 
> 
> I will refrain from the rest of the posts/slams and stick to your
> question in the (...).
> 
> "From" and "Bcc" are *BOTH* part of the headers - that's why you
> want to concatenate them. By not using the . (dot), you are
> over-writing the "From" line.
> 
> Bad/Pointless assignment:
> $headers = "From: ...";
> $headers = "Bcc: ...";
> 
> Good/Useful assignment:
> $headers = "From: ...";
> $headers .= "Bcc: ...";
> 
> Good luck.
> ~Philip
> 

-- End Original Message --

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
For the purposes of this task, mailer is not an option.
This is a class assignment to put us into the weeds.
I am neck deep googling the heck out of this and finding snippets of
un-related code which do not fit.

Just seek help from a knowledgeable community to help me past the learning
curve.

And getting hit hard from hecklers in the process.

I am not having a good day with php!

I took this class because of it's Linux and Unix origin...

I am not having a good day!

-Original Message-
From: Andrés Robinet [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 8:49 PM
To: 'Brad'
Cc: php-general@lists.php.net
Subject: RE: [PHP] two small issues with php mail

Did I miss something or the following line in your code is useless?

> $smtp = "localhost";

Brad, if you really need SMTP configuration, and you want to make your life
easier with attachments and extra headers, give a chance to PHPMailer
http://phpmailer.codeworxtech.com/. It's free, easy to set up and use, and
can do much more than you need.

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: bestplace.biz  | Web: seo-diy.com
Confidentiality:
"All information in this email message, including images, attachments,
contains confidential and proprietary information of BESTPLACE CORPORATION
and should only be used or serves for the intended purpose and should not be
copied, used or disclosed to anyone other than the sole recipient of this
e-mail message."

> -Original Message-
> From: Brad [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 19, 2007 10:27 PM
> To: php-general@lists.php.net
> Subject: FW: [PHP] two small issues with php mail
> 
> 
> 
> 
> 
>_
> 
> From: Brad [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 19, 2007 8:26 PM
> To: 'David Giragosian'
> Subject: RE: [PHP] two small issues with php mail
> 
> 
> 
> My original issue is trying to implement a Bcc and
> 
> 
> 
> Emails are only making it to 50% of the recipients.
> 
> Research and past experience says that I need to implement smtp into my
> code.
> 
> 
> 
> Testing of the present “parse free” code show that email addresses on
> the
> same server: To: works Bcc: does not
> 
> 
> 
> Once Bcc: works on same server, I will need to test Bcc on another
> server
> which I am sure requires the proper smtp configuration.
> 
> 
> 
> Working code:
> 
> 
> 
>  
> $email = $_REQUEST['email'];
> 
> $fromaddress = '[EMAIL PROTECTED]';
> 
> $fromname = ‘g'; $eol = "\r\n";
> 
> $smtp = "localhost";
> 
> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = "\r\n";
> 
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
> 
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
> 
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
> 
> $headers .= 'Content-Transfer-Encoding: 8bit';
> 
> $subject = 'Your free book!';
> 
> $body = ' href="http://www..com/freePDF/autopilotebook.pdf";>"Clic
> k
> ME"  Here is your FREE autopilot book';
> 
> mail($email, $subject, $body, $headers);
> 
> ?>
> 
> 
> 
>_
> 
> From: David Giragosian [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 19, 2007 7:25 PM
> To: Brad
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] two small issues with php mail
> 
> 
> 
> 
> 
> On 11/19/07, Philip Thompson  "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]> wrote:
> 
> On Nov 19, 2007 5:52 PM, Brad  "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]> wrote:
> 
> > Why are you being to belligerent?
> > English 101-104 I have aced.
> > Top secret security clearance I maintain.
> > Concatenate I know well (why would I combine the from, and the bcc?)
> 
> 
> I will refrain from the rest of the posts/slams and stick to your
> question
> in the (...).
> 
> "From" and "Bcc" are *BOTH* part of the headers - that's why you want
> to
> concatenate them. By not using the . (dot), you are over-writing the
> "From"
> line.
> 
> Bad/Pointless assignment:
> $headers = &q

FW: [PHP] two small issues with php mail

2007-11-19 Thread Brad


-Original Message-
From: Brad [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:48 PM
To: 'Chris'
Subject: RE: [PHP] two small issues with php mail

Sir, I am trying...

It just is not working...

I am trying to implement the auth info, I go from parse error to no response
from the server.

I am reading your material and batting ZERO!

I will keep on reading and somehow figure it out.
You have been kind.

I have the admin of this list now being a jerk!

Brad

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:39 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [PHP] two small issues with php mail

Brad wrote:
> For the purposes of this task, mailer is not an option.
> This is a class assignment to put us into the weeds.
> I am neck deep googling the heck out of this and finding snippets of
> un-related code which do not fit.

Just because you can't use php-mailer in your project doesn't mean you 
can't use it as a reference.

Grab phpmailer and look at the process it follows to do smtp sending.

smtp authentication is a pain at the best of times but trying to do it 
the way you are now will just drive you mad (been there, done that).

Looking at a working code sample will make things a lot clearer in your 
head rather than random code from 100 different locations.

http://www.cosmonroe.org/~devin/postfix/smtp-auth.txt under "SMTP 
Authentication" will give you an idea of what you need to do but there 
is a ton more error checking and validation you need to do along the way.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



FW: [PHP] two small issues with php mail

2007-11-19 Thread Brad


-Original Message-
From: Brad [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:34 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] two small issues with php mail

Thought it was a support forum!
Support usually does not mean "piss off".

Brad

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:31 PM
To: Brad
Subject: RE: [PHP] two small issues with php mail

the php mailing list is not intended as a tutor. we have all provided
you with pointers and direction. it is for you, as the student, to
use your skills, seek out examples if necessary, and then determine
how to implement a solution.

the online php manual is really sufficient documentation. if the core
documentation provided by the php developers isn't sufficient, then
look at the included user-provided examples (realizing that they
aren't vetted, so aren't always 100% accurate). if you don't do well
with things in manual format (some people do, some don't), then you
might want to buy the o'reilly php book or something similar.

on the specifics, if you don't know how to format a print statement,
then look it up:

  <http://www.php.net/manual/en/>

a tutor might turn the manual to the appropriate page and point to an
example, but as that's not our role so i'll let you thumb through to
the right page.



 Original Message ----
> Date: Monday, November 19, 2007 09:16:13 PM -0500
> From: Brad <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] two small issues with php mail
> 
> Provide the proper documentation and that is not necessary!
> Brad
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 19, 2007 9:07 PM
> To: Brad
> Subject: RE: [PHP] two small issues with php mail
> 
> I'm sorry, but if you have to ask this question you need to get
> yourself a tutor - the intent of this mailing list is not that.
> 
> 
>   - Rick
> 
> 
>  Original Message 
>> Date: Monday, November 19, 2007 08:52:36 PM -0500
>> From: Brad <[EMAIL PROTECTED]>
>> Cc: php-general@lists.php.net
>> Subject: RE: [PHP] two small issues with php mail
>> 
>> This is a new trick for me, can you kindly explain?
>> I know what you are getting at, I am just not real sure on th
>> method?
>> 
>> Do I just replace "mail" and the end with print?
>> Aka
>> mail($email, $subject, $body, $headers);
>> with
>> print($email, $subject, $body, $headers);
>> 
>> ??
>> 
>> -Original Message-
> 
>> Sent: Monday, November 19, 2007 8:44 PM
>> To: Brad
>> Subject: RE: [PHP] two small issues with php mail
>> 
>> well, you need to do some basic debugging.
>> 
>> a) replace your mail() function with print statements and review
>> the output to make certain that it is correct. [this will require
>> that you look at appropriate documentation to see how message
>> headers/body should be formatted.]
>> 
>> b) if "a)" looks right, then look at your mail server's logs to see
>> what shows up there.
>> 
>>   - Rick
>> 

-- End Original Message --

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Responses like that is encouragement to drop php and move straight to ruby!

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:07 PM
To: Brad
Subject: RE: [PHP] two small issues with php mail

I'm sorry, but if you have to ask this question you need to get
yourself a tutor - the intent of this mailing list is not that.


  - Rick


 Original Message 
> Date: Monday, November 19, 2007 08:52:36 PM -0500
> From: Brad <[EMAIL PROTECTED]>
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] two small issues with php mail
> 
> This is a new trick for me, can you kindly explain?
> I know what you are getting at, I am just not real sure on th
> method?
> 
> Do I just replace "mail" and the end with print?
> Aka
> mail($email, $subject, $body, $headers);
> with
> print($email, $subject, $body, $headers);
> 
> ??
> 
> -Original Message-

> Sent: Monday, November 19, 2007 8:44 PM
> To: Brad
> Subject: RE: [PHP] two small issues with php mail
> 
> well, you need to do some basic debugging.
> 
> a) replace your mail() function with print statements and review the
> output to make certain that it is correct. [this will require that
> you look at appropriate documentation to see how message
> headers/body should be formatted.]
> 
> b) if "a)" looks right, then look at your mail server's logs to see
> what shows up there.
> 
>   - Rick
> 
> 
>  Original Message 
>> Date: Monday, November 19, 2007 08:19:49 PM -0500
>> From: Brad <[EMAIL PROTECTED]>
>> To: 'Philip Thompson' <[EMAIL PROTECTED]>
>> Cc: php-general@lists.php.net
>> Subject: RE: [PHP] two small issues with php mail
>> 
>> It makes sense, but the Bcc is still not making it through.
>> 
>> Not sure if the smtp portion is correct either.
>> No parse errors, but no email from the bcc either.
>> 
>> > $email = $_REQUEST['email'];
>> $fromaddress = '[EMAIL PROTECTED]';
>> $fromname = 'Zone of success Club'; $eol = "\r\n";
>> $smtp = "localhost";
>> $headers  = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
>> $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = "\r\n";
>> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
>> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
>> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
>> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
>> $headers .= 'Content-Transfer-Encoding: 8bit';
>> $subject = 'Your free book!';
>> $body = '> href="http://www.g.com/freePDF/autopilotebook.pdf";>"Cli
>> ck ME"  Here is your FREE autopilot book';
>> mail($email, $subject, $body, $headers);
>> ?>
>> 
>> 
>> 
>> -Original Message-
>> From: Philip Thompson [mailto:[EMAIL PROTECTED] 
>> Sent: Monday, November 19, 2007 7:00 PM
>> To: php-general@lists.php.net
>> Subject: Re: [PHP] two small issues with php mail
>> 
>> On Nov 19, 2007 5:52 PM, Brad <[EMAIL PROTECTED]> wrote:
>> 
>>> Why are you being to belligerent?
>>> English 101-104 I have aced.
>>> Top secret security clearance I maintain.
>>> Concatenate I know well (why would I combine the from, and the
>>> bcc?)
>> 
>> 
>> I will refrain from the rest of the posts/slams and stick to your
>> question in the (...).
>> 
>> "From" and "Bcc" are *BOTH* part of the headers - that's why you
>> want to concatenate them. By not using the . (dot), you are
>> over-writing the "From" line.
>> 
>> Bad/Pointless assignment:
>> $headers = "From: ...";
>> $headers = "Bcc: ...";
>> 
>> Good/Useful assignment:
>> $headers = "From: ...";
>> $headers .= "Bcc: ...";
>> 
>> Good luck.
>> ~Philip
>> 
> 
> -- End Original Message --
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
> 11/18/2007 5:15 PM
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:
> 11/18/2007 5:15 PM
>  

-- End Original Message --

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM
 

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



RE: [PHP] two small issues with php mail

2007-11-19 Thread Brad
Sir, you are very kind, but your implementation of "array" has me as the
"monkey with a light bulb"
I know BASIC (the language) at a minimal.
Basic functionality I know;
Your implementation of core knowledge programming to php quarks is blowing
my mind when looking at my existing problem.

#1
You build your array with;
= array(
'Function 1',
'function 2',
//...
);

?
//...
);
??

Skip the ... and end with "):"

Php has enough goof ball stuff, with it's mail function.

Your suggestion is kind but you are shooting over my head...
  $headers = implode("\r\n", $headers);

Implode
Hmmm = build array here but, the usage of "\r\n" is already confusing me.
The manual says to use it for Bcc
Parse error says otherwise when not in you array.
Why?

Else "blame casey"

Never, you are trying to help!

Brad




-Original Message-
From: Casey [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 19, 2007 9:48 PM
To: Brad
Cc: Andrés Robinet; 
Subject: Re: [PHP] two small issues with php mail

Note this code is untested and directly typed from a phone.

http://www.obviouslyascam.com 
!';
  $headers = array(
   'From: [EMAIL PROTECTED]',
   'Bbc: [EMAIL PROTECTED]',
   // ...
  );
  $headers = implode("\r\n", $headers);
  if (mail($to, $subject, $message, $headers))
   echo 'Success!';
  else blameCasey();
?>

Note: you might need to change some code before you use it (in an  
attempt to stop you from ripping off my code).



On Nov 19, 2007, at 6:26 PM, "Brad" <[EMAIL PROTECTED]> wrote:

> For the purposes of this task, mailer is not an option.
> This is a class assignment to put us into the weeds.
> I am neck deep googling the heck out of this and finding snippets of
> un-related code which do not fit.
>
> Just seek help from a knowledgeable community to help me past the  
> learning
> curve.
>
> And getting hit hard from hecklers in the process.
>
> I am not having a good day with php!
>
> I took this class because of it's Linux and Unix origin...
>
> I am not having a good day!
>
> -Original Message-
> From: Andrés Robinet [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 19, 2007 8:49 PM
> To: 'Brad'
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] two small issues with php mail
>
> Did I miss something or the following line in your code is useless?
>
>> $smtp = "localhost";
>
> Brad, if you really need SMTP configuration, and you want to make  
> your life
> easier with attachments and extra headers, give a chance to PHPMailer
> http://phpmailer.codeworxtech.com/. It's free, easy to set up and  
> use, and
> can do much more than you need.
>
> Rob
>
> Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
> 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale,  
> FL 33308
> | TEL 954-607-4207 | FAX 954-337-2695 |
> Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> bestplace |  Web: bestplace.biz  | Web: seo-diy.com
> Confidentiality:
> "All information in this email message, including images, attachments,
> contains confidential and proprietary information of BESTPLACE  
> CORPORATION
> and should only be used or serves for the intended purpose and  
> should not be
> copied, used or disclosed to anyone other than the sole recipient of  
> this
> e-mail message."
>
>> -Original Message-
>> From: Brad [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 19, 2007 10:27 PM
>> To: php-general@lists.php.net
>> Subject: FW: [PHP] two small issues with php mail
>>
>>
>>
>>
>>
>>   _
>>
>> From: Brad [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 19, 2007 8:26 PM
>> To: 'David Giragosian'
>> Subject: RE: [PHP] two small issues with php mail
>>
>>
>>
>> My original issue is trying to implement a Bcc and
>>
>>
>>
>> Emails are only making it to 50% of the recipients.
>>
>> Research and past experience says that I need to implement smtp  
>> into my
>> code.
>>
>>
>>
>> Testing of the present “parse free” code show that email  
>> addresses on
>> the
>> same server: To: works Bcc: does not
>>
>>
>>
>> Once Bcc: works on same server, I will need to test Bcc on another
>> server
>> which I am sure requires the proper smtp configuration.
>>
>>
>>
>> Working code:
>>
>>
>>
>> >
>> $email = $_REQUEST['email'];
>>
>> $fromaddress = '[EMAIL PROTECTED]';
>>
>> $fro

Re: [PHP] Php Search Engine

2002-11-25 Thread Brad Pauly
On Mon, 2002-11-25 at 08:31, [EMAIL PROTECTED] wrote:
> I am in need of a search engine. I'd rather do one in PhP. Is there one
> available that I can see or at least get the code for?

This article might help. 

http://www.onlamp.com/pub/a/php/2002/10/24/simplesearchengine.html


Brad


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




Re: [PHP] MySQL Error

2002-12-01 Thread Brad Bonkoski
Perhaps you should try and do some error checking on the mysql_select_db()
function, like printing out mysql_error().

Also, for the permissions issues, mysql has a very comprehensive online
documentation on user permissions.  Check them out, you may also wish to try
and connect to the database with a different user?
http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Adding_users

HTH
-Brad

Stephen wrote:

> Hello,
>
> I just recently switched to IIS from Apache since IIS came with Windows XP
> and I just love Microsoft. I installed PHP and MySQL with no problems but
> when I tried accessing a table, I got this error:
>
> No Database Selected
>
> In my script, I have this:
>
> $hostname_default = "localhost";
> $database_default = "check";
> $username_default = "root";
> $password_default = " **taken out for known reasons** ";
> $default = mysql_pconnect($hostname_default, $username_default,
> $password_default) or die(mysql_error());
> mysql_select_db($database_default, $default);
> $query_update = "SELECT * FROM updates ORDER BY `date` DESC LIMIT 1";
> $update = mysql_query($query_update, $default) or die(mysql_error());
> $row_update = mysql_fetch_assoc($update);
> $totalRows_update = mysql_num_rows($update);
>
> I don't see where it's gone wrong! My database name is check and phpMyAdmin
> can get to it just fine. Also, how can I set it up so MySQL allows the user
> name root and no password acessable through localhost? I accidently changed
> it to only allow username root, with password...
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "What is a dreamer that can not persevere?" -- http://www.melchior.us
>
>   
> --
> 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




RE: [PHP] php5 features?

2002-12-03 Thread Brad Young
Zeev Suraski wrote an article on the subject. You can find it at 
http://www.devx.com/webdev/Article/10007

From: ed [mailto:[EMAIL PROTECTED]]
>
>Hi all.  I was wondering if there are resources on the
>web that will help me get an 
>idea of the changes and new features that will be in
>php5.
>I'm particularly interested in what's gonna be added
>or changed to php in regards to 
>its OOP capabilities.

__
Brad Young
Director, Product Marketing
[EMAIL PROTECTED] 
www.zend.com 
Zend - The PHP Company
 


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




[PHP] Post Variables

2002-12-04 Thread Brad Bonkoski
Hello,

I am trying to make a script that looks something like:

for ($i=0; $i<=12; $i++)
{
echo "";
echo "";
}

Then I am posting those to another page, and trying to get the data out
for ($i=0; $i<=12; $i++)
{
echo $_POST['$i'];
}

And it doesn't work.  Any thoughts on if something like this is doable?
obviously in raw HTML it looks like:
??

because I can do: echo $_POST['1']
and get the correct value, but I would like it to get the value of $i?

Thoughts?
Thanks
-Brad


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




Re: [PHP] Hiding Errors

2002-12-05 Thread Brad Pauly
On Thu, 2002-12-05 at 14:32, vernon wrote:
> Is there a way to have errors in script not output to the screen? I have a
> page that creates an error which really isn't a problem and I don't want
> users to see the error message.

You can also use set_error_handler to deal with errors however you like.

http://www.php.net/manual/en/function.set-error-handler.php

HTH,
Brad


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




Re: [PHP] Good eve

2002-12-06 Thread Brad Bonkoski
Check out:
http://www.php.net/manual/en/function.mktime.php
HTH
-Brad

"Miguel Brás" wrote:

> I have a table with several field, one of them has a date insertion on the
> d/m/y format.
> I would like to return only the data for the present day (today will be date
> 05/12/02 tomorrow will be 06/12/02)
>
> I will do SELECT field1, field2, field3 FROM table WHERE date=?
>
> What is missing on the ??s ?
>
> Thx in advance
> Miguel
>
> --
> 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




Re: [PHP] Forms

2002-12-10 Thread Brad Bonkoski
Have you tried echoing out the value on the resulting page, i.e. the page that
parses the form?
echo $_POST['name'];
What does that give you?  I don't see anything that really jumps out at me with
your code.
-Brad


"Beauford.2002" wrote:

> Hi,
>
> I'm sending this to both lists as I'm not sure where the problem is, but I
> believe it is an issue with my HTML form. Here's the problem:
>
> I have a drop-down menu form on my webpage with employee names in it. When I
> choose a name and click submit it gets passed to a php page which accesses a
> mysql database and displays information about that employee.
>
> The problem is that the form is not sending the employee name to the php
> page. If I insert the name in the php page manually, it works fine, so the
> problem appears to be with the form.
>
> Can someone help me out here - a sample of my code is below. I'm not sure
> how to explain this, but whatever gets sent to the PHP page has to be one
> variable - i.e. if I choose John, then the variable that gets sent to the
> PHP should have the value John, if I choose Mary, the value of the variable
> should be Mary. Hope this makes sense.
>
> TIA
>
> 
> 
> 
> John
> Mary
> 
> 
>
> --
> 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




Re: [PHP] Using fopen() to open a php file with variables.

2002-12-11 Thread Brad Bulger

if you have URL wrappers enabled, do

$fp = fopen("http://path/to/your/file/$calendar_file";, 'r');

On Wed, 11 Dec 2002, Jay (PHP List) wrote:

> Okay, I need to retrieve the output of a php file with variables being
> passed to it.  Example:
>
> $calendar_file = "make_calendar.php3?month=$month&year=$year";
> $fp = $fp = fopen("$calendar_file", "r");
> while (!feof ($fp)) {
>   $buffer = fgets($fp, 4096);
>   $calendar_html .= $buffer;
> }
> fclose($fp);
>
> It gives me an error that the file doesn't exist, but it does.  Any
> suggestions?
>
> Jay Douglas
> Systems Consultant
> Fort Collins, CO
>
>

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




Re: [PHP] validate querystring

2002-12-11 Thread Brad Bulger

you could try doing

$realfilename = realpath($fname);
if (strpos($realfilename, $the_valid_path_to_my_file_directory) !== 0)
{
// bad file name, like /etc/passwd
}
elseif (is_dir($realfilename))
{
// bad user looking at directory
}

On Thu, 12 Dec 2002, Dara Dowd wrote:

> Hello,
> I have a query string like this
> http://server/download.php?fname=name_of_remote_file. The script runs and displays a 
>file download dialog box.
> Is there a way of validating the querystring to ensure that a user doesn't try 
>something like fname=. or fname=.. or fname=? or fname=/, which enable the user to 
>see the contents of the remote directory, without resorting to a load of 'if' 
>statements.Are there any other special characters i should be aware of?
> Cheers,Dara
>
> --
> For the largest free email in Ireland (25MB) &
> File Storage space (20MB), visit http://www.campus.ie
>
> Powered by Outblaze
>
> --
> 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




Re: [PHP] MySQL error

2002-12-12 Thread Brad Bonkoski
Well, are you getting a valied response from the database?
Perhaps it would be nice to add some error handling into your code...
i.e.:
$mysql_result = mysql_query($query, $mysql_link)
or die("Invalid query: $query");

or echo out mysql_error();



GWAD Mailinglist wrote:

> Hi,
>
> I have following problem:
>
> list.php3
>
> 
> // connect to db
> include("connect_db.php3");
>
> // get everything from catalog table
>
> $query = "SELECT * FROM yritykset ORDER BY ynimi ASC";
>
> $mysql_result = mysql_query($query, $mysql_link);
>
> // get each row
>
> --> line 36   while($row = mysql_fetch_row($mysql_result))
>
> {
>
> //get columns
>
>   $id = $row[0];
>   $ynimi = $row[1];
>   $ylahi = $row[2];
>   $ypostios = $row[3];
>   $ypostitmp = $row[11];
>
>   print("\n");
>   print("\n");
>
>   print("$ynimi, $ylahi, $ypostios
> $ypostitmp\n");
>   print(" HREF=\"tarkenna.php3?id=$id\">MUOKKAA> -  HREF=\"poista.php3?id=$id\">POISTA>");
>
>   print("\n");
>   print("\n");
>
> }
>
> // disconnect
> mysql_close($mysql_link);
> ?>
>
> when run, i'll following error messages:
>
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /www/domains/lammidb.phnet.fi/public_html/kaikki.php3
> on line 36
>
> --
> 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




Re: [PHP] Re: Nigerian oil scams

2002-12-12 Thread Brad Bonkoski
Of course Identity theft is another issue
Classic email scam to get people's bank account numbers.  I think I have seen such
on this mailing list about 2-3 times over the past couple of months.

Jason Wong wrote:

> On Friday 13 December 2002 06:58, Russ Taylor wrote:
> > Got to love people who use all capitals.
> >
> > How would the scammer profit from this? I guess given your full details and
> > bank number they can do what?
>
> They ask you to put some money upfront. Believe it or not, some gullibles mugs
> have been fallen for it.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Its name is Public Opinion.  It is held in reverence.  It settles everything.
> Some think it is the voice of God.
> -- Mark Twain
> */
>
> --
> 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




Re: [PHP] PHP/MySQL Interaction

2002-12-12 Thread Brad Bonkoski
Wouldn't this involved a sub-query?
i.e.
select * from images where
( select * from categories where cat_id = 3 AND cat_id != 5)
Now, the question is, do the more recent versions of mysql support
subqueries?

Take a look at:
http://www.mysql.com/documentation/mysql/bychapter/manual_Introduction.html#ANSI_diff_Sub-selects

This may help you out in potentially re-writting your query?

possibly:
select images.* from images LEFT JOIN categories on images.id =
categories.id where categories.cat = 3 AND catdgories.cat != 5

HTH
-Brad

David Freeman wrote:

> Hi All
>
> This is probably off-topic here and my only real excuse is that after
> having searched google as well as both php and mysql sites/manuals I'm
> no closer to an answer for something I'd like to get solved this
> morning...
>
> I have two database tables (mysql).  One contains information about
> images (filename, image description, directory path), the other contains
> two columns - one is the ID of the image and the other is an ID that
> represents an image category.
>
> The reason for doing this is so that I can have an image in multiple
> categories.  Ie. An Image is a product image and also a promotional
> image (for example).
>
> Now I want to randomly select an image from my database such that it
> belongs in a set category.  This isn't a problem and I have the code
> working fine.  I am having trouble with the twist on this though.  I
> want to be able to select an image based on it being in a certain
> category but also to be able to exclude that image if it is in a
> different category.  That is, I want to select images in category 3 but
> only if they are not also in category 5 (for example).
>
> Can this be done in a single mysql query or am I going to have to link a
> series of mysql queries together with some php code to firstly get a set
> of images that are in one category (into an array for eg) and then go
> through and remove anything that's also in another category and then do
> a random selection from the remaining contents of the array?
>
> I'd like to think it can be done in a single mysql query and it would
> certainly be more elegant but I haven't been able to figure out a way
> and I'm starting to think I'll need to do it by manipulating arrays in
> php which would be far less elegant (although obviously still do-able).
>
> Any suggestions anyone?  Or references to a tutorial/website somewhere
> that talks about doing this sort of thing would also be fine.
>
> Thanks
> Dave
>
> --
> 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




Re: [PHP] Newer version of PHP causing code incompatibilities

2002-12-13 Thread Brad Bonkoski
Check out the php.ini configuration file, or read about it at the website.  I do
believe there is an option there where you can declare what your script
delimeter is.   Most notable an option called "Short open tag"
HTH
-Brad

Paul Keenan wrote:

> All of our pages which were previously running on a PSA 2.5 server which
> were done in php used the syntax . In PSA 5 (or the
> different install of PHP) you must use the proper 
> syntax.
>
> We are now on PHP Version 4.1.2
>
> Our server crashed and we have installed newer software, now most of the PHP
> does not work because of the above difference in coding.
>
> Is there any easy way of allowing the old code to run without having to
> rewrite thousands of lines of code???
>
> Or any suggestions would be appreciated
>
> Thanks in advance
>
> --
> 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




Re: [PHP] SSL, PHP, & MySQL

2002-12-13 Thread Brad Bonkoski
I think you may need to read:
http://www.php.net/manual/en/function.mysql-connect.php

It appears that the SSL client flag for connecting to MYSQL is not available
until 4.3.0, but you can pick up the 4.3.0RC3 version now, and test it out!  I
_think_ this is what you are looking for.
HTH
-Brad

Joshua Minnie wrote:

> Hi all,
> I was wondering if anyone could direct me to some good tutorials on how
> to utilize PHP to access a MySQL database behind SSL.  I have been searching
> PHPBuilder.com, PHPClasses.org, and hotscripts.com, and I can't seem to find
> any good tutorials for a beginner when it comes to SSL.  I do have a fairly
> good working knowledge of PHP and MySQL so I'm not necessarily looking for a
> guide on that, I just need to know how to pass encrypted data back and
> forth.  Here is the scenario:
>
> My client has a website in which a customer will be purchasing gift
> certificates online.  They don't need a comprehensive e-commerce package,
> just simple information passed across a secure connection, such as: user
> names, passwords, credit cards and mailing addresses.  We already have a
> MySQL db set up with the gift certificate "package" information.  I just
> need to be able to store the customer information for retrieval later by the
> owners of the site.
>
> Joshua Minnie
> [EMAIL PROTECTED]
> Independent Web Consultant / Developer
> Wild Web Technology
> www.wildwebtech.com
>
> --
> Server Information:
>  + PHP v. 4.2.3
>  + Apache 1.3.26
>  + MySQL 3.23.53
> --
>
> --
> 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




Re: [PHP] SSL, PHP, & MySQL

2002-12-13 Thread Brad Bonkoski
I would say it really all depends on your network configuration.  I am assuming
that your Web server running PHP is running on one machine (SERVER A)and the
MYSQL server running on another (SERVER B)outside of a common firewall?  Is this
accurate?

If this is true, then I would presume that PHP on SERVER A could encrypt a
datafile with MYSQL instructions and send it securely to SERVER B, but then who
would un-encrypt it and feed it to MYSQL?

You might want to look into other alternative like tunneling with SSH or
'stunnel'.  I remember hearing some about it, but have not real experience with
it.  do a search on some MYSQL mailing lists for some insight.  Or ask on the
PHP-DB mailing list and you may be able to target a better qualified audience.

-Brad

Joshua Minnie wrote:

> What about utilizing an encrypted text file then.  Would there be anything
> wrong with doing it that way?  I really don't have too much of an option as
> far as the server specs go because I didn't set up the web hosting.
>
> -Josh
>
> Brad Bonkoski wrote:
> > I think you may need to read:
> > http://www.php.net/manual/en/function.mysql-connect.php
> >
> > It appears that the SSL client flag for connecting to MYSQL is not
> available
> > until 4.3.0, but you can pick up the 4.3.0RC3 version now, and test it
> out!  I
> > _think_ this is what you are looking for.
> > HTH
> > -Brad
> >
> > Joshua Minnie wrote:
> >
> > > Hi all,
> > > I was wondering if anyone could direct me to some good tutorials on
> how
> > > to utilize PHP to access a MySQL database behind SSL.  I have been
> searching
> > > PHPBuilder.com, PHPClasses.org, and hotscripts.com, and I can't seem to
> find
> > > any good tutorials for a beginner when it comes to SSL.  I do have a
> fairly
> > > good working knowledge of PHP and MySQL so I'm not necessarily looking
> for a
> > > guide on that, I just need to know how to pass encrypted data back and
> > > forth.  Here is the scenario:
> > >
> > > My client has a website in which a customer will be purchasing gift
> > > certificates online.  They don't need a comprehensive e-commerce
> package,
> > > just simple information passed across a secure connection, such as: user
> > > names, passwords, credit cards and mailing addresses.  We already have a
> > > MySQL db set up with the gift certificate "package" information.  I just
> > > need to be able to store the customer information for retrieval later by
> the
> > > owners of the site.
> > >
> > > Joshua Minnie
> > > [EMAIL PROTECTED]
> > > Independent Web Consultant / Developer
> > > Wild Web Technology
> > > www.wildwebtech.com
> > >
> > > --
> > > Server Information:
> > >  + PHP v. 4.2.3
> > >  + Apache 1.3.26
> > >  + MySQL 3.23.53
> > > --
>
> --
> 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




Re: [PHP] printf %d

2002-12-13 Thread Brad Bonkoski
Read:
http://www.php.net/manual/en/function.printf.php
(On of the user contrib notes has an example)
Or pick up a copy of "The C Programming Language" by Kernighan and
Ritchie for a more complete description.

-Brad

William Martell wrote:

> Hello All.
>
> Can anyone tell me what this '%d' refers to?
>
> A pointer would be great.  Thanks
>
> [snip]
> if (!$result)
>  die ("Query Failed\n");
> else
>  printf ("Number of rows returned: %d\n",
> <-HERE '%d'
> mysql_num_rows ($result));
>  while ($query_data = mysql_fetch_array ($result))
>  {
>
>   echo "Part#: ".$query_data[holman_part]."";
>   echo "Description: ".$query_data[part_desc]."";
>  }
> [/snip]
>
> --
> 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




Re: [PHP] key pairs

2002-12-17 Thread Brad Bonkoski
What about a master table like:

Order ID | Ship_TO | BILL_TO

Then an address table:
ID | NAME | ADDR | CITY | STATE | ZIP

Then you could have many addresses, and IFFthe Bill to and Ship to were the same
then the master table would reflect that.  Many sites provide a check box to
indicate that the Bill to and Ship to are the same, which you would key off of
and if so, assign the same Unique Address ID to both fields in the master
table.  Many ways to do this, but those are my thoughts

-Brad

"1LT John W. Holmes" wrote:

> > >Hopefully the other solution worked for how to parse the data. If not,
> post
> > >back. What I wanted to comment on is why would you use two tables, one
> for
> > >SHIP_TO and one for BILL_TO? Why not just add a column to one table set
> set
> > >it to BILL or SHIP. You won't be repeating data that way and it'll be
> easier
> > >to find things overall. Plus you can just have a column that flags
> whether
> > >the SHIP_TO and BILL_TO addresses are the same.
> > >
> > >
> > I haven't gotten that far yet.  BILL_TO and SHIP_TO aren't always
> > the same people, hence my initial thought of creating two tables and
> > keep things separate.  However, you're right, I could dump it all into
> > one table - if they're different, then populate the rest of the fields,
> > if not, don't bother.
>
> What I was thinking is that you have one table with
>
> Order_ID
> Name
> Address
> Flag -> Here you flag this as SHIP_TO or BILL_TO
> etc...
>
> Your order_ID could be a key, but it will not be unique, since if the
> bill_to and ship_to address are different, the order_id will appear in the
> table twice. So an order with different shipping and billing addresses would
> have two rows in the table. An order where they are the same would only have
> one row.
>
> That layout would be better than:
>
> Order_ID
> Ship_name
> Ship_address
> Bill_name
> Bill_address
> etc...
>
> Which is what I got from you last email.
>
> Does anyone agree?
>
> ---John Holmes...
>
> --
> 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




Re: [PHP] Automated Php Page

2002-12-18 Thread Brad Bonkoski
Well, read up on fwrite() to actually write the page.  I would have the 1st page
form submit to itslef, process/create the new static page and then to a re-direct
to the new page.  There are tutorials for image uploading, and the other stuff
would just be writting form vairables to a static file with fwrite() and some of
your HTML formatting.  Is there anything else specific?  If So, post it.
Good Luck
-Brad

[EMAIL PROTECTED] wrote:

> Still a php newbie here
>
> I am creating a website set on an intranet server.  I have to create two pages
> that consists of the following actions and I'd like to know if its possible to
> do with php if so, how? The first page, information page,  would
> somewhat look like a forum page to enter information. Ultimately, this page
> would create the second page, an automated web page with this information to
> save on the server. It would grab the title of the page when it is typed into
> the information box on the information page and give it the name of the file
> it creates. Ex. Title = Texture 4.0 File Name = texture40.html or .php
> doesn't matter.
>
> Information Page:
> -I'd have four text space areas for the page title, directory path information
> on where the file i am uploading is placed, information on where a .txt file
> is located on the intranet server and a description of the file that has been
> uploaded to the server along with a "Submit" button.
>
> -Once the user submits this information, it should create a webpage(automated
> web page) with the information added in from the information page.
>
> I hope I explained that well...I am also searching other options but I have
> liked the php pages I've created thusfar and I am not a great programmer so
> please go easy on the kid. :) lol
>
> Krystal
>
> --
> 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




Re: [PHP] All Request to the same script

2003-01-15 Thread Brad Pauly
On Wed, 2003-01-15 at 08:24, Chris Hayes wrote:
> At 15:39 15-1-03, you wrote:
> >Hello
> >
> >Is it possible to send all incoming requests to the same script within
> >PHP?
> >In other words: How can I get http://mysite/script.php to point to the
> >same script as http://mysite/anotherscript.php ? And is it possible to do
> >send a request like
> >http://mysite/someextrapathinfo to the same php script?
> >The background behind it is to create a controler that handles all
> >incoming requests and dispatches them to different worker scripts as
> >nessecary.
> 
> I think to achieve that you need to have a certain amount of rights, so you 
> may have problems to get modules in Apache or .htaccess (see below) working 
> when your ISP does not want to help you.
> 
> I've heard that Apache's mod_rewrite module can be very powerful in doing 
> things like you propose.

Yes. I use mod_rewrite to do this. If you have access to httpd.conf,
that is the best place to put rules. You can also put rules in .htaccess
if that is your only option, however, you take a performance hit for
doing it that way.

http://httpd.apache.org/docs/mod/mod_rewrite.html#InternalAPI

- Brad


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




Re: [PHP] include question

2003-01-15 Thread Brad Bonkoski
It would probably be best to include the absolute path to the images.
so instead of:  use: 
Is something like that possible?
Otherwise at the very least you should use: 
HTH
-Brad
Ryan wrote:

> Hello all,
>
> I'm have a PHP script that works in a folder.. for the sake of clarity we'll
> call it c:\project
>
> In c:\project\htmls there are several HTML documents which refer to images
> in the project\htmls directory with tags like 
>
> In my PHP script in c:\project I include "htmls/file.html" and the HTML file
> renders alright from the script, but the image's path is c:\project\file.gif
> when the page is rendered, not c:\project\htmls\file.gif like it should be.
> Is there any way to change the "working directory" so when I include a file
> images are on the page, too?
>
> Thanks in advance!
>
> --
> Ryan Cassin
> [EMAIL PROTECTED]
>
> --
> 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




Re: [PHP] Sessions or Cookies?

2003-01-18 Thread Brad Pauly
> Sessions themselves use cookies, though, right?  So, if you want your app to
> work for those who don't have cookies, you have to pass the session data in
> the url string, at least that's my understanding.

Cookies are used by default. However, if cookies are disabled in a
client, a session identifier will be passed via URL variable unless
session.use_only_cookies is enabled in php.ini.

Brad



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




Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Brad Pauly
> For example, this URL:
> 
> add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=24.92&unit=BX
> &short_desc=ENVELOPE,25%COT 24#,IY&wholesaler=US&cost=18.690
> 
> gets cut off at the # sign, so $wholesaler and $cost come out empty.
> 
> Any suggestions to get around this?

You could use urlencode() and urldecode().

http://www.php.net/manual/en/function.urlencode.php
http://www.php.net/manual/en/function.urldecode.php

Brad



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




[Fwd: Re: [PHP] Number Sign in String Variables]

2003-01-18 Thread Brad Pauly
Oops...

-Forwarded Message-

From: Brad Pauly <[EMAIL PROTECTED]>
To: Joab Stieglitz <[EMAIL PROTECTED]>
Subject: Re: [PHP] Number Sign in String Variables
Date: 18 Jan 2003 16:40:40 -0700

> OK.  I urlencoded the URL and now the URL passes correctly...
> 
> add_to_cart.php%3Fitem_num%3DSTT32700%26quantity%3D1%26sale_price%3D52.78%26
> unit%3DBX%26short_desc%3DENVELOPE%2C100%25COT%2024%23%2CGY%26wholesaler%3DUS
> %26cost%3D37.700
> 
> ... but I get the following error:
> 
> Forbidden
> You don't have permission to access
> /carmae/add_to_cart.php?item_num=STT32700&quantity=1&sale_price=52.78&unit=B
> X&short_desc=ENVELOPE,100%COT 24#,GY&wholesaler=US&cost=37.700 on this
> server.

Your web server is trying to find a directory with that long name. If
you encode the entire string, you need to pass it in a new variable,
then break it apart again.
 
> Suggestions?

Sorry, I gave some bad advice the first time. All you need to do is
urlencode each of the variables individually. Something like this:

$item_num_encoded = urlencode($item_num);
[...]

Then your link will be something like this:

add_to_cart.php?item_num=$item_num_encoded


Brad







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




Re: [PHP] Is there a way to undo the md5() encryption??

2003-01-22 Thread Brad Pauly
> Hi!  Is there a way to do the decryption of the encrypted data with the use
> of md5()??

Nope. md5 is a one way function.

http://www.faqs.org/faqs/cryptography-faq/part07/

Brad


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




[PHP] Redirecting errors

2003-02-05 Thread Brad Esclavon
I have written a script that validates a username/pwd input and if usr/pwd
is correct, includes the protected page,  or if usr/pwd is wrong, input page
reloads the form onto itself with a form submit.
all of the code is correct, except that the secured page is viewable from
the internet if i explicitly enter the url. I have set the secured page's
permissions to 700 and the input page to 755. even though my permissions
disallow outside access, why can you get to the secured page?

any help or thoughts is appreciated




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




[PHP] Thanks problem solved

2003-02-05 Thread Brad Esclavon
once removed from same directory as the login page, the secured page was
secure



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




[PHP] passing a query string to a popup window problems

2003-02-11 Thread Brad Esclavon
I am trying to pass 2 variable values(username and userpassword) to a popup
window to display those values when a button is clicked. When the window
pops up, the variable names aren't displayed because they havent been
passed.
Here is the code:

onclick="window.open('http://www.bluedorado.com/bdnfosrc/distributionpopup.p
hp?formuser=$formuser&formpassword=$formpassword','BD_Hit_Distribution','hei
ght=300,width=600,menubar=0,status=0')";>

Any ideas why the values arent being passed?



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




[PHP] PHP error messages

2003-02-15 Thread Brad Esclavon
I am getting this error message when i use file() to convert a text document
to an array.

Warning: file("http://www.something.com/the_filename.txt";) - Error 0 in
/nfs/cust/directory_structure/index.php on line 21

I have looked on google and on php.net/docs for information on this problem
(error 0 and error docs) and i cannot find any. can anyone point me to a php
error documentation file or tell me what is wrong?



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




[PHP] LDAP authentication to NDS

2003-02-17 Thread Brad Harriger
Is there any way to find out what privileges a user has to an NDS object 
throught LDAP?


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



RE: [PHP] PHP 5

2003-02-18 Thread Brad Young
Your best bet is to view the recorded on-line seminars that Zeev Suraski gave on this 
subject.

Go to: http://www.zend.com/iseminar.php

View these ones: 
The Future of PHP and the Zend Engine 2
The Future of PHP and the Zend Engine 2 - Part 2 Examples and tutorials 

Brad
__
Brad Young
[EMAIL PROTECTED] 
Zend - The PHP Company
 


>-Original Message-
>From: Adrian Portsmouth [mailto:[EMAIL PROTECTED]]
>Sent: Monday, February 17, 2003 7:46 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] PHP 5
>
>
>Hi,
>
>I have been checking out the books on Amazon.com and it seems there is a
>PHP5 book in the works due to be released on March the 4th. Does anyone
>know where I can find out information about this new release of PHP,
>what changes there are etc?
>
>TIA
>
>Adrian
>
>www.phpscriptsearch.com
>
>
>-- 
>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




Re: [PHP] Help with authentication 'design'

2003-02-18 Thread Brad Pauly
> I've searched the archives, bit it's not helping me much purely because it's
> not specific PHP code I'm after, but rather help with a login system design.
> So far I've got a PHP_AUTH based login which checks against a MySQL
> database, and if the user's details are correct it updates the database with
> their IP and login time, then creates sessions variables for their username
> and security level (for admins, mods etc). However, the more I read, the
> more I worry about security, so I want to try and get this as good as I can
> possibly get it with security my main concern. What I hope to achieve is
> some reusable code. All the tutorials and sample code I look at say don't
> use this in a production environment because it's not secure. When I'm happy
> with what I've got I'll make the code available, hopefully this will be a
> joint effort and any credit will be given.
> So far the steps I have are;
> 
> Set $auth to false
> Are PHP_AUTH_USER and PHP_AUTH_PW set ?
>   Yes -> Connect to database
>  check user/pw exists in database
>  if they do then set $auth to true
>   
> Is $auth false ?
>   Yes -> Display login box with header(); 
> 
>   No  -> update database with ip and time
>  create sessions variables
>  forward to next page
> 
> I'm after two things; ideas for a better (more comprehensive) design and
> potential security holes. Are sessions a bad idea ? Should I store them in
> my database ? Is the initial HTTP authentication a bad idea (because of
> either security or browser compatability) and can I make the HTTP
> authentication more secure ? Should I stick with a regular login form ? Is
> checking for a username session variable on each following page enough ?

I would recommend not using the client's IP address for any kind of
authentication. It is well known that some large ISPs (AOL) use proxies
so one client could have two different IP addresses in two subsequent
requests.

Sessions are not a bad idea. The default file storage works well unless
you want them in a database for some reason (possibly a server farm with
load balancing and you don't want sticky sessions).

If you are worried about sending passwords as plain text you could
either use SSL or JavaScript to create a hash of the password instead.
This has been discussed recently.

Client authentication is the real risk here. Using the built in session
management will set either a cookie or URL variable that is used to
lookup session information. I would recommend using this method and
combining it with another check of some sort. That way if cookies are
stolen or a URL is e-mailed or bookmarked with a PHPSESSID in it, you
still have a chance of avoiding a client interfering with another
client's session. One possible way of doing this would be to create a
sort of fingerprint (like an md5 hash) of the client based on the HTTP
headers that the client sends. Then store the fingerprint in a session
variable and check it on each request. User-Agent and Accept-Language
might be good choices. Here are some others to choose from:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.3

HTH,
Brad




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




[PHP] application security

2003-02-18 Thread Brad Pauly
Hey Everyone,

There have been a couple of threads lately about application security. A
while ago I wrote a short article that digs into this a bit and explores
one way of increasing security. I cleaned it up this morning and put it
up on my site if anyone is interested. 

http://robinsontech.com/articles/web_app_security.php

If you have any comments on it I would like to hear them. And a quick
thanks to Chris Shiflett for his input.

Cheers,
Brad


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




Re: [PHP] ayuda mysql

2003-02-21 Thread Brad Pauly
> estoy tratando de programar un messenger en php y
> sale este mensaje y no se como arreglarlo...no lo entiendo
> 
> Warning: MySQL Connection Failed: Unknown MySQL Server Host 'misitio.cl/' (2) in 
>/../messengerphp/cabesera.php on line 87
> 
> Warning: Supplied argument is not a valid MySQL-Link resource in 
>/../messengerphp/cabesera.php on line 88

Creo que su problema es el '/' al fin de 'misito.cl/'.

Brad



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




Re: [PHP] general question ?

2003-02-24 Thread Brad Bonkoski
How about changing your post method to 'post' instead of 'get'?
Right now it looks like you do not declare the method at all so it defaults
to get.
" method=post>

And then of course you will have to us the $_POST['user'] instead of
$_GET['user']

HTH
-Brad

Jonas Geiregat wrote:

> http://kemu.ath.cx/intranet/login.phps
> when I press submit everything is OK it works like I want it to work but
> I'm not happy with the result I see in my url window
> I see this
> http://localhost/intranet/login.php?user=kemu&passwd=test&submit=login
> I don't like it that you can know the passwd
> is there a way to just make this login.php and not with all the vars I
> send with it
>
> --
> 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



RE: [PHP] Zend Encoder

2003-02-25 Thread Brad Young
Hi, 

Allow me to clear the air:

1. Zend does not have a way to decode a php file that was encoded using Zend Encoder.  
 
 (For those of you paying attention to details, note the word "decode", not 
"decrypt". Zend Encoder does not encrypt. US gov't lawyers, please take note :)  

2. Even the inherent knowledge that Zend has about our own product would not enable us 
to access encoded software. At most, we theoretically could develop code that could 
access some of the string elements in a script, but definitely not any actual code.  
(As a comparison, it would be like looking at a .EXE file in Windows, but even more 
convoluted.)   Needless to say, even this minor capability has never and will never be 
developed or utilized by Zend.

3. Zend Encoder is the most secure way to deliver php code. That said, no protection 
scheme is absolutely 100% protected.

Brad
__
Brad Young
Director, Product Marketing
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
www.zend.com <http://www.zend.com> 
Zend - The PHP Company
 


>-Original Message-
>From: Thomas Johnsson [mailto:[EMAIL PROTECTED]
>Sent: Monday, February 24, 2003 6:51 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Zend Encoder
>
>
>This might sound a bit paranoid, but since I don't know how it works, i'll
>ask anyway.
>
>If I encrypt a file using the Zend Encoder, is there anyone at zend who can
>view it, or it it an unreversable encryption?
>
>// Thomas
>
>
>
>
>-- 
>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



RE: [PHP] what are the planned features of php 5?[Scanned]

2003-02-26 Thread Brad Young
You can also view the recorded on-line seminars that Zeev gave, which go into even 
more detail.

http://www.zend.com/iseminar.php
The Future of PHP and the Zend Engine 2
The Future of PHP and the Zend Engine 2 - Part 2 Examples and tutorials 

Brad

>-Original Message-
>From: Michael Egan [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, February 26, 2003 2:19 PM
>To: neko; [EMAIL PROTECTED]
>Subject: RE: [PHP] what are the planned features of php 5?[Scanned]
>
>
>Neko,
>
>Out of curiosity I had a look at the php.net site and related 
>sites and eventually came across this link:
>
>http://www.zend.com/images/press/Feb_2003-4_Zeev_PHP5.pdf
>
>I think this gives the details you're after.
>
>Michael Egan
>
>-Original Message-
>From: neko [mailto:[EMAIL PROTECTED]
>Sent: 26 February 2003 10:58
>To: [EMAIL PROTECTED]
>Subject: [PHP] what are the planned features of php 5?[Scanned]
>
>
>I read something a while back about more OO features, but I was 
>wondering if
>there is a roadmap anywhere?
>
>cheers,
>neko
>
>


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



[PHP] Bizarre gethostbyname() problem

2003-03-07 Thread Brad Hubbard
If I run the following code from the command line ("php -q socktest.php") it 
works fine. If I try to run it through a browser gethostbyname fails (prints 
unchanged host name).



What gives?

Brad


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



[PHP] string validation functions

2003-03-12 Thread Brad Esclavon
trim($a_string); // removes all newline, carriage returns, and formating


$in_str_var_name=str_replace("search_for", "replace_with",
$in_str_var_name);

replaces any strings or chars

also- check out php.net documentation on string-- many other useful
functions for string manipulation



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



[PHP] Re: string validating

2003-03-12 Thread Brad Esclavon
trim($a_string); // removes all newline, carriage returns, and formating


$in_str_var_name=str_replace("search_for", "replace_with",
$in_str_var_name);

replaces any strings or chars

also- check out php.net documentation on string-- many other useful
functions for string manipulation




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



Re: [PHP] Crypting Passwords for storage.

2003-03-13 Thread Brad Bonkoski
What about using the md5() function, and store them that way.  Then when one is
sent to the server encrypt it and so a string compare on the two encrypted text
strings.  Like strings encrypted with md5 will result in the same encrypted
string.  Of course there is no way to decrypt them.  This is all done on server
side though, so perhaps you should utilize SSL to send them over the internet.
HTH
-Brad

"Philip J. Newman" wrote:

> I have a user admin for a site, how ever passwords are stored in plane text.
> Is there away to crypt and then read the crypt when verifying that string vs
> the plane text in the password box?
>
> --
> Philip J. Newman.
> Head Developer
> [EMAIL PROTECTED]
>
> --
> 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] php/mySQL time comparison

2003-03-14 Thread Brad Wright
Hi all,

I have been tearing my hair out for weeks with this problem, hope someone
can help. 

I want to pull all data out of a mysql table that falls between two dates (a
start-time and end-time).

I use PHP to allow the user to specify the time interval, creating 2
variables 
'startTime' and 'endTime'. These are formatted thus: 2002-02-25 00:00:00
(-MM-DD HH:mm:ss).

I then use the syntax:
$query = "select * from Job_TB where teamNo = $teamNo AND startTime >=
$timeFrom AND endTime <= $timeTo";
$result = mysql_query($query,$db) or die ("somethings wrong");

to query the mysql DB. But it doesnt work. Is there a glaring error in my
syntax? 

Can anyone help with this as its driving me nuts

Hope someone can help, thanks in advance,
brad
Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strength, in water there are
bacteria


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



Re: [PHP] php/mySQL time comparison

2003-03-14 Thread Brad Wright
Thanks people, thank you very very much. the missing quotes were the
problem. Can't beleive I kept missing that, everytime I re-read the code.

Sorted now, and I've still got some hair!!

You people are legends!!!
Cheers,

Brad 


Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strength, in water there are
bacteria

> From: Brad Wright <[EMAIL PROTECTED]>
> Date: Sat, 15 Mar 2003 00:33:15 +1000
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] php/mySQL time comparison
> 
> Hi all,
> 
> I have been tearing my hair out for weeks with this problem, hope someone
> can help. 
> 
> I want to pull all data out of a mysql table that falls between two dates (a
> start-time and end-time).
> 
> I use PHP to allow the user to specify the time interval, creating 2
> variables 
> 'startTime' and 'endTime'. These are formatted thus: 2002-02-25 00:00:00
> (-MM-DD HH:mm:ss).
> 
> I then use the syntax:
> $query = "select * from Job_TB where teamNo = $teamNo AND startTime >=
> $timeFrom AND endTime <= $timeTo";
> $result = mysql_query($query,$db) or die ("somethings wrong");
> 
> to query the mysql DB. But it doesnt work. Is there a glaring error in my
> syntax? 
> 
> Can anyone help with this as its driving me nuts
> 
> Hope someone can help, thanks in advance,
> brad
> Cheers,
> 
> Brad 
> 
> 
> Nel vino la verità, nella birra la forza, nell'acqua i bacilli
> --
> In wine there is truth, in beer there is strength, in water there are
> bacteria
> 
> 
> -- 
> 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] Non systems-wide auto_prepend_file

2003-03-16 Thread Brad Hubbard
Is there any way anyone can think of to set up 
auto_prepend_file/auto_append_file so that they only affect one virtual 
domain on an Apache webserver (not system wide)?

Cheers,
Brad

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



Re: [PHP] how do i work with an "object"

2003-07-03 Thread Brad Pauly
greg brant wrote:
imap_headder info returns an "object".

print_r works to see all the stuff containd within but when i try to acces
it via
print object[date];

i get naff all
You need to assign the object to a variable first. There are some 
examples in the user contributed notes in the manual, but essentially 
something like this:

$header = imap_header($foo, $bar);
print $header->date;
http://us4.php.net/manual/en/function.imap-headerinfo.php

Brad



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


Re: [PHP] Sending a PDF page

2003-07-03 Thread Brad Pauly
Todd Cary wrote:
In this code:

 if ($prtpdf) {
include "letter_new.php";
exit;
  }
I create a PDF page, however I would like to continue within the script 
(not have the exit).  If I do that, the PDF page is corrupted by the 
script code.

What is the best solution for this?
I am assuming that "letter_new.php" outputs the contents of the PDF you 
are generating. You could use output buffering to grab the PDF and then 
go on with your script:

if ($prtpdf) {
ob_start();
include "letter_new.php";
$pdf_buffer = ob_get_contents();
ob_end_clean();
}
http://us2.php.net/manual/en/ref.outcontrol.php

Brad



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


Re: [PHP] Re: Red Hat 9, Apache 2, and PHP

2003-07-03 Thread Brad Pauly
Todd Cary wrote:
Linux is quite new for me, so please forgive me if my questions are 
rather basic.

I have RH 9 installed and I want to add the Interbase extensions to PHP 
and then recompile Apache.  Conceptually I understand what has to be 
done, but I do not know the steps or syntax.  Is there documentation 
available for doing this?
Just to be sure I understand, by "add" do you mean recompiling with 
support for InterBase? If so you will need to add --with-interbase when 
you run configure.

http://www.php.net/manual/en/ref.ibase.php

Have you already compiled apache? If so you can probably just tell 
configure where apxs is. --with-apxs=/path/to/apache/bin/apxs

http://www.php.net/manual/en/install.apache.php

Brad



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


Re: [PHP] Re: Red Hat 9, Apache 2, and PHP

2003-07-03 Thread Brad Pauly
Just thought I would share my experience with RH9. I have been running 
Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came 
out anyway, and 4.3.1 prior to that) on a test server. All are compiled 
from source. The only problem I have had was a bug with the version of 
mogrify that is bundled with RH9. That was fixed by 'upgrading' to an 
older version. Other than that it has been fine.

Brad





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


Re: [PHP] URL problem

2003-07-07 Thread Brad Pauly
Sparky Kopetzky wrote:
and intercepting it with:

if ($_SERVER['QUERY_STRING'] = "") { disp_cat(); }

However, nothing is happening. phpinfo show $_SERVER['QUERY_STRING'] as 'no value', so this should work.

Anyone know why this doesn't work??
Yes. You are using an assignment operator where you should be using a 
comparison operator. Try using == (or ===):

if ($_SERVER['QUERY_STRING'] == "") { disp_cat(); }

http://us4.php.net/manual/en/language.operators.assignment.php
http://us4.php.net/manual/en/language.operators.comparison.php
Brad



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


Re: [PHP] qry not running??

2003-07-07 Thread Brad Pauly
Micah Montoy wrote:
//get category info
$result = mssql_query("SELECT cat_id, cat_name FROM category WHERE cat_id =
'$cat_name'");
$catID = mssql_result($result,0,"cat_id");  //line 32
$catName = mssql_result($result,0,"cat_name");  //line 33
I'm getting the error:

Warning: mssql_result(): Bad row offset (0) in
c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 32
Warning: mssql_result(): Bad row offset (0) in
c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 33
Is your WHERE clause what you want it to be?

WHERE cat_id = '$cat_name'

I don't know what $cat_name is, but since you have a cat_name column, I 
am wondering if you are comparing two different things.

Brad



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


Re: [PHP] Permissions on server

2003-07-08 Thread Brad Pauly
On Tue, 2003-07-08 at 07:21, Steve Jackson wrote:
> If I set permissions of my server root to chmod 777 that's a security
> risk right?
> How do I set my server to allow me to write a file to my web root from
> another directory using PHP? Or is it a Unix problem?
> 
> I have a generator file writes a string to a text file and then renames
> the text file as a PHP file however it occurred to me while I was doing
> this that chmod 777 the root might not be a good idea.
> 
> Anyone have a simple fix or idea for this?

Change the ownership on the directory to whichever user apache is
running as (this is the User directive in your httpd.conf file). Then
you can restrict the permissions on that directory. You could probably
make it 600 if you want.

Brad

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



Re: [PHP] Please assist - been on this for hours - Permissions onserver

2003-07-10 Thread Brad Pauly
Steve Jackson wrote:
I don't particularly need to *write* to the root directory. I do need to move the file to the root directory though as it's part of a CMS system. I can write the file to a directory which is adequately protected, but there has to be a way to move the file after it is written (to the root from said protected directory). The file is designed to be generated by another user. There are easier ways to design a CMS system I realise but this is my goal, to allow a user to simply generate a file which then is placed in the webroot after it has been written. I thought that this would be the easy part. Any more ideas? Thanks for your help Jason I appreciate it.  
Writing and moving require the same permissions. Also, there is a big 
difference between root and webroot. Which one are you talking about?

- Brad



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


Re: [PHP] How do I dump a blob or text into a mySQL Database?

2003-07-14 Thread Brad Pauly
Dan Anderson wrote:
I'm trying to split up a file and dump it into a mySQL database BLOB. 
Wherever I run the query:

mysql_query("INSERT INTO table (field) VALUES ('{$buffer}')");

Nothing ever shows up in the table -- whethere field is a text or a blob
and whether I dump in text or binary.  Oddly enough when I run the query
I get no error, and can print it and run it through a mySQL terminal,
and it works.
Anyone have any ideas?
Is $buffer empty? I would start there.

- Brad



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


Re: [PHP] Moving Files/ Temporary Names

2003-07-14 Thread Brad Pauly
caspar kennerdale wrote:
- I'm a little confused. The files are already in there real location. It is
just that someone may want to change that location at a later date.
e.g. they upload an image to a folder and two months later decide it is
better placed in a different folder.
Or am I missing something really obvious.

The other solution I can see is to copy the file to the new location and
delete the original
Check out rename(). That might be what you want.

http://us3.php.net/rename

Also, if you are on *nix (I don't remember if there is an equivalent in 
MS windows), you could use the mv command via the exec function.

- Brad





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


Re: [PHP] How To Ask Questions - Some List Guidelines

2003-07-14 Thread Brad Pauly
Burhan Khalid wrote:
Listees,

  Personally, I'm getting a little annoyed by this, and rather than
  flame any thread in general, I would like to post this note
  regarding some guidelines that I believe constitute responsible list
  posting.
Here is a another resource on mailing list etiquette that some might 
find useful.

http://www.catb.org/~esr/faqs/smart-questions.html

- Brad



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


RE: [PHP] zend optimizer for 4.3.2

2003-07-17 Thread Brad Young
Yes, Zend Optimizer definitely does support 4.3.X.

Brad
__
Brad Young
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
www.zend.com <http://www.zend.com> 
Zend - The PHP Company
 



>-Original Message-
>From: Adrian Teasdale [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 17, 2003 2:20 PM
>To: Michael Rubin; [EMAIL PROTECTED]
>Subject: RE: [PHP] zend optimizer for 4.3.2
>
>
>I might be wrong (it's been known in the past!) but I think that theirs
>supports 4.3.x
>
>Best regards
>
>Adrian
>sourceguardian.com
>
>> -Original Message-
>> From: Michael Rubin [mailto:[EMAIL PROTECTED]
>> Sent: 17 July 2003 10:30
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] zend optimizer for 4.3.2
>>
>>
>> Does anyone know when Zend Optimizer will support up to PHP 
>version 4.3.2?
>> Currently it only supports up to 4.3.0.
>>
>> Sincerely,
>>
>> Michael Rubin
>>
>>
>>
>> --
>> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Javascript multi text box form validation?

2003-07-18 Thread Brad Pauly
Johnny Martinez wrote:
Hi all,
I'm having an issue with quotes, slashes, and apostrophes being submitted
into text boxes and they are breaking my sql statements. So, I am trying to
do two things.
1. javascript form validation to prevent the double quotes and slashes
2. a sql_scrubber function to handle the apostrophes
I am not strong in JS. I have found examples on the net for the form
validation but my problem is that I want to use the same function on each
text box for the testing of slashes and double quotes.
Does anyone have or know of a location out there? Is their a better solution
for what I am trying to do? Thanks in advance.
You might want to check out stripslashes().

http://us2.php.net/manual/en/function.addslashes.php

- Brad



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


Re: [PHP] explode and escape character for string separator

2003-07-18 Thread Brad Pauly
Reuben D. Budiardja wrote:

I did strive for that. But whatever character I choose, the problem remains 
that we can't guarantee that it's going ot be only used as deliminater, since 
the deliminated string is an input from user. So the problem remains.
Are you adding the delimiter? If so, maybe you could escape that 
character in the users input when you add it.

- Brad



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


Re: [PHP] classes v. functions

2003-07-18 Thread Brad Bonkoski


Chris Shiflett wrote:

> --- Andu <[EMAIL PROTECTED]> wrote:
> > This may show my ignorance or my refusal to take for granted
> > something I don't fully understand but I have a hard time
> > figuring out the advantage of using classes as opposed to just
> > functions.
>
> They are entirely different. While OO fans will find my over-simplification
> disgusting, a class is basically a way to associate data with the functions
> that manipulate that data.
>
> Chris
>

AKA 'encapsulation'  Of course you can achieve this by making a programmer
imposed requirement saying that global variable X can only be altered by
function Xf(), or Typedef X can only be altered by functions Xf(), but OO make
this more of a hard requirement, and not the programmer imposed or 'soft'
requirement.  Of course there are other ideas like polymorphism and inheritance
and such.  Just google for Object oriented programming, and read some of the
numerous exposes on the subject to get a general idea.
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=object+oriented+programming

-Brad


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



Re: [PHP] Changing numbers

2003-07-21 Thread Brad Pauly
Roger B.A Klorese wrote:

* Thus wrote zavaboy ([EMAIL PROTECTED]):



I have the following numbers:

12.400
666.75
23
369.2
3.234
How can I make them have at least 2 decimal places?
So, they will output:
12.40
666.75
23.00
269.20
3.234
What's so hard about this?

He wants two or more *significant* positions preserved.  Show to at least
two decimal places, trailing zeroes truncated beyond the 2nd decimal place.
I am not sure what he is after, but I don't think it has to do with 
significant figures (if that is what you meant). If that was the case, 
12.400 should remain 12.400. Trailing zeros to the right of a decimal 
are significant.

- Brad



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


  1   2   3   4   5   6   7   8   >