Re: [PHP] Array Question

2007-03-25 Thread Stut

[EMAIL PROTECTED] wrote:

$count=count($data->legs->leg);
$k=0;
while($k < $count)
  {

$legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket'];


Drop the quotes in the key...

$legrow[$data->legs->leg[$k]['legId']]=$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket'];


$k++;
}

My thinking is that the $data->legs->leg[$k]['legId'] is the legId and I
might use that as a key. This however does not work.


It will work if they are all unique. If you have any duplicates they 
will overwrite previous assignments.


-Stut

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



Re: [PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Stut
Man-wai Chang wrote:
>>> create table temp ( big5 char(2) ) character set big5 collate big5_bin;
>>> insert into temp ( big5 ) values ( 0x9f54 );
>>> insert into temp ( big5 ) values ( 0x9f53 );
>>> The 2nd query will report duplicated key. How should I fix the problem?
>> What does this has to do with PHP?
>> First of all I don't see any PHP code, and second this is an error in
>> your SQL query, so you should be on the MySQL list.
> 
> I used mysqli_query() to send the SQL. How could I make it work?

That really doesn't make this question PHP-related. You really do need
to ask on a MySQL mailing list. This has nothing to do with PHP, and
you're more likely to get a useful answer from a MySQL-specific list.

If you really want to try and justify asking this question here, try the
queries in the command-line MySQL client. If it works there but not
through mysqli_query() then you might have a case for asking here.

-Stut

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



Re: [PHP] Name Capitalization

2007-03-25 Thread Tijnema !

On 3/24/07, Paul Novitski <[EMAIL PROTECTED]> wrote:

At 3/23/2007 07:27 PM, Richard Lynch wrote:
> > In this case, the OP has an existing list of names he wants to
> > de-capitalize, not an ongoing stream of new names from people who
> > might be trained.
>
>The solution remains:
>
>Hire a human.
>
>The computer will never get accurate enough.
>
>The exception might be if you are dealing with MILLIONS of names,
>where a filter would pay off.  You'd still need human review and a
>validation process that involved human oversight to a significant
>percentage.
>
>I do not think the OP has millions of names.


Richard,

If you'd take the time to read this thread, you'll see that many of
us have pointed out the impossibility of correcting name
capitalization 100%.  You'll also see that the OP has indicated that
even an imperfect solution with capitalization errors would be better
in his situation than the current all-caps condition of the list, and
that therefore a software solution would be helpful.

There is usually more than one solution to a given problem.  In this
case, as in many others, there appears to be an inverse relation
between cost and error rate.  Depending on goals and budgets, one may
choose a higher error rate and a lesser cost over a smaller error
rate at a higher cost.

In this particular case, it's my opinion that even human operators
would not be able to reduce the error rate to zero unless one could
afford to pay them to contact some of the people individually to find
out how they spell their names.  There simply are no rules that apply
across the board, whether applied by machine or flesh.  Anything but
personal interviews is just informed guesswork.

Regards,

Paul


Sure, even a human can't know if the name should be MacDonald or
Macdonald, McDonald or Mcdonald. Unless of course he's contacting the
one who entered this name.

Tijnema

__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com

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




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



Re: [PHP] Re: My own "captcha" from 2 years ago......

2007-03-25 Thread Tijnema !

On 3/25/07, Jake McHenry <[EMAIL PROTECTED]> wrote:

 Sorry.. Was playing around with dates and how long I've been sitting
here watching this generate random numbers. Lol .. The only lines
referring to the "captcha" are the img lines... As you can tell... Calling
the next script... Should I do it this way? I'm pretty sure that is the
problem, cause the session variable is being created and set in that second
script which is called  Session[security_code] is created in rnum1.php,
and session[code] is created in rnum2.php... Which I didn't include here...
But is the same concept only bigger.

Index.php
";

$after = $_SESSION['security_code'];

if (!isset($_SESSION['start_time']))
{
 $_SESSION['start_time'] = time();
}
else
{
 $_SESSION['current_time'] = time();
}

$running_time = mktime(date("H", $_SESSION['current_time'])-date("H",
$_SESSION['start_time']), date("i", $_SESSION['current_time'])-date("i",
$_SESSION['start_time']), date("s", $_SESSION['current_time'])-date("s",
$_SESSION['start_time']), date("m", $_SESSION['start_time']), date("d",
$_SESSION['start_time']), date("Y", $_SESSION['start_time']));

echo 'Before: ' . $before . 'After: ' . $after . 'Time: ' .
date("H:i:s m-d-Y", $running_time) . '' .
$_SESSION['code'];

?>




Rnum1.php




I believe the way this script behaves is quite normal. Look at the way
the scripts are called. First index.php, then rnum1.php and then
rnum2.php.
First index.php is called and all session variables are posted with
that action. Then rnum1.php is called, and the session variables are
edited. Then rnum2.php is called, session variables are edited again,
but index.php is never called again, and so the session variables are
never send to the script. Until you load the script again.
So if you're implementing this in a POST form, the browser should
submit both POST and the right session variables to your parse script.

Example code which works :)

index.php:
";
echo "";
?>

parse.php:


This is btw not a very useful CAPTCHA, because it should stop
computers from submitting data, but a little bit smart programmer
knows that he has to get session information from the image, and
submit that to the form. Or what i saw used lately by a cracker, he
was just using his own values in session and post, and so they matched
:)
So you should never send the same code as the code that has to be
entered. Even encrypting with MD5 only won't stop hackers to defeat
your script. Maybe you could use a database with this, so that you
pass a reference to the real number shown. So that you have an ID and
a CODE column. in rnum1.php you store the code into the database, and
get the ID of the last one inserted (A discussion about this was
around this list lately) Then you show the code in an image, and you
store the ID in the session. Then you get ID from the session, then
get the code from the database using the ID and compare it to the one
entered in the form.

Tijnema





> -Original Message-
> From: itoctopus [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 25, 2007 12:49 AM
> To: php-general@lists.php.net
> Subject: [PHP] Re: My own "captcha" from 2 years ago..
>
> Hey Jake,
> I checked the thing, and I tell you I did lots and lots of
> captchas in my
> life and they mainly rely on the session.
> Is it possible for you to post the script so that me (or
> anyone else for
> that matter) fix it for you?
>
> Take care,
>
> --
> itoctopus - http://www.itoctopus.com
> ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Well, I've been creating my own... Since like two years
> ago... Lol.. But
> > this is the KNOWN name now. Anyways... How can I get
> the info from the
> > image creation script back to my main script? Sessions DO
> NOT WORK! They
> > give me the previous entry instead of the current.. Which
> obviously won't
> > work... This was on the back burner for a long time, but my
> boss said
> .
> > Oh wow.. That looks cool... And I told him I had started it
> a long time
> > ago.. But never finished it cause he told me to work on
> something else...
> > Anyways... U can see what I mean http://nittanytravel.com:8080/
> >
> > The numbers surrounding the images displayed are session
> values created in
> > the image scripts...which as you will see are the previous
> value It
> may
> > be a simple fix.. But once again... I'm tired... And had
> one too many long
> > island iced teas tonight to think about this. And
> yes... My boss works
> > me even on saturdays after happy hour :(
> >
> >
> > Thanks,
> > Jake
> >
> >
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.446 / Virus Database: 268.18.17/731 - Release
> Date: 3/23/2007
> > 3:27 PM
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Dat

[PHP] Imp

2007-03-25 Thread PHP Developer
hello all,
As we know, there are a lot of php design patterns(more than 20). I want to 
know that which patterns are important and necessary for ZCE exam.
PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. 
But i still feel that more patterns are necessary for the exam.
Cheers,
Daniel
 
-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.

[PHP] Important Design Patterns

2007-03-25 Thread PHP Developer
hello all,
As we know, there are a lot of php design patterns(more than 20). I want to 
know that which patterns are important and necessary for ZCE exam.
PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. 
But i still feel that more patterns are necessary for the exam.
Cheers,
Daniel
 
-
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.

[PHP] Important Design Patterns

2007-03-25 Thread PHP Developer
hello all,
As we know, there are a lot of php design patterns(more than 20). I want to 
know that which patterns are important and necessary for ZCE exam.
PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. 
But i still feel that more patterns are necessary for the exam.
Cheers,
Daniel


 
-
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.

Re: [PHP] Check a string does not contain invalid characters

2007-03-25 Thread Jochem Maas
John Comerford wrote:
> Hi Folks,
> 
> I am new to php.
> 
> I want to accept a character string which I will use as a unique user
> id.  I want to check the string to ensure the user has not typed
> characters that I consider to be invalid as part of a user id.  I was
> thinking of doing something along the lines of:
> 
> if (strpbrk($userid, '[EMAIL PROTECTED]&*()_+=-{}[]\\|;\':"<>?,./`') <> null) 
> {
> blah, blah, blah..
> 
> but I think that would still leave me open to control characters. I am
> thinking maybe I should loop through the string character by character
> and check it's ascii value (using ord) is within the range of a-z and A-Z ?
> Is this the best way of achieving this ?  Is there a php command to do
> something similar ?  I have done a few web searches and haven't come up
> with much.

you've had a couple of preg_match() examples, you might also consider
the following to php extensions as a possible means to input checking:

http://nl2.php.net/ctype
http://nl2.php.net/filter

> 
> TIA,
>  JC
> 

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



Re: [PHP] Important Design Patterns

2007-03-25 Thread Tijnema !

On 3/25/07, PHP Developer <[EMAIL PROTECTED]> wrote:

hello all,
As we know, there are a lot of php design patterns(more than 20). I want to 
know that which patterns are important and necessary for ZCE exam.
PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. 
But i still feel that more patterns are necessary for the exam.
Cheers,
Daniel


I'm not able to give an answer, but was it really needed to post this
message three times??

Tijnema




-
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.


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



[PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Man-wai Chang
> queries in the command-line MySQL client. If it works there but not
> through mysqli_query() then you might have a case for asking here.

For the 13081 chinese alphabets I tried, only 1 one failed, and it's
0x9f54. mysqli_query() should have escaped the string for me. So ...

I suppose most PHP programmers are also experts in MySQL (they are
basically tied). SO I tried my luck here. :)

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10)  Linux 2.6.20.4
  ^ ^   21:24:01 up 1 day 8:36 0 users load average: 1.00 1.02 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

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



[PHP] OT - How to code a link to download a file (program file)

2007-03-25 Thread Lorin Lund

I have a web site where I have posted some programs I have written as
shareware.

click here to download

works great with mozilla but with MS IE it tries to display the program.
What is the simplest way to set it up so that the user just clicks on the
link and the program gets downloaded for storage/execution on their
system?

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



Re: [PHP] Re: newbie question about storing big5 codes into mysql-5.0.24a

2007-03-25 Thread Jochem Maas
Man-wai Chang wrote:
>> queries in the command-line MySQL client. If it works there but not
>> through mysqli_query() then you might have a case for asking here.
> 
> For the 13081 chinese alphabets I tried, only 1 one failed, and it's
> 0x9f54. mysqli_query() should have escaped the string for me.

mysqli_query() doesn't escape anything for you - your assumption that
it *should* is WRONG.

try this: http://php.net/manual/en/function.mysqli-real-escape-string.php

> So ...
> 
> I suppose most PHP programmers are also experts in MySQL (they are
> basically tied). 

incorrect supposition. most php programmers have experience using
RDBMs because of the dynamic nature of the websystems they build.

mysql and php and not tied at all .. they just happen to be used together
frequently.

> SO I tried my luck here. :)
> 

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



Re: [PHP] Important Design Patterns

2007-03-25 Thread Jochem Maas
Tijnema ! wrote:
> On 3/25/07, PHP Developer <[EMAIL PROTECTED]> wrote:
>> hello all,
>> As we know, there are a lot of php design patterns(more than 20). I
>> want to know that which patterns are important and necessary for ZCE
>> exam.
>> PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and
>> ActiveRecord. But i still feel that more patterns are necessary for
>> the exam.
>> Cheers,
>> Daniel
> 
> I'm not able to give an answer, but was it really needed to post this
> message three times??

it raises the point of refactoring code so that code is not duplicated...
in the same wass as list postings should not be duplicated ;-)

> 
> Tijnema
>>
>>
>>
>> -
>> Finding fabulous fares is fun.
>> Let Yahoo! FareChase search your favorite travel sites to find flight
>> and hotel bargains.
> 

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



Re: [PHP] My own "captcha" from 2 years ago......

2007-03-25 Thread tedd

At 11:28 PM -0400 3/24/07, Jake McHenry wrote:

Well, I've been creating my own... Since like two years ago... Lol.. But
this is the KNOWN name now. Anyways... How can I get the info from the
image creation script back to my main script? Sessions DO NOT WORK! They
give me the previous entry instead of the current.. Which obviously won't
work... This was on the back burner for a long time, but my boss said .
Oh wow.. That looks cool... And I told him I had started it a long time
ago.. But never finished it cause he told me to work on something else...
Anyways... U can see what I mean http://nittanytravel.com:8080/

The numbers surrounding the images displayed are session values created in
the image scripts...which as you will see are the previous value It may
be a simple fix.. But once again... I'm tired... And had one too many long
island iced teas tonight to think about this. And yes... My boss works
me even on saturdays after happy hour :(


Thanks,
Jake


Jake:

Sessions do work. It's simply a matter of logic. Keep your current 
key intact until you need a refresh.


Or you can wait just a bit and I'll give you mine. I've been working 
on an audio Captcha.


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] Re: My own "captcha" from 2 years ago......

2007-03-25 Thread tedd

This is btw not a very useful CAPTCHA, because it should stop
computers from submitting data, but a little bit smart programmer
knows that he has to get session information from the image, and
submit that to the form. Or what i saw used lately by a cracker, he
was just using his own values in session and post, and so they matched
:)
So you should never send the same code as the code that has to be
entered. Even encrypting with MD5 only won't stop hackers to defeat
your script. Maybe you could use a database with this, so that you
pass a reference to the real number shown. So that you have an ID and
a CODE column. in rnum1.php you store the code into the database, and
get the ID of the last one inserted (A discussion about this was
around this list lately) Then you show the code in an image, and you
store the ID in the session. Then you get ID from the session, then
get the code from the database using the ID and compare it to the one
entered in the form.

Tijnema



What about an audio Captcha?

Your thoughts?

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] My own "captcha" from 2 years ago......

2007-03-25 Thread Jake McHenry
Do I call the image creation file in an html  -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 25, 2007 10:33 AM
> To: Jake McHenry; php-general@lists.php.net
> Subject: Re: [PHP] My own "captcha" from 2 years ago..
> 
> At 11:28 PM -0400 3/24/07, Jake McHenry wrote:
> >Well, I've been creating my own... Since like two years 
> ago... Lol.. But
> >this is the KNOWN name now. Anyways... How can I get the 
> info from the
> >image creation script back to my main script? Sessions DO 
> NOT WORK! They
> >give me the previous entry instead of the current.. Which 
> obviously won't
> >work... This was on the back burner for a long time, but my 
> boss said .
> >Oh wow.. That looks cool... And I told him I had started it 
> a long time
> >ago.. But never finished it cause he told me to work on 
> something else...
> >Anyways... U can see what I mean http://nittanytravel.com:8080/
> >
> >The numbers surrounding the images displayed are session 
> values created in
> >the image scripts...which as you will see are the previous 
> value It may
> >be a simple fix.. But once again... I'm tired... And had one 
> too many long
> >island iced teas tonight to think about this. And yes... 
> My boss works
> >me even on saturdays after happy hour :(
> >
> >
> >Thanks,
> >Jake
> 
> Jake:
> 
> Sessions do work. It's simply a matter of logic. Keep your current 
> key intact until you need a refresh.
> 
> Or you can wait just a bit and I'll give you mine. I've been working 
> on an audio Captcha.
> 
> Cheers,
> 
> tedd
> -- 
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release 
> Date: 3/25/2007 11:07 AM
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM
 

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



Re: [PHP] Re: My own "captcha" from 2 years ago......

2007-03-25 Thread Dotan Cohen

On 25/03/07, tedd <[EMAIL PROTECTED]> wrote:

What about an audio Captcha?

Your thoughts?

tedd


I do a lot of my browsing at the university library. I can't have any
sound being made there each time I must enter a capcha. Don't use
audio, or provide an alternative.

Dotan Cohen

http://lyricslist.com/lyrics/artist_albums/52/bad_english.html
http://what-is-what.com/what_is/html.html

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



Re: [PHP] OT - How to code a link to download a file (program file)

2007-03-25 Thread Tijnema !

On 3/25/07, Lorin Lund <[EMAIL PROTECTED]> wrote:

I have a web site where I have posted some programs I have written as
shareware.

click here to download

works great with mozilla but with MS IE it tries to display the program.
What is the simplest way to set it up so that the user just clicks on the
link and the program gets downloaded for storage/execution on their
system?


This code is fine, or your .exe is not a real exe. Or your apache is
totally misconfigured and doesn't output the right Content-Type.

Tijnema


--
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] Computing and calculating dates

2007-03-25 Thread Otto Wyss

Sorry that doesn't work with dates like "1.4.2007".

O. Wyss

Jake McHenry wrote:

Change it to the format strtotime needs? Not hard Or mktime(0, 0, 0,
date("m", $date), date("d", $date)+7, date("Y", $date)); for +7 days... Same
with + 14 days Strtotime is usefull, you can just put first day next
month and it just works... Lol... Then you could explode that back into
mktime, or just into a string. There are many ways to do what your
asking :)

Jake


-Original Message-
From: Otto Wyss [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 24, 2007 4:37 PM

To: php-general@lists.php.net
Subject: Re: [PHP] Computing and calculating dates

Travis Doherty wrote:

Otto Wyss wrote:

  local_formated_date + 7; // days
  local_formated_date > local_formated_first_day_next_month;
  local_formated_date > (current_date + 14)

etc. Which functions are best suited for such calculations?

O. Wyss


www.php.net/strtotime is probably a good start.


Thanks, strtotime isn't able to parse a european formatted date
(dd.mm.). How do I get the timestamp of such a date?

O. Wyss

--
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.446 / Virus Database: 268.18.17/731 - Release 
Date: 3/23/2007 3:27 PM
 





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



Re: [PHP] What is wrong with this function please?

2007-03-25 Thread Robin Wilson

Thanks for the help

The line returns are specified as "\r\n" but in the echo they seem to all be 
on one line. Could that be related to the problem. Also the addresses are 
specified but seem to have been removed???


This is what I specified:
$eol="\r\n";
 $mime_boundary=md5(time());

 # Common Headers
 $headers .= 'From: '.$fromName.'<'.$fromaddress.'>'.$eol;
 $headers .= 'Reply-To: '.$fromName.'<'.$fromaddress.'>'.$eol;
 $headers .= 'Return-Path: '.$fromName.'<'.$fromaddress.'>'.$eol;// 
these two to set reply address

 $headers .= "Message-ID: <".time()."@".$_SERVER['SERVER_NAME'].">".$eol;
 $headers .= "X-Mailer: PHP v".phpversion().$eol;  // These two to 
help avoid spam-filters


I followed some tutorials and they all seemed to tell me to do it this way.

The emails seem to work with other clients and only Exchange doesn't like 
them.

Tested with Squirrel Mail and they were recieved with the attachment etc.

Do you have any more ideas please?
Thanks for the help

Robin

""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]




No sorry, both messages are the same.
Didn't mean to post it twice. Sorry.

Below is what prints out when I echo the message:

$to
[EMAIL PROTECTED]

$subject
Proposal Submission

$headers
From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path:
2HostMe Mailer
Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
multipart/related; boundary="d49718178131ebc038c576f007a40642"



Are these all on the same lines just because of echo? Or are they on their
own lines? Like this:

From: 2HostMe Mailer
Reply-To: Robin Wilson
Return-Path: 2HostMe Mailer
Message-ID: X-Mailer: PHP v4.4.2
MIME-Version: 1.0
Content-Type: multipart/related; boundary="d49718178131ebc038c576f007a40642"


From: should have a from email address, same with reply-to and return-path




$msg
--d49718178131ebc038c576f007a40642 Content-Type: image/gif;
name="betaresource.gif" Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="betaresource.gif"


Same with these, are there any line returns?


R0lGODlhWgAeAPcAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0
BaeyU0RjpRbCw9
UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS
Y3Si1BVzxVcUpn
iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh
9EaiBGbBs7XCFI
byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy
pQdSdKbSVGZiI3
TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk
1ke0theEVXajA9
SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh
cvRSlTeSpUeh06
VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD
BUdUVqi0Riflt5
lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT
RjjDtvmTptljFb
fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU
paZ4aaq32PnniI
loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI
KVpGx7hoqbqJGg
q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ
ieobS6vbzFyLe/
wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd
jY1cTEwo6Ojbe2
saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd
fPxOTc0ezm3uvl
3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP
8ALABaAB4A
QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx
8/IkQA4hQolidP
xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q
qhg+fOjbt5o8K4
KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia
fuVqF08zZw8OLO
HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx
gcZSi5SUMcxxgL
bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp
PsSMvTxwgtXKB0
0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC
I58DGNBtNs0EED
D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ
ThRiG2kLLJGlOU
I08psPABRSlcJpGDDIGUE48YeDOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk
whpyDjSSClmNLJ
H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/
m8AE6n4BBAzz3+
gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xb
RQKhJHIAFGPfWA
Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckM
MNGJwyzzW/YJBM
NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMs
C40w06T9DyDTrg
HHCNy78MUkghdkySxyST9EHJHXZUQgceeMix9CSWNPXIGWSIQUMMNNAgQwwyaB
3DBRdggAE2GFxQ
Axlo94DHJDv8kEPYd2ygQQYZyJ1BAwukFAJICCz/gdMCgjwQxR9eTDABC6C4Ik
osVKDwwOOPpGKM
PfZYyY0odswRxxBFzKGmHJUP8kOHXMtggw0+AEJ5Oea0w4wljMQu+yIMOaJKKr
jXGcJMxADiiQoF
YBGFBho08GgTTQw+RSed/PTE8380QYVSXAgSQQR+cCINVKeMk84tSHRhTjdeLC
NPMLpwdc01KHCT
jCnbmLMNBlOwsw4OMFzzTjJAmBKPMIFohjyAAQpzsENO7LAEM+SxjWCIIx7AMI
UBiwEL1plCFPFo
RzvYEQxlqMMdwFhGNrpQDm6YIhjpQIcUTGCCVvBCGvDABSsocQ16fIEe+GjBEe
AAhzDAgVtbqAAF
/+BxjiNsoR74qMAW6JGPOhBCXEqwgFu8UAYzjKENZWCFLz5DD1jMox5bKAELvj
gBt1QBBZDxwiGa
pQQktIAe9SjBB5TwgWq4AwwO8AAD9ugBCFiiFZrQBCZYgQpUHOENdUikIQhxBD
WooQIOIEQKHpkC
D7zgkph8Aa40KRszlKEMKMgCEo7Thi1sgTlHYEAKJHACLVhhFlqQwCiGAQElOA
ACEMhWtpSQgC0M
gBAkIMEJHGAICayAAR5wAgSgZolg2OISk4BGITQXByNU8w5DMMIQ0oABHsgAHH
qYAQqiYYFihMEC
6KwNBnSgAzH8AA1zYEUcgAAN6sGgDEPIRALCU/8CFKAgAlgAxy2+8AVwgAAEGZ
gCIAJhigY0AAQN
iEALJJCF0XwCCygoQQmI

Re: [PHP] What is wrong with this function please?

2007-03-25 Thread Robin Wilson

Thanks I'll have a look at this.

Robin

"Jochem Maas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

phpmailer.sourceforge.net - a mailing class for php that does everything
you need, there are other alternatives - definitely beats fiddling with
all the required headers yourself.

save yourself a big headache. :-)

Robin Wilson wrote:

Hello

I'm trying to do a function that emails users and sends an attachment.
But I think something is in the wrong order or something as when I send
it Exchange discards it.

This is the function which I have put together from various sources:

I would really appreciate any help as I have been up half the night and
got nowhere!
Thanks
Robin

function sendMail($to, $toName, $from, $fromName, $subject, $message,
$uploadfile, $fileName, $fileType, $fileSize) {
$eol="\r\n";
 $mime_boundary=md5(time());

 # Common Headers
 $headers .= 'From: '. $fromName .' <'. $from .'>'.$eol;
 $headers .= 'Reply-To: '. $toName .' <'. $to .'>'.$eol;
 $headers .= 'Return-Path: '. $fromName.' <'. $from .'>'.$eol;//
these two to set reply address
 $headers .= "Message-ID:
<".$mime_boundary."@".$_SERVER['SERVER_NAME'].">".$eol;
 $headers .= "X-Mailer: PHP v".phpversion().$eol;  // These two
to help avoid spam-filters

 # Boundry for marking the split & Multitype Headers
 $headers .= 'MIME-Version: 1.0'.$eol;
 $headers .= "Content-Type: multipart/related;
boundary=\"".$mime_boundary."\"".$eol;

$msg = " ";

if ($uploadfile != "") {
 # File for Attachment
  $file_name = substr($uploadfile, (strrpos($uploadfile, "/")+1));

  $handle=fopen($uploadfile, 'rb');
  $f_contents=fread($handle, $fileSize);
  $f_contents=chunk_split(base64_encode($f_contents));//Encode
The Data For Transition using base64_encode();
  fclose($handle);

  # Attachment
  $msg .= "--".$mime_boundary.$eol;
  $msg .= "Content-Type: ".$fileType."; 
name=\"".$file_name."\"".$eol;

  $msg .= "Content-Transfer-Encoding: base64".$eol;
  $msg .= "Content-Disposition: attachment;
filename=\"".$file_name."\"".$eol.$eol; // !! This line needs TWO end of
lines !! IMPORTANT !!
  $msg .= $f_contents.$eol.$eol;
}

# Setup for text OR html
  $msg .= "Content-Type: multipart/alternative".$eol;

  # Text Version
  $msg .= "--".$mime_boundary.$eol;
  $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
  $msg .= "Content-Transfer-Encoding: 8bit".$eol;
  $msg .= strip_tags(str_replace("", "\n", $message)).$eol.$eol;

  # HTML Version
  $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
  $msg .= "Content-Transfer-Encoding: 8bit".$eol;
  $msg .= $message.$eol.$eol;

  # Finished
  $msg .= "--".$mime_boundary."--".$eol.$eol;  // finish with two eol's
for better security. see Injection.


// Mail it
mail($to, $subject, $msg, $headers);
} 


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



[PHP] form validation

2007-03-25 Thread al phillips
I''ve tried !preg_match and !eregi to validate my form. I get back whatever the 
user inputs into the textboxes. I would like to validate each textbox before 
submitting and redirect the user after submission?  Here's part of the code
   
  Please enter Letters from A to Z';
 }

 
-
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

[PHP] Re: High quality image resizing

2007-03-25 Thread Al

Let's see an example of an image you'd like to resize and tell us what the new 
size should be.

Markus Fischer wrote:

Hi,

I'm searching for a high quality image resizing facility to be used
within PHP in an Unix/Linux environment.

Probably everyone will now answer: imagecopyresampled()

However, the quality of that functionality doesn't match the
expectations of our designers. I've done my tests with PHP4 and GD lib
2.0.33 and everything produces with them got rejected so far. I was also
going through the comments on php.net regarding self-written Bicubical
algorithm functions, yet their outcome didn't match.

My next step was to try ImageMagick. The quality is much better when
using the 'mogrify' tool from this package, yet not good enough for my
designers.

Of course, their expectations are very high because of their daily usage
of Photoshop. During my research I was running over
http://resizr.lord-lance.com/ which uses an commercial Windows library.
Using a commercial package would be completely fine for me, however I
just haven't found anything, thus this message.

Whether the tool is a PHP library or just an ordinary Unix command
doesn't matter, as long as it is usable from within PHP.

thanks for any hints,
- Markus


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



[PHP] Re: how to control if it is a date

2007-03-25 Thread Al

I try to use drop-down menus whenever possible for things like this;  one each 
for days months years

Then all one needs to do is check for valid dates with checkdate()

Alain Roger wrote:

Hi,

user can enter a string with following format dd.mm..
Application should transform it to postgresql timestamp date.

however, i would like to be sure that what user typed is a real and valid
date.
how can i do that ?

i was thinking to use date(string format,
strtotime(string_entered_by_user)); but it does not ensure me that it is a
valid date...

thx.



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



Re: [PHP] References challenge with PHP4

2007-03-25 Thread Martin Alterisio

2007/3/23, Jochem Maas <[EMAIL PROTECTED]>:


Martin Alterisio wrote:
> 2007/3/20, Jochem Maas <[EMAIL PROTECTED] >:
>
> Robert Cummings wrote:
> > On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote:
> >> ok, I tried it in a whole number of variations -
> >> no joy.
> >>
> >> you should use php5 if you want this kind of reference
> >> stuff - in php5 it just works, php 4 will give you big headaches.
> >
> > Now now, don't be calling PHP5 "ALL THAT" when it can't do it
right
> > either (or did you not check it using PHP5 ;) ;)
>
> god knows what I did - obviously something different to what I
thought
> I was testing :-/
>
> > Everything works fine
> > in PHP4 (also for PHP5 in this case if you just understand that
static
> > vars are buggy *lol* -- and this is first time I've noticed this
> bug).
>
> I have never run into this bug before ... nice catch, seems like
> a viable item for a bug report.
>
>
> Actually, is not a bug, is expected behaviour and documented in the
manual
>
> http://php.net/static
>
> See the last section, named "references with global and static
variables"

I have 2 issues with this:

1. the docs specify php4/ZendEngine1 which suggests php5 is not prone to
this implementation error, the following code seems to suggest that from
the user's
POV the problem no longer exists (as long as there is no use of the
reference operator
inconjunction with objects) in php5 (using the erf operator in php5 with
objects is
almost always wrong anyway):

class Test {
public $foo;
private static $inst;
function get() { if(!isset(self::$inst)) self::$inst = new self; return
self::$inst; }
}
$foo = Test::get();
$foo2 = Test::get();

$foo->foo = "foo";
var_dump($foo, $foo2, ($foo === $foo2));

$foo2->foo = "bar";
var_dump($foo, $foo2);

2. should I have to care about the way something is implemented internally
in order to use a given piece of language functionality without running
into
problems that have a serious wtf factor? I feel not.

oh well.

>
> static and global are implemented internally as references, that makes
> storing references into static variables impossible (which can be solved
> by using arrays of references as seen in Robert Cummings example).



100% behind you. I suffered enough because of this when trying to make code
that works for both php4 and php5 (unsuccesfully most of the times), and
that's why I knew about this "expected behaviour". And if you ever tried to
work with recursion in both functions and abstract data types in older
versions of PHP you'll find the WTF factor being more annoying than ever
(most of the problems have been solved but I still have nigthmares about
$foo =& $foo->next; causing segmentation faults).


[PHP] OT: firstname-lastname fun - SOLVED :) (was: Re: [PHP] preview string with strlen PHP (help))

2007-03-25 Thread Zoltán Németh
2007. 03. 23, péntek keltezéssel 20.36-kor Tijnema ! ezt írta:
> On 3/23/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:
> > 2007. 03. 23, péntek keltezéssel 17.30-kor Dwayne Heronimo ezt írta:
> > > YES this works thank nemeth:
> >
> > your welcome but please call me Zoltán ;)
> > (my first name is Zoltán. in Hungary we write names the opposite order
> > than anywhere else ;) so that's why my mailbox is set to display 'Németh
> > Zoltán' but I sign my mails as 'Zoltán Németh' showing that my first
> > name is Zoltán and last name is Németh :) )
> >
> > greets
> > Zoltán Németh
> 
> Ever thought of reversing it in your mailbox?

okay you win :)
I realized that the reverse order probably won't disturb or confuse
anyone in Hungary as they will know that Zoltán is a first name and
Németh is a family name - so I reversed it now

greets
Zoltán Németh

> 
> Or use a virtual name like me ;)
> 
> Tijnema
> >
> > >
> > >  > >  function previewString($showcatvar) {
> > >
> > >  $minitxt = $showcatvar;
> > >  $len = strlen($minitxt);
> > >
> > >  if ($len > 235)
> > >  {
> > >   $len = 235;
> > >  }
> > >  else
> > >  {
> > >   $len = $len;
> > >  }
> > >
> > >  $newstring = substr($minitxt,0,$len);
> > >
> > >  $previewtext = $newstring;
> > >
> > >  return $previewtext;
> > > }
> > > ?>
> > >
> > > and to display it:
> > >
> > > 
> > >
> > > cheers
> > >
> > > Dwayne
> > >
> > >
> > >
> > >
> > > ""Nmeth Zoltn"" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > 2007. 03. 23, pntek keltezssel 16.55-kor Dwayne Heronimo ezt rta:
> > > >> Dear all,
> > > >>
> > > >> hmm.. sorry the $previewstext thing was a typo in my mail.
> > > >>
> > > >> But yes it is working but it will only display the first record of the
> > > >> recordset. I have like a list for items with short text in a page and 
> > > >> of
> > > >> course made a query to make the database variables available. Which 
> > > >> where
> > > >> the variable $row_show_cat['text']; comes from.
> > > >>
> > > >> This is why I thought that i may have to rewrite it into a function to
> > > >> display the $row_show_cat['text']; in a repeated reagion.
> > > >>
> > > >>
> > > >> I have rewritten my function:
> > > >>
> > > >>  > > >>  function previewString($showcatvar) {
> > > >>
> > > >>  $minitxt = $showcatvar;
> > > >>  $len = strlen($minitxt);
> > > >>
> > > >>  if ($len > 235)
> > > >>  {
> > > >>   $len = 235;
> > > >>  }
> > > >>  else
> > > >>  {
> > > >>   $len = $len;
> > > >>  }
> > > >>
> > > >>  $newstring = substr($minitxt,0,$len);
> > > >>
> > > >>  $previewtext = $newstring;
> > > >>
> > > >>  $previewtext = $whowcatvar;
> > > >
> > > > what is the meaning of the above line???
> > > > you are giving an undefined value (default NULL) to $previewtext, just
> > > > after you gave it the right value
> > > > delete that line and you might be well
> > > >
> > > > greets
> > > > Zoltn Nmeth
> > > >
> > > >>
> > > >>  return $previewtext;
> > > >> }
> > > >> ?>
> > > >>
> > > >> And to to show it later in the page:
> > > >> 
> > > >> but this still won't anywould display anything. :S
> > > >>
> > > >> Please let me know.
> > > >>
> > > >> ""Tijnema !"" <[EMAIL PROTECTED]> wrote in message
> > > >> news:[EMAIL PROTECTED]
> > > >> > On 3/23/07, Dwayne Heronimo <[EMAIL PROTECTED]> wrote:
> > > >> >> Dear All,
> > > >> >>
> > > >> >> I am very new to programming. I want to make a preview text that 
> > > >> >> would
> > > >> >> display only a part of the text that is a text field in a database.
> > > >> >>
> > > >> >> //Begin Make preview string
> > > >> >>
> > > >> >>  $minitxt = $row_show_cat['text'];
> > > >> >>  $len = strlen($minitxt);
> > > >> >>
> > > >> >>  if ($len > 235)
> > > >> >>  {
> > > >> >>  $len = 235;
> > > >> >>  }
> > > >> >>  else
> > > >> >>  {
> > > >> >>  $len = $len;
> > > >> >>  }
> > > >> >>
> > > >> >>  $newstring = substr($minitxt,0,$len);
> > > >> >>
> > > >> >>  $previewtext = $newstring;
> > > >> >>
> > > >> >> //End Make preview string
> > > >> >>
> > > >> >> But if I want to display this somewhere in the page it will only
> > > >> >> display
> > > >> >> the
> > > >> >> first record of at every text column row 
> > > >> >>
> > > >> >> Althought I am very new to php and programming. I thought maybe I
> > > >> >> should
> > > >> >> rewrite it into a function. But my function won't work.
> > > >> >>
> > > >> >>
> > > >> >> function previewString($showcatvar) {
> > > >> >>
> > > >> >>  $minitxt = $showcatvar;
> > > >> >>  $len = strlen($minitxt);
> > > >> >>
> > > >> >>  if ($len > 235)
> > > >> >>  {
> > > >> >>  $len = 235;
> > > >> >>  }
> > > >> >>  else
> > > >> >>  {
> > > >> >>  $len = $len;
> > > >> >>  }
> > > >> >>
> > > >> >>  $newstring = substr($minitxt,0,$len);
> > > >> >>
> > > >> >>  $previewtext = $newstring;
> > > >> >>
> > > >> >>  $previewtext = $whowcatvar;
> > > >> >>
> > > >> >> }
> > > >> >>
> > > >> >>
> > > >> >> and to display it in the page:
> > > >> >>
> > > >> >> 
> > > >> >>
> > > >> 

Re: [PHP] Optimization of all mysql databases on a server

2007-03-25 Thread Chris

itoctopus wrote:

The purpose of this script is to optimize all associated tables in all
databases on a mysql server. This script is working great, you can put in a
CRON and run it every day. Feel free to throw in your 2 cents!


It's going to time out if you have any large databases or tables.

Also a much easier option is to run

mysqlcheck -o ...

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

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



Re: [PHP] Re: Book Suggestion for ZCE

2007-03-25 Thread Zoltán Németh
2007. 03. 24, szombat keltezéssel 14.00-kor itoctopus ezt írta:
> Sams - Zend Php Certification Study Guide for the certification.
> An excellent book on PHP is PHP5 Power Programming (by Prentice Hall).

also a great book about PHP5 is: Advanced PHP Programming (by George
Schlossnagle)

greets
Zoltán Németh

> 
> --
> itoctopus - http://www.itoctopus.com
> ""Danial Rahmanzadeh"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > hey dudes,
> > i want to know that which books are good to read  before ZCE exam.
> >  I have read php 5 and php 4 study guides and php 4 practice tests. I have
> > also read php|architect's guide to php security and bought a 10 slot
> sample
> > exam. What else do you suggest?
> > cheers,
> > Danial
> >
> 

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



RE: [PHP] My own "captcha" from 2 years ago......

2007-03-25 Thread tedd

At 10:49 AM -0400 3/25/07, Jake McHenry wrote:

Do I call the image creation file in an html 
Jake

The audio is for visually impaired and unless their also deaf, they 
have sound turned on.


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] Re: My own "captcha" from 2 years ago......

2007-03-25 Thread tedd

At 5:05 PM +0200 3/25/07, Dotan Cohen wrote:

On 25/03/07, tedd <[EMAIL PROTECTED]> wrote:

What about an audio Captcha?

Your thoughts?

tedd


I do a lot of my browsing at the university library. I can't have any
sound being made there each time I must enter a capcha. Don't use
audio, or provide an alternative.

Dotan Cohen


Dotan:

I understand. There are all sorts of reasons why you want to provide 
more than just one form of captcha IF you're going to use something 
like that (sighted, blind, deaf, deaf-blind, dyslexic, and so on). 
And, there are all sorts of captchas that can be navigated by most.


I was mainly interested in Tijnema's comments regarding sending the 
key for a captcha and how it could be cracked.


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] What is wrong with this function please?

2007-03-25 Thread Zoltán Németh
2007. 03. 25, vasárnap keltezéssel 19.25-kor Robin Wilson ezt írta:
> Thanks for the help
> 
> The line returns are specified as "\r\n" but in the echo they seem to all be 
> on one line. Could that be related to the problem. Also the addresses are 
> specified but seem to have been removed???

\r\n is okay for mail() function, but will not show up in html display
you might consider using nl2br() function before echoing those values
out:
http://www.php.net/manual/en/function.nl2br.php

the addresses might not show up in your browser because they are
enclosed in < and > signs. so the browser tries to interpret them as
html tags, and ignores them as it doesn't know about that kind of tags.
use htmlspecialchars() to avoid this:
http://www.php.net/manual/en/function.htmlspecialchars.php

but that is definitely not the problem with your function, as mail()
expects \n or \r\n to be there...

greets
Zoltán Németh

> 
> This is what I specified:
> $eol="\r\n";
>   $mime_boundary=md5(time());
> 
>   # Common Headers
>   $headers .= 'From: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Reply-To: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Return-Path: '.$fromName.'<'.$fromaddress.'>'.$eol;// 
> these two to set reply address
>   $headers .= "Message-ID: <".time()."@".$_SERVER['SERVER_NAME'].">".$eol;
>   $headers .= "X-Mailer: PHP v".phpversion().$eol;  // These two to 
> help avoid spam-filters
> 
> I followed some tutorials and they all seemed to tell me to do it this way.
> 
> The emails seem to work with other clients and only Exchange doesn't like 
> them.
> Tested with Squirrel Mail and they were recieved with the attachment etc.
> 
> Do you have any more ideas please?
> Thanks for the help
> 
> Robin
> 
> ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
> >
> > No sorry, both messages are the same.
> > Didn't mean to post it twice. Sorry.
> >
> > Below is what prints out when I echo the message:
> >
> > $to
> > [EMAIL PROTECTED]
> >
> > $subject
> > Proposal Submission
> >
> > $headers
> > From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path:
> > 2HostMe Mailer
> > Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
> > multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> Are these all on the same lines just because of echo? Or are they on their
> own lines? Like this:
> 
> From: 2HostMe Mailer
> Reply-To: Robin Wilson
> Return-Path: 2HostMe Mailer
> Message-ID: X-Mailer: PHP v4.4.2
> MIME-Version: 1.0
> Content-Type: multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> From: should have a from email address, same with reply-to and return-path
> 
> 
> >
> > $msg
> > --d49718178131ebc038c576f007a40642 Content-Type: image/gif;
> > name="betaresource.gif" Content-Transfer-Encoding: base64
> > Content-Disposition: attachment; filename="betaresource.gif"
> 
> Same with these, are there any line returns?
> 
> > R0lGODlhWgAeAPcAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0
> > BaeyU0RjpRbCw9
> > UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS
> > Y3Si1BVzxVcUpn
> > iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh
> > 9EaiBGbBs7XCFI
> > byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy
> > pQdSdKbSVGZiI3
> > TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk
> > 1ke0theEVXajA9
> > SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh
> > cvRSlTeSpUeh06
> > VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD
> > BUdUVqi0Riflt5
> > lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT
> > RjjDtvmTptljFb
> > fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU
> > paZ4aaq32PnniI
> > loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI
> > KVpGx7hoqbqJGg
> > q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ
> > ieobS6vbzFyLe/
> > wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd
> > jY1cTEwo6Ojbe2
> > saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd
> > fPxOTc0ezm3uvl
> > 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP
> > 8ALABaAB4A
> > QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx
> > 8/IkQA4hQolidP
> > xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q
> > qhg+fOjbt5o8K4
> > KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia
> > fuVqF08zZw8OLO
> > HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx
> > gcZSi5SUMcxxgL
> > bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp
> > PsSMvTxwgtXKB0
> > 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC
> > I58DGNBtNs0EED
> > D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ
> > ThRiG2kLLJGlOU
> > I08psPABRSlcJpGDDIGUE48YeDOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk
> > whpyDjSSClmNLJ
> > H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/
> > m8AE6n4BBAzz3+
> > gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT3

RE: [PHP] What is wrong with this function please?

2007-03-25 Thread Jake McHenry
Ok.. It all looks ok... I did some googling and found that Exchange requires
the Message-ID to be unique Which it really should be anyways... and
yours isn't. try adding time() or something to make it unique :)

Jake


> -Original Message-
> From: Robin Wilson [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 25, 2007 2:25 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] What is wrong with this function please?
> 
> Thanks for the help
> 
> The line returns are specified as "\r\n" but in the echo they 
> seem to all be 
> on one line. Could that be related to the problem. Also the 
> addresses are 
> specified but seem to have been removed???
> 
> This is what I specified:
> $eol="\r\n";
>   $mime_boundary=md5(time());
> 
>   # Common Headers
>   $headers .= 'From: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Reply-To: '.$fromName.'<'.$fromaddress.'>'.$eol;
>   $headers .= 'Return-Path: 
> '.$fromName.'<'.$fromaddress.'>'.$eol;// 
> these two to set reply address
>   $headers .= "Message-ID: 
> <".time()."@".$_SERVER['SERVER_NAME'].">".$eol;
>   $headers .= "X-Mailer: PHP v".phpversion().$eol;  
> // These two to 
> help avoid spam-filters
> 
> I followed some tutorials and they all seemed to tell me to 
> do it this way.
> 
> The emails seem to work with other clients and only Exchange 
> doesn't like 
> them.
> Tested with Squirrel Mail and they were recieved with the 
> attachment etc.
> 
> Do you have any more ideas please?
> Thanks for the help
> 
> Robin
> 
> ""Jake McHenry"" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
> >
> > No sorry, both messages are the same.
> > Didn't mean to post it twice. Sorry.
> >
> > Below is what prints out when I echo the message:
> >
> > $to
> > [EMAIL PROTECTED]
> >
> > $subject
> > Proposal Submission
> >
> > $headers
> > From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path:
> > 2HostMe Mailer
> > Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
> > multipart/related; boundary="d49718178131ebc038c576f007a40642"
> 
> 
> Are these all on the same lines just because of echo? Or are 
> they on their
> own lines? Like this:
> 
> From: 2HostMe Mailer
> Reply-To: Robin Wilson
> Return-Path: 2HostMe Mailer
> Message-ID: X-Mailer: PHP v4.4.2
> MIME-Version: 1.0
> Content-Type: multipart/related; 
> boundary="d49718178131ebc038c576f007a40642"
> 
> 
> From: should have a from email address, same with reply-to 
> and return-path
> 
> 
> >
> > $msg
> > --d49718178131ebc038c576f007a40642 Content-Type: image/gif;
> > name="betaresource.gif" Content-Transfer-Encoding: base64
> > Content-Disposition: attachment; filename="betaresource.gif"
> 
> Same with these, are there any line returns?
> 
> > R0lGODlhWgAeAPcAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0
> > BaeyU0RjpRbCw9
> > UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZS
> > Y3Si1BVzxVcUpn
> > iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh
> > 9EaiBGbBs7XCFI
> > byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYy
> > pQdSdKbSVGZiI3
> > TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk
> > 1ke0theEVXajA9
> > SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZh
> > cvRSlTeSpUeh06
> > VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbD
> > BUdUVqi0Riflt5
> > lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlT
> > RjjDtvmTptljFb
> > fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlU
> > paZ4aaq32PnniI
> > loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvI
> > KVpGx7hoqbqJGg
> > q46bpTFadkuDqoahtHSCjImUnKGstJylq8THyTlQX2KAk1txfcDL0ayxtIadqZ
> > ieobS6vbzFyLe/
> > wcXJyrG2t7i8vJaXl4eIiL/Bv7y+vLW2tbCxsLu8uqusqrq7uMfIwtDQzM3Nyd
> > jY1cTEwo6Ojbe2
> > saSjoMC+uePh3MnGv83KxO7q4+3o4MPAu726teLazujh1+bf1erk2+nj2tzUyd
> > fPxOTc0ezm3uvl
> > 3dTKvszBttHGu/Hs58G1q8e7sb6wp6ubkrKimbipoJSMiKCSjD1MWCH5BAEAAP
> > 8ALABaAB4A
> > QAj/AB2tGrhKlSRJjxAifMTwkSOHjh4+ajSxIUMEIZZkRICAySYmIENwEuFnkx
> > 8/IkQA4hQolidP
> > xAJNiUUTFpM/OJMwCQGFCRQosP48uVKsmJcBWLhwQZqK1zJ1z04FgwcvSzt11q
> > qhg+fOjbt5o8K4
> > KKFLGjt18MJEWOfu3bx5XsbAuCrNmbR08Gytg7etFidiaKlQMSVuHah26z5lia
> > fuVqF08zZw8OLO
> > HQoTUlBYY6cNW7V6927J+tTIoCZLu/qwGuKmjes2rd+MmR1mjNgKuHPjfuGidx
> > gcZSi5SUMcxxgL
> > bcy4Ud4GiYfnThykmDWrhJQqVkhwSKCkBAgO4Dl0/zChwIQgLIIIaXES3QEJOp
> > PsSMvTxwgtXKB0
> > 0emiS1QuRpBEBAkjouhSQw0xWHOBNTGUEgoiGCSY4AU5TEOEHYqcMQ0eNuhQCC
> > I58DGNBtNs0EED
> > D6BQQDdQhBBCMK90g9ISU4xzyy+vNAPKIecs0AUIWJxDwJACLWNOL5OcAk86RQ
> > ThRiG2kLLJGlOU
> > I08psPABRSlcJpGDDIGUE48YeDOKyMEGKL30sgREr9RSCy+paDJIMHK6Qk
> > whpyDjSSClmNLJ
> > H6KYckUggzAxBSK5INJEBiCwoAsinzQwwqWbdOLMPPjkw88+/dQxyz776OMNP/
> > m8AE6n4BBAzz3+
> > gP/Djz4vpFBqBS8wgCoHWeSTDzjQXHPPF/hAI6s+qFDgKTT38DPBLJ6ims8+xb
> > RQKhJHIAFGPfWA
> > Ew44JdzjaTT67CMBA07YcUkj0khyCQKgIAIIMNSE8wQdulRTTSc77LAGGejckM
> > MNGJwyzzW/YJBM
> > NeFcwQO94YSiyCJn6HCNGzC4MUMy16DjhQIco0MBCi0cgk4BBUTwTQS/fBNOMs
> > C40w06T9DyDTrg
> > HHCNy78MUkghdky

Re: [PHP] Important Design Patterns

2007-03-25 Thread Travis Doherty
Tijnema ! wrote:

> On 3/25/07, PHP Developer <[EMAIL PROTECTED]> wrote:
>
>> hello all,
>> As we know, there are a lot of php design patterns(more than 20). I
>> want to know that which patterns are important and necessary for ZCE
>> exam.
>> PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and
>> ActiveRecord. But i still feel that more patterns are necessary for
>> the exam.
>> Cheers,
>> Daniel
>
>
> I'm not able to give an answer, but was it really needed to post this
> message three times??
>
> Tijnema

Taking the Zend ZCE exam puts you under a strict NDA.  Nobody can tell
you what you will see on the exam.

Study the exam guide and if design patterns really interest you then
take it to the next level out of personal interest.  Since patterns are
not "PHP-only" you can really study these from any language, or even
grab a language-agnostic design pattern book.

Travis Doherty

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



RE: [PHP] My own "captcha" from 2 years ago......

2007-03-25 Thread Jake McHenry
Like I said... Even if they have sound turned on.. Which all my sets do...
Most of them don't have speakers... That was put into effect over a year ago
due to some people listening to those damn screaming prank things at full
volume... Anyways... I was searching the php site, and it said there used to
be a bug that looks somewhat similar to my problem, but it said it was fixed
long ago... Not sure if this is even close to it or not, but this is the
first time I've run into a sessions problem.

Just to simplify...

I have this on index.php

';

$after = $_SESSION['code'];

echo $before .' ' . $after;
?>

Then in image.php is my captcha... And where the session variable 'code' is
being created and updated...

In image.php is this:




When I view index.php, the image displays, with a new code each time...
Working as it should, but the session variable echos out the previously
generated value, instead of the current value to match whats in the
picture... I'm not sure what I've done... But you can see from
http://nittanytravel.com:8080/$before and $after have the same value... 

In that bug report I was reading it said that this happened until
session_start was called again.. But it said it was fixed back in php4... 

Not sure what I missed :(

Thanks,
Jake




> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 25, 2007 7:54 PM
> To: Jake McHenry; 'tedd'; php-general@lists.php.net
> Subject: RE: [PHP] My own "captcha" from 2 years ago..
> 
> At 10:49 AM -0400 3/25/07, Jake McHenry wrote:
> >Do I call the image creation file in an html  tried a bunch of
> >things, and this is the only way I've been able to display 
> the image inline
> >so far, without the image headers blocking the rest of my output
> >
> >I've been reading and somewhat interested in the audio and 
> pic captchas..
> >But audio won't work for my intranet... Hardly any of the sets have
> >speakers... Productivity solution I guess...
> >
> Jake
> 
> The audio is for visually impaired and unless their also deaf, they 
> have sound turned on.
> 
> 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
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release 
> Date: 3/25/2007 11:07 AM
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM
 

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



[PHP] SNMP support on compile from source FastCGI

2007-03-25 Thread Matt Arnilo S. Baluyos (Mailing Lists)

Hello everyone,

I'm trying to add the SNMP module with a compile-from-source PHP 5.2.1
installation. This is on a Fedora Core 5 system with target web server
being lighttpd.

This is the configure script that I have:

./configure --enable-fastcgi --enable-discard-path
--enable-force-redirect --with-mysql --with-mbstring --with-mcrypt
--with-gd --with-jpeg-dir=/usr/lib/ --with-zlib-dir=/usr/lib/
--with-net-snmp --with-gnu-ld

I don't have any errors whatsoever at this point. However, when I do
the "make" I get an error like the one below:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

I tried to check if it was missing a package but I see that
libtool-ltdl is already installed on the server.

Anyone know what could be wrong here?

Regards,
Matt

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

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



[PHP] Re: SNMP support on compile from source FastCGI

2007-03-25 Thread Matt Arnilo S. Baluyos (Mailing Lists)

On 3/26/07, Matt Arnilo S. Baluyos (Mailing Lists)
<[EMAIL PROTECTED]> wrote:

Hello everyone,
I'm trying to add the SNMP module with a compile-from-source PHP 5.2.1
installation. This is on a Fedora Core 5 system with target web server
being lighttpd.

This is the configure script that I have:

./configure --enable-fastcgi --enable-discard-path
--enable-force-redirect --with-mysql --with-mbstring --with-mcrypt
--with-gd --with-jpeg-dir=/usr/lib/ --with-zlib-dir=/usr/lib/
--with-net-snmp --with-gnu-ld

I don't have any errors whatsoever at this point. However, when I do
the "make" I get an error like the one below:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

I tried to check if it was missing a package but I see that
libtool-ltdl is already installed on the server.

Anyone know what could be wrong here?


Ok. I got it to compile. Turns out I had to add the libtool-ltdl-devel package.

It's strange though because I don't see an SNMP section on the result
of a phpinfo();

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.

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



Re: [PHP] Optimization of all mysql databases on a server

2007-03-25 Thread Tijnema !

On 3/26/07, Chris <[EMAIL PROTECTED]> wrote:

itoctopus wrote:
> The purpose of this script is to optimize all associated tables in all
> databases on a mysql server. This script is working great, you can put in a
> CRON and run it every day. Feel free to throw in your 2 cents!

It's going to time out if you have any large databases or tables.


What about set_time_limit(99)??



Also a much easier option is to run

mysqlcheck -o ...


That's true :)

Tijnema


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

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




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



Re: [PHP] My own "captcha" from 2 years ago......

2007-03-25 Thread Tijnema !

On 3/26/07, Jake McHenry <[EMAIL PROTECTED]> wrote:

Like I said... Even if they have sound turned on.. Which all my sets do...
Most of them don't have speakers... That was put into effect over a year ago
due to some people listening to those damn screaming prank things at full
volume... Anyways... I was searching the php site, and it said there used to
be a bug that looks somewhat similar to my problem, but it said it was fixed
long ago... Not sure if this is even close to it or not, but this is the
first time I've run into a sessions problem.

Just to simplify...

I have this on index.php

';

$after = $_SESSION['code'];

echo $before .' ' . $after;
?>

Then in image.php is my captcha... And where the session variable 'code' is
being created and updated...

In image.php is this:




When I view index.php, the image displays, with a new code each time...
Working as it should, but the session variable echos out the previously
generated value, instead of the current value to match whats in the
picture... I'm not sure what I've done... But you can see from
http://nittanytravel.com:8080/$before and $after have the same value...

In that bug report I was reading it said that this happened until
session_start was called again.. But it said it was fixed back in php4...

Not sure what I missed :(

Thanks,
Jake


Did you read my previous post?
I explained why this occurs, as it is normal that a script behaves like this.


I believe the way this script behaves is quite normal. Look at the way
the scripts are called. First index.php, then rnum1.php and then
rnum2.php.
First index.php is called and all session variables are posted with
that action. Then rnum1.php is called, and the session variables are
edited. Then rnum2.php is called, session variables are edited again,
but index.php is never called again, and so the session variables are
never send to the script. Until you load the script again.
So if you're implementing this in a POST form, the browser should
submit both POST and the right session variables to your parse script.


Above is what you missed i think ;)



Example code which works :)

index.php:
";

echo "";
?>

parse.php:



Did you test above code? You could use it like that.



This is btw not a very useful CAPTCHA, because it should stop
computers from submitting data, but a little bit smart programmer
knows that he has to get session information from the image, and
submit that to the form. Or what i saw used lately by a cracker, he
was just using his own values in session and post, and so they matched
:)
So you should never send the same code as the code that has to be
entered. Even encrypting with MD5 only won't stop hackers to defeat
your script. Maybe you could use a database with this, so that you
pass a reference to the real number shown. So that you have an ID and
a CODE column. in rnum1.php you store the code into the database, and
get the ID of the last one inserted (A discussion about this was
around this list lately) Then you show the code in an image, and you
store the ID in the session. Then you get ID from the session, then
get the code from the database using the ID and compare it to the one
entered in the form.


This might be of interest, because cracking should be avoided as
CAPTCHA is meant to stop from autosubmitting by computers.

Tijnema







> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 25, 2007 7:54 PM
> To: Jake McHenry; 'tedd'; php-general@lists.php.net
> Subject: RE: [PHP] My own "captcha" from 2 years ago..
>
> At 10:49 AM -0400 3/25/07, Jake McHenry wrote:
> >Do I call the image creation file in an html  tried a bunch of
> >things, and this is the only way I've been able to display
> the image inline
> >so far, without the image headers blocking the rest of my output
> >
> >I've been reading and somewhat interested in the audio and
> pic captchas..
> >But audio won't work for my intranet... Hardly any of the sets have
> >speakers... Productivity solution I guess...
> >
> Jake
>
> The audio is for visually impaired and unless their also deaf, they
> have sound turned on.
>
> 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
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/733 - Release
> Date: 3/25/2007 11:07 AM
>
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.18/733 - Release Date: 3/25/2007
11:07 AM


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