[PHP] issue with MySQL procedure and a result set

2006-04-19 Thread Alain Roger
Hi,

I'm trying to run a MySQL Procedure from one of my PHP page.

1. the procedure works perfectly under MySQL (it gives the correct results),
so no issue from this side.
2.user is able to connect without any issue to MySQL RDBMS, so no issue from
this side.

Here is what i've as error message when PHP page is displayed :
"PROCEDURE test1 can't return a result set in the given context"

i've searched on internet and i've found 2 intereseting information :
1. i should update MyODBC connector. But i do not understand it as it work
perfectly under MySQL query browser or under another Query tool.
2. i should add a flag in my command : mysql_connect();
this flag should be something like MULTI_CLIENT_. After controling the
PHP documentation (v5.1 and 4.6) this flag does not exist...

here is my stored procedure "test1" (this procedure as 1 IN parameter named
"criteria"


BEGIN
   DECLARE crit VARCHAR(256) DEFAULT "";
   SET crit = CONCAT("%", criteria, "$");
   SELECT * FROM persons WHERE login LIKE crit;
END
...

So what should i do ?

thanks a lot for help.

Alain


Re: [PHP] PHP CLI not present

2006-04-19 Thread Richard Lynch
On Wed, April 19, 2006 3:01 pm, Jeff wrote:

> I'm running PHP Ver 4.4.1 on a redhat ES3 system.  It appears that the
> CLI is not running or not present.  I thought it was installed by
> default in versions >= 4.3.x.
>
> If I run /usr/local/bin/php -v at the command line I get nothing.
>
> How do I get the PHP CLI working?

I don't remember at which version CLI became installed by default with
Apache, but if you still have your config.nice script you'd want to
check that, and the config.log and config.debug to see what happened.

It's possible you just installed it in some different directory...

Something like:
locate php | grep bin
might be useful for finding that.

You could also download the source and install just the CLI pretty
quickly and easily.  Or you may want to upgrade anyway :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Mnogosearch extension - not working with php 4.4.2

2006-04-19 Thread Richard Lynch
On Wed, April 19, 2006 4:55 pm, Yannick Warnier wrote:
> for. From the type of errors (very unclear and undetailed) that I get,
> my first guess would be that one function declaration in php_mnogo.c
> or
> php_mnogo.h would not be recognized anymore (because it used a funny
> declaration?).

Call me crazy, but I think you should post the actual error messages
-- the first few, at least.

C compiler error messages are frequently arcane, incredibly terse, and
complete gibberish to anybody other than a C programmer...

But they are rarely unclear and undetailed, once you have figured out
what the error message means the first time you encounter it.

'Course, I probably won't be the guy who understand the message
either, as my C skills have 20 years of rust and only a couple days of
scraping that off.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Query for two fields with the same name

2006-04-19 Thread Richard Lynch
On Wed, April 19, 2006 5:55 pm, Kevin Murphy wrote:
> $connection = "select * from connection, pr WHERE connection.area_id
> = '$gateway_link' and connection.pr_id = pr.id";
>
> Both tables have a field called ID but they have different
> information in them. $row['id'] gets me the one from the table called
> "pr" but I need to call the ID from the table connection.

You have now stumbled into ONE of many reasons why "SELECT *" is just
Bad Code. :-)

Figure out which fields you REALLY need and specify them by name in
place of *

In addition, to actually solve your problem, you'll be able to do
something like:

SELECT pr.id as pr_id, connection.id as connection_id, area_id, ...

You can use   " as XYZ" to sort of "rename" any column you want on the
fly, and that is what it will be called.

It's also really handy when you have formulas in your select:

SELECT (x.size + y.size) as sum, x.id, y.id from x, y ...

Without the "as sum" $row['something goes here'] will have your sum
answer, but what will it be called?

I don't even know the answer to that one, cuz whatever it is, it's
just too painful compared to using 'sum'

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Robin Vickery
On 19/04/06, Matt Todd <[EMAIL PROTECTED]> wrote:
>
> I know that PHP is a functional language, and secondly, an OO
> language, but I think that you can blend these things better and have
> the OO brought to the forefront a bit more.

PHP is not a functional language, it's an imperative language.

 -robin

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



Re: [PHP] Query for two fields with the same name

2006-04-19 Thread admin
Maybe something like this :

$connection = "SELECT t2.id AS idtwo, t1.id AS idone FROM connection AS
t1, pr AS t2 WHERE t1.area_id
= '$gateway_link' AND t1.pr_id = t2.id";

> This is probably a simple question, but I can't seem to find the
> answer online.
>
> I'm using this query:
>
> $connection = "select * from connection, pr WHERE connection.area_id
> = '$gateway_link' and connection.pr_id = pr.id";
>
> Both tables have a field called ID but they have different
> information in them. $row['id'] gets me the one from the table called
> "pr" but I need to call the ID from the table connection.
>
> --
> Kevin Murphy
> Webmaster: Information and Marketing Services
> Western Nevada Community College
> www.wncc.edu
> 775-445-3326
>
> --
> 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] Modest Module: perror (exec error codes)

2006-04-19 Thread Richard Lynch
I've written my first external Module for PHP: perror

It provides functionality I've always felt was "missing" in PHP.

I'm particularly interested in feedback from anybody who has written
PHP extensions of their own -- I'm sure there's room for improvement
in my very rusty C skills!

Here's why I wrote it.  Consider this:


Wouldn't it be nice if PHP "knew" the error message that went with
Error code number 1?

Well, install this 'perror' module, and PHP does know :-)

As a special bonus, since it was pretty much the exact same thing, I
threw in the codes for "signals" as well.

A quick phpize and compile and a php.ini change, and you're set!

I can't promise no problems, but it's pretty dang simple, really, so
should be pretty safe.  And you can always comment out php.ini
extension setting pretty quickly if it causes problems.

See sample output (live, actually) and download the source:

http://www.l-i-e.com/perror/

PS
*HUGE* thanks to the folks on PHP-Dev who put up with my bumbling
through the compiling process for an extension on a shared server!

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] pause until page is loaded

2006-04-19 Thread Jochem Maas

Richard Lynch wrote:

On Tue, April 18, 2006 4:19 pm, Benjamin Adams wrote:


I created a script to redirect to a download auto.
but it redirects before the Whole page is loaded.
How do I pause until page is loaded?



If you want to wait until the BROWSER loads the whole page, then the
BROWSER has to tell you when it has finished.

Since the communication between the BROWSER and PHP is limited to:
BROWSER:  Gimme this URL
PHP: Here, here's your data.  Bye.  I'm gone.

Note that the browser could spend an HOUR (in principle) rendering the
data sent by PHP, if that rendering was particularly difficult.

So, clearly, PHP is *NOT* going to be able to do what you want.

You are therefore urged to consult a Javascript list.

Or an AJAX list.

Or, really, any kind of mailing list about running code on a BROWSER,
but not PHP, which runs on the SERVER.


I don't suppose this is the time to mention that Wez Furlong wrote a
browser plugin that allows you to run php code in the browser in the same
way you would normally run javascript ;-) 
[http://pecl.php.net/package/PHPScript]

(Benjamin - just to be clear, Richard is correct and my comment doesn't help
your problem 1 iota, sorry :-)



:-)



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



Re: [PHP] Query for two fields with the same name

2006-04-19 Thread Jochem Maas

NOT a php question.

Kevin Murphy wrote:
This is probably a simple question, but I can't seem to find the  answer 
online.


I'm using this query:

$connection = "select * from connection, pr WHERE connection.area_id  = 
'$gateway_link' and connection.pr_id = pr.id";


doing "SELECT * FROM bla" is not recommended, better to actually specify _just_
the fields you need.

"SELECT c.id AS cid, p.id AS pid FROM connection AS c, pr AS p WHERE ... "

this stuff can be found in the mysql docs.



Both tables have a field called ID but they have different  information 
in them. $row['id'] gets me the one from the table called  "pr" but I 
need to call the ID from the table connection.




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



Re: [PHP] session_destroy

2006-04-19 Thread Jochem Maas

Shannon Doyle wrote:

Hi People,

Trying to get a session to destroy correctly, however the darn thing just
refuses to destroy. I call the following in a separate webpage in a effort
to destroy the session, only to find that the session still persists.




Any help would be appreciated.


I looked into really nuking a session quite a while back
and after searching around and scraping together some snippets of
code I came up with this:



hth

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



[PHP] Query for two fields with the same name

2006-04-19 Thread Kevin Murphy
This is probably a simple question, but I can't seem to find the  
answer online.


I'm using this query:

$connection = "select * from connection, pr WHERE connection.area_id  
= '$gateway_link' and connection.pr_id = pr.id";


Both tables have a field called ID but they have different  
information in them. $row['id'] gets me the one from the table called  
"pr" but I need to call the ID from the table connection.


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326

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



Re: [PHP] Date time Comparison

2006-04-19 Thread John Wells
I'd agree with what Richard is alluding to: turn your two dates into
timestamps, and then compare those.  mktime() or strtotime() should
help you out.

HTH,
John W

On 4/18/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
> http://php.net/mktime may be more suitable, depending on the date
> range of the input.
>
> That said, as far as I can tell, your $formated_expiry_date is the
> SAME as your $expiry_date, except possibly for some separation
> characters.
>
> If the separation characters are ALWAYS the same, you could just do:
>
> $current_date = date('Y/m/d H:i:s'); //match formatting of expiry date.
> return $current_date < $expiry_date;
>
>
> On Tue, April 18, 2006 5:02 pm, Murtaza Chang wrote:
> > Hi everyone,
> > this is the function I have written for comparing a date time please
> > tell me
> > if my logic is correct ? and if there's a better alternative please
> > let me
> > know of that as well.
> > // This function will return 1 if supplied date is expired
> > function is_expire($expiry_date){
> > $current_date=date('YmdHis');
> > $year=substr($expiry_date,0,4);
> > $month=substr($expiry_date,5,2);
> > $day=substr($expiry_date,8,2);
> > $hour=substr($expiry_date,11,2);
> > $min=substr($expiry_date,14,2);
> > $sec=substr($expiry_date,17,2);
> > $formated_expiry_date=$year.$month.$day.$hour.$min.$sec;
> > if ($current_date>=$formated_expiry_date)
> > return 1;
> > else
> > return 0;
> > }
> > --
> > Murtaza Chang
> >
>
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> 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] Mnogosearch extension - not working with php 4.4.2

2006-04-19 Thread Yannick Warnier
Hello guys,

I'm hesitating on how to formulate this. I'm a newbie when it comes to
PHP extensions/modules development, but I have a problem which forces me
to go into source code for the mnogosearch extension (mnogosearch is an
open-source search engine).

The extension (version 1.96) has not been worked on since January 2005
and is unlikely to get any attention in the coming months from its
authors, but upgrading PHP from 3.3.10 to 4.4.2 has broken it, and I am
trying to figure out why.

I have had a look at the PHP 4 changelog
(http://www.php.net/ChangeLog-4.php) to see if I could spot anything
obvious, but as I said I'm a newbie and don't exactly know what to look
for. From the type of errors (very unclear and undetailed) that I get,
my first guess would be that one function declaration in php_mnogo.c or
php_mnogo.h would not be recognized anymore (because it used a funny
declaration?).

The php_mnogo.c and php_mnogo.h are located in this file:
http://www.mnogosearch.org/Download/php/mnogosearch-php-extension-1.96.tar.gz 
(site is down at the moment but should be back up soon I guess)

Could someone give me some advice on what to look for? (or have a look
at these C files and tell me what's wrong - but I wouldn't dare asking)
The files look very simple (just a few declarations, around 3000
lines :-) in all - including a lot of empty lines).

Anyway, I would be glad for any kind of help you could provide me with
around this.

I suppose it would be easier if I could bring the difference to only one
PHP version (like "between 3.4.1 and 3.4.0) but I am afraid I don't have
enough machines to screw up changing PHP versions all the time to try
it.

Also, if my guess is right that it would be a declaration not working
anymore, I guess code changes related to extensions would have all been
done in 4.0.0...

Thank you,

Yannick

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Jay Blanchard
[snip]
How's it working for you?  I'm still waiting on the top 10 to finish the
questionnaire...
[/snip]
It is a little hit and miss, but that is the breaks.

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



[PHP] Re: Run Apache/PHP/MySQL from CD?

2006-04-19 Thread zerof

Jay Paulson escreveu:

I have no idea if this is possible or not but is there a way to run Apache,
PHP, and MySQL from a CD?  I'd like it to be possible to run it on Windows,
Mac OSX and *nix.  If it is possible could someone point me in the right
direction?

Thanks!

-
Please see:
http://www.dwebpro.com/

zerof

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Wolf
How's it working for you?  I'm still waiting on the top 10 to finish the
questionnaire...

Jay Blanchard wrote:
> [snip]
> I'm looking for a ready made php script that can open phpBB 2.0.20
> accounts
> By sending username, email and password.
> {/snip]
> 
> I am looking for a good hearted woman who likes to dance. I used Google.
> 

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
Stut... how many of those have asked for your credit card number?

-TG

= = = Original message = = =

Jay Blanchard wrote:
> [snip]
> I'm looking for a ready made php script that can open phpBB 2.0.20
> accounts
> By sending username, email and password.
> /snip]
> 
> I am looking for a good hearted woman who likes to dance. I used Google.

How's that working out for ya? I'm on date 3 of the 3,130,000 results.

-Stut

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



___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] PHP CLI not present [SOLVED]

2006-04-19 Thread Jeff
> -Original Message-
> From: Jeff [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, April 19, 2006 16:02
> To: php-general@lists.php.net
> Subject: [PHP] PHP CLI not present
> 
> 
> Hey all,
> 
> I'm running PHP Ver 4.4.1 on a redhat ES3 system.  It appears 
> that the CLI is not running or not present.  I thought it was 
> installed by default in versions >= 4.3.x.  
> 
> If I run /usr/local/bin/php -v at the command line I get nothing.
> 
> How do I get the PHP CLI working?
> 
> Thanks,
> 
> Jeff

Nevermind.  Found it!

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



[PHP] PHP CLI not present

2006-04-19 Thread Jeff
Hey all,

I'm running PHP Ver 4.4.1 on a redhat ES3 system.  It appears that the
CLI is not running or not present.  I thought it was installed by
default in versions >= 4.3.x.  

If I run /usr/local/bin/php -v at the command line I get nothing.

How do I get the PHP CLI working?

Thanks,

Jeff

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Stut

Jay Blanchard wrote:

[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20
accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.


How's that working out for ya? I'm on date 3 of the 3,130,000 results.

-Stut

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



Re: [PHP] Pushing Vars into $_SESSION

2006-04-19 Thread Richard Lynch
On Wed, April 19, 2006 1:36 am, Chris Grigor wrote:
> Richard Lynch wrote:
>
>>On Tue, April 18, 2006 10:05 am, Chris Grigor wrote:
>>>Was wondering if there is an easier way to get returned variables
>>> into
>>>the $_SESSION rather than going through each one??

>>foreach($line as $key => $value) $_SESSION[$key] = $value;

>>  Why do this?
>>  Is it really going to help you to have the data stored in TWO
>> places?
>>I predict that if you really think about what you are doing, you
>> won't
>>want to do this.  There are simply too many pitfalls for this to be a

> The point of me doing this is that I will be pulling menu flags from a
> database on a user level.

> in the db I will have menu items 1 to 20 turned on or off. When a user
> logs in these flags are pulled
> and depending if they are truned on or off, the menu will display.
> Catch my drift??

Tell us the part about where having them copied into $_SESSION makes
your software better... :-)

Database -> Menu is a very simple and common web design.

Database -> $_SESSION -> Menu only adds an extra step, AFAICT.

Are you able to completely avoid connecting to the database on many
subsequent pages this way?  That could be Good Code.

Or are you just avoiding a single simple query that, with indexed
fields, should run in a splintered second?  That's probably Bad Code.

$_SESSION data is not free.

It's not even cheaper than MySQL data, as a general rule -- though it
might be in specific cases.

Simplify, grasshopper.
:-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
For the purpose of creating phpBB accounts?  As in, automated creation of mass 
amounts of phpBB accounts maybe for the purpose of spamming phpBB's?

Just curious. Please clarify the need to automate creation of phpBB accounts if 
that's what you're asking for.

-TG

= = = Original message = = =

I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.

NE!?

Thanks

berber


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Jay Blanchard
[snip]
I'm looking for a ready made php script that can open phpBB 2.0.20
accounts
By sending username, email and password.
{/snip]

I am looking for a good hearted woman who likes to dance. I used Google.

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



[PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread Weber Sites LTD
I'm looking for a ready made php script that can open phpBB 2.0.20 accounts
By sending username, email and password.

NE!?

Thanks

berber

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



Re: [PHP] RE: Run Apache/PHP/MySQL from CD?

2006-04-19 Thread Satyam
Not sure if this is what you were asking.  You will find a list of several 
such systems in Wikipedia.


http://en.wikipedia.org/wiki/LiveCD

Notice that you will need one CD per hardware architecture, not per OS of 
the base machine, since the CD boots its own OS, some *nix.


Satyam

- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Jay Paulson" <[EMAIL PROTECTED]>; ; 


Sent: Wednesday, April 19, 2006 8:53 PM
Subject: [PHP] RE: Run Apache/PHP/MySQL from CD?


[snip]
I have no idea if this is possible or not but is there a way to run
Apache,
PHP, and MySQL from a CD?  I'd like it to be possible to run it on
Windows,
Mac OSX and *nix.  If it is possible could someone point me in the right
direction?
[/snip]

You'd have to have CD's for each OS on which you'd like to run. You can
test this by putting the Apache executable (or one of the other
executables) on a CD and trying to run it.

http://www.google.com/search?hl=en&q=run+apache+from+CD

--
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] RE: Run Apache/PHP/MySQL from CD?

2006-04-19 Thread Jay Blanchard
[snip]
I have no idea if this is possible or not but is there a way to run
Apache,
PHP, and MySQL from a CD?  I'd like it to be possible to run it on
Windows,
Mac OSX and *nix.  If it is possible could someone point me in the right
direction?
[/snip]

Yippee, cross-posting!

http://www.google.com/search?hl=en&lr=&q=run+MySQL+from+CD

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



[PHP] RE: Run Apache/PHP/MySQL from CD?

2006-04-19 Thread Jay Blanchard
[snip]
I have no idea if this is possible or not but is there a way to run
Apache,
PHP, and MySQL from a CD?  I'd like it to be possible to run it on
Windows,
Mac OSX and *nix.  If it is possible could someone point me in the right
direction?
[/snip]

You'd have to have CD's for each OS on which you'd like to run. You can
test this by putting the Apache executable (or one of the other
executables) on a CD and trying to run it.

http://www.google.com/search?hl=en&q=run+apache+from+CD

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



RE: [PHP] PHP Script not sending email in WinME and PWS

2006-04-19 Thread Jay Blanchard
[snip]
...way too much crud...
[/snip]

A. I could never find a question.
2. That is way too much stuff to post through a mailing list. No one
will go through it.

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



[PHP] Run Apache/PHP/MySQL from CD?

2006-04-19 Thread Jay Paulson
I have no idea if this is possible or not but is there a way to run Apache,
PHP, and MySQL from a CD?  I'd like it to be possible to run it on Windows,
Mac OSX and *nix.  If it is possible could someone point me in the right
direction?

Thanks!

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



[PHP] Newbie, PHP Script not sending email in WinME and PWS

2006-04-19 Thread verci
Hi

I've installed PHP version 5 in my machine running WinME, Personal Web
Server and Internet explorer
6.0.2800.1106, 128 Bit, to have my site on the net,  the script  I use
(below)  in  my web page named feedbak.php
http://www.iodatamicro.homeip.net/Contact.html"; ;
$errorurl = "http://www.iodatamicro.homeip.net/Error.html"; ;
$thankyouurl = "http://www.iodatamicro.homeip.net/Thanks.html"; ;
$uself = 0;
//  END OF CONFIGURABLE SECTION ---
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
 header( "Location: $formurl" );
 exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
   header( "Location: $errorurl" );
   exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
 header( "Location: $errorurl" );
 exit ;
}
if (get_magic_quotes_gpc()) {
 $comments = stripslashes( $comments );
}
$messageproper =
 "This message was sent from:\n" .
 "$http_referrer\n" .
 "\n" .
 "Name of sender: $name\n" .
 "Email of sender: $email\n" .
 "- COMMENTS -\n\n" .
 $comments .
 "\n\n\n" ;
mail($mailto, $subject, $messageproper,
 "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" .
$headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>

My contact.html page:

  

  http://www.iodatamicro.homeip.net/scripts/feedback.php";
method="post">
  
  Nombre:
  Dirección Email:
  
  
  Comentarios
  
  
  
  
  
  
  
  
  
  
   

   
  


It all seems fine, the script loads and after the supposed mail is sent the
thanks.html page loads OK, but no mail appears in the mailbox of the
specified address, here is the php.ini file (look below) I use,  it all
seems right but no email, If I use outlook with the smtp server
smtp.prodigy.net.mx   all outbound and pop.prodigy.net.mx  for inbound mail
everything just works fine can anyone help me is there a way to view the
port the smtp server is using in WinME, it's supposed to be 25 but how can I
be
sure???


; Language Options ;


; Enable the PHP scripting language engine under Apache.
engine=On

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode=Off

; Allow the  tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag=On

; Allow ASP-style <% %> tags.
asp_tags=Off

; The number of significant digits displayed in floating point numbers.
precision=12

; Enforce year 2000 compliance (will cause problems with non-compliant
browsers)
y2k_compliance=On

; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all files
by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On',
as
; a value for this directive (e.g., output_buffering=4096).
output_buffering=Off

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
;   directive. Instead, explicitly set the output handler using
ob_start().
;   Using this ini directive may cause problems unless you know what
script
;   is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
;   and you cannot use both "ob_gzhandler" and
"zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' 
;   Instead you must use zlib.output_handler.
;output_handler=

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;   outputs chunks that are few hundreds bytes each as a result of
;   compression. If you prefer a larger chunk size for better
;   performance, enable o

[PHP] PHP Script not sending email in WinME and PWS

2006-04-19 Thread verci

Hi

I've installed PHP version 5 in my machine running WinME, Personal Weband 
Internet explorer
6.0.2800.1106, 128 Bit,to have my personal site on the net , the script I 
use  in  my web page feedbak.php

http://www.iodatamicro.homeip.net/Contact.html"; ;
$errorurl = "http://www.iodatamicro.homeip.net/Error.html"; ;
$thankyouurl = "http://www.iodatamicro.homeip.net/Thanks.html"; ;
$uself = 0;
//  END OF CONFIGURABLE SECTION ---
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
  header( "Location: $errorurl" );
  exit ;
}
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"- COMMENTS -\n\n" .
$comments .
"\n\n\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" .
$headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>
It all seems fine, the script loads and after the supposed mail is sent the
thanks.html page loads OK, but no mail appears in the mailbox of the
specified address, here is the php.ini file (look below) I use,  it all
seems right but no email, If I use outlook with the smtp server
smtp.prodigy.net.mx   all outbound and pop.prodigy.net.mx  for inbound mail
everything just works fine can anyone help me is there a way to view 
the

port the smtp server is using it's supposed to be 25 but how can I be
sure???


; Language Options ;


; Enable the PHP scripting language engine under Apache.
engine=On

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode=Off

; Allow the  tags are 
recognized.

; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag=On

; Allow ASP-style <% %> tags.
asp_tags=Off

; The number of significant digits displayed in floating point numbers.
precision=12

; Enforce year 2000 compliance (will cause problems with non-compliant
browsers)
y2k_compliance=On

; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the 
output

; buffering functions.  You can also enable output buffering for all files
by
; setting this directive to On.  If you wish to limit the size of the 
buffer
; to a certain size - you can use a maximum number of bytes instead of 
'On',

as
; a value for this directive (e.g., output_buffering=4096).
output_buffering=Off

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
;   directive. Instead, explicitly set the output handler using
ob_start().
;   Using this ini directive may cause problems unless you know what
script
;   is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
;   and you cannot use both "ob_gzhandler" and
"zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' 
;   Instead you must use zlib.output_handler.
;output_handler=

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;   outputs chunks that are few hundreds bytes each as a result of
;   compression. If you prefer a larger chunk size for better
;   performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
;   output_handler, or otherwise the output will be corrupted.
zlib.output_compression=Off

; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the

[PHP] Re: possible bug in date()

2006-04-19 Thread Mark Slater
It appears this is a known bug that is/will be fixed in PHP 5.1.3. The current date code for 
DATE_W3C and DATE_ATOM (in 5.1.2) is "Y-m-d\TH:i:sO". According to 
http://us3.php.net/manual/en/function.date.php , the other option for the last character is "P" 
which prints the difference from Greenwich mean time with a colon (as the examples for DATE_W3C and 
DATE_ATOM suggest).


As a workaround, I've found that the string "c" produces the output I was expeciting to get from 
DATE_W3C and DATE_ATOM.


This code:
$this->dateCreated = date( "c", ATOM, mktime( 0, 0, 0, 23, 2, 2006 ) );

Outputs this:
2006-02-23T00:00:00-08:00

Mark

Mark Slater wrote:
I'm trying to create a date with the DATE_W3C or DATE_ATOM format (they 
are the same format according to the examples), but the output of date 
doesn't match the example in the documentation.


The http://us3.php.net/manual/en/ref.datetime.php page says the formats 
are as follows:


DATE_ATOM (string)
Atom (example: 2005-08-15T15:52:01+00:00)

DATE_W3C (string)
World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)

DATE_ISO8601 (string)
ISO-8601 (example: 2005-08-15T15:52:01+)


If I create a date with this code:

$this->dateCreated = date( DATE_ATOM, mktime( 0, 0, 0, 23, 2, 2006 ) );
echo $this->dateCreated;

I expect to see:

2006-02-23T00:00:00-08:00

The output I actually get is the ISO-8601 format:

2006-02-23T00:00:00-0800

The only difference is the colon in the GMT offset at the end.

Is the example output in the web page wrong? Or is this a bug in PHP?

Thanks,

Mark


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



Re: [PHP] no offense to Rasmus... are you kidding me

2006-04-19 Thread Jochem Maas

Robert Cummings wrote:

On Wed, 2006-04-19 at 09:34, Jochem Maas wrote:


I just had to post this as a new thread to give it the audience I think
it deserves.

Matt Todd wrote:


No offense to Rasmus, but I don't think he's necessarily the one to
feel comfortable aligning your opinions with: he's definitely
motivated by his language, which, as I've pointed out, is stuck in
what I called the 'Web 1.0 way'. (Not really meant to deride him or
that way, just that I see that things are going to be changing towards
this 2.0 way and I think  we need to be aware.)



I can't find an original copy of this post anywhere... did you post a
private response to the public list?


if I did it was by accident. apologies for that mistake (the post ended up
in 'php' folder so I assumed it was onlist)

that said I didn't ask for a personal reply.



Cheers,
Rob.


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



Re: [PHP] programming contests as a way of finding/evaluating offshore talent...

2006-04-19 Thread Martin Alterisio \"El Hombre Gris\"

This is just my personal opinion on the subject.

I don't believe nowadays programming contests are of any worth when 
judging a developer's talent, at least not what I expect from a coder. 
These contests usually prove that an a coder can pull out an development 
as an individual, but from looking at the code, and the way they code, I 
realize that they aren't fit for an enviroment where working as a team 
is a must, at least that's the kind of coding I don't want to see in a 
project where I could be working.


I haven't seen yet a contest where code which is written in a readable 
and understandable way earns more points. If a coder does his job faster 
than others but he's the only one who can understand the code, we'll 
have a problem when the client requires a new feature and he's not 
longer on our team. I would choose the one who takes his time but thinks 
carefully ahead and takes into account who will be using the code he's 
writting. If he is also good with documentation I'll even handcuff him 
to his desk and do anything to keep him in the team.


bruce wrote:


hi..

i'm looking for opinions on the "worth" of programming contests as a way of
judging the talent of potential software developers...

any thoughts/pros/cons would be appreciated..

and yeah.. i know this is a little off topic.. but some of us here deal with
these issues.. if you know of a better email list for this kind of question,
let me know, and i'll move it to there..

thanks in advance!

-bruce

 



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



[PHP] Re: programming contests as a way of finding/evaluating offshore talent...

2006-04-19 Thread Barry

bruce wrote:

hi..

i'm looking for opinions on the "worth" of programming contests as a way of
judging the talent of potential software developers...

any thoughts/pros/cons would be appreciated..

and yeah.. i know this is a little off topic.. but some of us here deal with
these issues.. if you know of a better email list for this kind of question,
let me know, and i'll move it to there..

thanks in advance!

-bruce
A good programmer is somone who can (mostly) easily find answers to 
given problems.
You can then start looking on how somone programmed, how good it was 
tested, how good it's commented and documentated.


If a contest is in that way, i think it really has a worth.
But the most problems are that the contests are too specific.

For example. If a Bank would start something like that, you surely 
should have a knowledge on how bills and such are done and so on.



--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Richard Davey

On 19 Apr 2006, at 15:42, Matt Todd wrote:


there will be (emphasis on the
eventuality, not on the present actuality) a time that PHP will become
the old stuff because it did not evolve with the philosophies.


Philosophies are just that.. a philosophy. They are not standards.  
They are also two-a-penny. If PHP were to jump onboard and natively  
and dramatically support all philosophies that came along, we'd have  
one hell of a mess on our hands. Over time the good philosophies  
remain, and the weak ones die away. The really good ones get turned  
into standards that are then safe to adopt in a far broader sense.


Agile Development (and the broader term Web 2.0) is, right now, the  
bleeding

edge of development, and I and many others see it as the future of
development philosophies.


I've yet to see anything Web 2.0 related that PHP cannot do now,  
today. Agile Development is a different kettle of fish, and a highly  
debatable one as to its merits. No-one here doubts the merits of Web  
2.0 (if there is any such thing), we all know that if such  
methodologies wish to be used, they can be - right now. Which is why  
it's really not a 'big issue' to most people here.



I'm not saying that Rasmus can't see, but that he will easily choose
to stay with how he sees the forest – understandable as I choose to


Rasmus !== PHP

A strong influence? Yes. The original architect? Yes. But he himself  
isn't PHP, he doesn't drive every single element of its development  
and direction (he isn't that selfish!), so to single him out on a  
personal level as being in control of where PHP does (or doesn't) go  
is a bit nuts, imho.



Honestly, I'd love to see basic variables be objects, as models of
real world data with properties for the data such as a $number->length
or $word->as_array() giving you letters.


Sadly not everything maps to 'real world' data. How do you represent  
something that is intangible in the real world? Your 'basic variables  
as objects' idea is curious, I would need to see more (useful)  
examples before passing comment.


Cheers,

Rich
--
http://www.corephp.co.uk
Zend Certified Engineer
PHP Development Services

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



[PHP] Re: programming contests as a way of finding/evaluating offshoretalent...

2006-04-19 Thread Dan Baker
"bruce" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> i'm looking for opinions on the "worth" of programming contests as a way 
> of
> judging the talent of potential software developers...
>
> any thoughts/pros/cons would be appreciated..

My first thought is: "Won't be a good criteria for determining the worth of 
a programmer."
Most contests are skewed into some obscure corner of programming, and 
typically don't require good programming skills.  Usually, they are for fun 
and require you to pull strange facts out of the recesses of your brain.

DanB

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



[PHP] programming contests as a way of finding/evaluating offshore talent...

2006-04-19 Thread bruce
hi..

i'm looking for opinions on the "worth" of programming contests as a way of
judging the talent of potential software developers...

any thoughts/pros/cons would be appreciated..

and yeah.. i know this is a little off topic.. but some of us here deal with
these issues.. if you know of a better email list for this kind of question,
let me know, and i'll move it to there..

thanks in advance!

-bruce

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Matt Todd
There's nothing wrong with staying true to the philosophy at all, I
just think that it may well be detrimental in the end. And that is
what I said in the (toilet)paper, that there will be (emphasis on the
eventuality, not on the present actuality) a time that PHP will become
the old stuff because it did not evolve with the philosophies.

These philosophies are new and I can understand thinking that it's
hype, but it's important to recognize it as legitimate. Agile
Development (and the broader term Web 2.0) is, right now, the bleeding
edge of development, and I and many others see it as the future of
development philosophies.

I'm not saying that Rasmus can't see, but that he will easily choose
to stay with how he sees the forest – understandable as I choose to
stay with what I see, but I think he has a lot invested in his view
and may not open up as easily.

To Stut:

Honestly, I'd love to see basic variables be objects, as models of
real world data with properties for the data such as a $number->length
or $word->as_array() giving you letters.

I know that PHP is a functional language, and secondly, an OO
language, but I think that you can blend these things better and have
the OO brought to the forefront a bit more. Yes, I'm a fan of OO, but
I know that many people aren't and don't use PHP's OO (and don't when
it's appropriate). But I know you can integrate OO without having to
force the functional programmers to give up their way.

This is just ONE thing that could make PHP better and allow for more
modern philosophical development. Particularly, I would like to see
more creativity. Sure, PHP's moving fast, but with our big things
being Unicode support and removing globals and safe mode, I think that
we could be a little more innovative for PHP6.

Again, it's not behind the times right now, but the times are changing
and I'd like to see PHP change with them.

M.T.

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



Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-19 Thread Bing Du
> Do the search as Richard suggested.
>
> MS Access might have a similar function you can use, but you'll need
> to do some searching yourself to find the answer.
>
Sure.  I always appreciate various opinions.  I've checked with an Access
expert.  It can be done for Access like Format([DateFieldName], " 
").  But if fields of date type should be formated as needed in the
query, there is one situation in which I'm not clear how that would work. 
Say, I need to query all the fields from a table which has quite a fields.
 Some of the fields are of some kind of date type.  Enumerating the fields
is not feasible.

SELECT * from table;

So in this case, how should the date fields be formated in the query?

Thanks,

Bing

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Barry

Stut wrote:

Matt Todd wrote:


But of course, that is just conjecture. I'm just saying that I think
he has vested interest and will be least of all willing to make the
shift in thought (even if he did think it held some merit).
 



I didn't read that article too closely, but I would appreciate *brief* 
answers to these questions...


In what way does PHP not allow development in the style that has 
unfortunately become known as Web 2.0? Why does it need to change? If 
you were "in charge" of PHP development what would you be doing to make 
it "better"?


As a PHP developer with too many years experience to mention I am 
curious about specifically why you are of the opinion that it's behind 
the times.


-Stut

Right, That's why ppl use PHP more than Perl/CGI for example.
It's because PHP is easier to understand and to code (for most ppl).
And when something else comes that is more useful than PHP and will come 
in more handy than it than PHP will take his place in order.

That's how stuff goes.
I don't think it's that important to debate it that much.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] no offense to Rasmus... are you kidding me

2006-04-19 Thread Robert Cummings
On Wed, 2006-04-19 at 09:34, Jochem Maas wrote:
> I just had to post this as a new thread to give it the audience I think
> it deserves.
>
> Matt Todd wrote:
> > 
> > No offense to Rasmus, but I don't think he's necessarily the one to
> > feel comfortable aligning your opinions with: he's definitely
> > motivated by his language, which, as I've pointed out, is stuck in
> > what I called the 'Web 1.0 way'. (Not really meant to deride him or
> > that way, just that I see that things are going to be changing towards
> > this 2.0 way and I think  we need to be aware.)

I can't find an original copy of this post anywhere... did you post a
private response to the public list?

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Stut

Matt Todd wrote:


But of course, that is just conjecture. I'm just saying that I think
he has vested interest and will be least of all willing to make the
shift in thought (even if he did think it held some merit).
 



I didn't read that article too closely, but I would appreciate *brief* 
answers to these questions...


In what way does PHP not allow development in the style that has 
unfortunately become known as Web 2.0? Why does it need to change? If 
you were "in charge" of PHP development what would you be doing to make 
it "better"?


As a PHP developer with too many years experience to mention I am 
curious about specifically why you are of the opinion that it's behind 
the times.


-Stut

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Jochem Maas

Jay Blanchard wrote:

[snip]
Yes, I absolutely agree that Rasmus is awesome and his accomplishments
are far and beyond amazing, but I'm saying that I think that Rasmus is
motivated to stay true to PHP's philosophies and not be willing to
rethink them: that is what I meant by that.
[/snip]

What, exactly, is wrong with staying true to the philosophy? If you
created a language based on a certain philosophy wouldn't you want to
stay true to them? 


with regard to the ever changing world of internet this is the quote from
the top of Rasmus' resume:

"The web is changing. It is more dynamic and more programmable than ever before.
This new programmable web needs tools and systems that can talk to each other in
a way that is both useful and approachable. The learning curve has to be shallow
and the results immediate. This is what I do."

'nuff said, right Jay?





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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Ryan A
umm guys, can you take this offlist please (if you
wish to continue this) as I dont really see how this
can benifit anyone.

Cheers,
Ryan

--- Matt Todd <[EMAIL PROTECTED]> wrote:

> Yes, I absolutely agree that Rasmus is awesome and
> his accomplishments
> are far and beyond amazing, but I'm saying that I
> think that Rasmus is
> motivated to stay true to PHP's philosophies and not
> be willing to
> rethink them: that is what I meant by that.
> 
> In no way am I saying that Rasmus doesn't DESERVE to
> align your
> theories with or your ideas with, but I think that
> he may be too
> vested in PHP and what he has been doing to realign
> himself.
> 
> But of course, that is just conjecture. I'm just
> saying that I think
> he has vested interest and will be least of all
> willing to make the
> shift in thought (even if he did think it held some
> merit).
> 
> Again, I in no way meant any offense to Rasmus, and
> I stand by that.
> 
> M.T.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Wolf
Kid (and I mean that loosely), you should have stopped while you were
ahead of the tide and let it die...

Instead you had to open up and add more drivel that:
1. shows how little you think about those who have come before you and
their ability to shift as technology changes

2. further shoved your feet in your own throat

Build an application and not just "Hello World" but a true application
and then see how welcome you are to embrace technology methods that make
the application more powerful and gives your skills a greater flexibility.

Only after doing that, will you (HOPEFULLY) grasp that not only have you
looked through a window into a tunnel with your defense of your Web2.0
(toilet)Paper, but in continuing down the path of "he can't see the
forest for the trees" further alienated yourself.

Wolf

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



RE: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Jay Blanchard
[snip]
Yes, I absolutely agree that Rasmus is awesome and his accomplishments
are far and beyond amazing, but I'm saying that I think that Rasmus is
motivated to stay true to PHP's philosophies and not be willing to
rethink them: that is what I meant by that.
[/snip]

What, exactly, is wrong with staying true to the philosophy? If you
created a language based on a certain philosophy wouldn't you want to
stay true to them? 

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



Re: [PHP] Session_destroy

2006-04-19 Thread chris smith
On 4/19/06, Shannon Doyle <[EMAIL PROTECTED]> wrote:
> Hi People,
>
> Trying to get a session to destroy correctly, however the darn thing just
> refuses to destroy. I call the following in a separate webpage in a effort
> to destroy the session, only to find that the session still persists.
>
>  session_start();
> session_unset();
> session_destroy();
> Header("Location: index.php");
> ?>

What's in index.php?

Try giving the session a name (see http://www.php.net/session_name)
and see what happens.

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

2006-04-19 Thread Paul Waring
On 19/04/06, Shannon Doyle <[EMAIL PROTECTED]> wrote:
> Trying to get a session to destroy correctly, however the darn thing just
> refuses to destroy. I call the following in a separate webpage in a effort
> to destroy the session, only to find that the session still persists.
>
>  session_start();
> session_unset();
> session_destroy();
> Header("Location: index.php");
> ?>

First of all, if you're using $_SESSION or $HTTP_SESSION_VARS, the PHP
manual will tell you to use unset($_SESSION['key']) rather than
session_unset(). Personally though, I've found the following code
works well for completely destroying a session:



Also, when using redirects, you should specify the complete absolute
URL, not a relative one. You can sometimes get away with using a
relative one but it's bad practice and breaks section 14.30 of RFC
2616 (the HTTP/1.1 specification).

Paul

--
Data Circle
http://datacircle.org

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



Re: [PHP] session_destroy

2006-04-19 Thread Martin Alterisio \"El Hombre Gris\"
It doesn't matter, PHP decides automatically which is the best method to 
make a session persist. If it founds that the client allows cookies, 
cookies are used. If such method is not available, the session id is 
writen to every url through an output buffer with an url rewriting 
filter. There was another method before using the url rewriting but I 
forgot, check the manual.


Shannon Doyle wrote:


That's just it,

I am not setting a session cookie.

Just starting a session with the following :-


session_name("XPCSESS");
session_start();
$sessID = session_id();



-Original Message-
From: Martin Alterisio "El Hombre Gris" [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 19 April 2006 12:36 PM

To: Peter Hoskin
Cc: Shannon Doyle; php-general@lists.php.net
Subject: Re: [PHP] session_destroy

That's exactly what the manual says.
session_destroy() doesñ't clean the session cookie (if one is used), 
that's probably why your session persists.


Peter Hoskin wrote:

 

I've also had this issue from time to time. Used the following to 
destroy it under all circumstances.


  if (isset($_COOKIE[session_name()])) {
  setcookie(session_name(), '', time()-42000, '/');
  }
  session_destroy();

Shannon Doyle wrote:

   


Hi People,

Trying to get a session to destroy correctly, however the darn thing 
just
refuses to destroy. I call the following in a separate webpage in a 
effort

to destroy the session, only to find that the session still persists.




Any help would be appreciated.

Cheers,

Shannon

 
 

   



 



[PHP] Re: no offense to Rasmus... are you kidding me

2006-04-19 Thread Matt Todd
Yes, I absolutely agree that Rasmus is awesome and his accomplishments
are far and beyond amazing, but I'm saying that I think that Rasmus is
motivated to stay true to PHP's philosophies and not be willing to
rethink them: that is what I meant by that.

In no way am I saying that Rasmus doesn't DESERVE to align your
theories with or your ideas with, but I think that he may be too
vested in PHP and what he has been doing to realign himself.

But of course, that is just conjecture. I'm just saying that I think
he has vested interest and will be least of all willing to make the
shift in thought (even if he did think it held some merit).

Again, I in no way meant any offense to Rasmus, and I stand by that.

M.T.

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



[PHP] no offense to Rasmus... are you kidding me

2006-04-19 Thread Jochem Maas

I just had to post this as a new thread to give it the audience I think
it deserves.

Matt Todd wrote:


No offense to Rasmus, but I don't think he's necessarily the one to
feel comfortable aligning your opinions with: he's definitely
motivated by his language, which, as I've pointed out, is stuck in
what I called the 'Web 1.0 way'. (Not really meant to deride him or
that way, just that I see that things are going to be changing towards
this 2.0 way and I think  we need to be aware.)


I feel very comfortable with aligning my opinions with Rasmus (my only hope
he doesn't take offense - me being a bottom-feeder on the foodchain around here)

there are good reasons:

1. he is a good programmer with tons of experience in the web field.
2. he started php.
3. he has worked on the Apache core.
4. he is an Infrastructure Architecture at Yahoo! (his system is bigger, badder 
and
more Ajaxy than yours)
5. he gives us real working tutorials on creating 'Web2.0' stuff (as in 
rich-clientside
browser based technologies) using php (you know _that_ language not ready for 
the next
level of usabilty/functionality of the web)
6. he is a poster child for easy-of-use, pragmatic web solutions.
7. he is modest enough not to call it 'his' language even though other might do 
so
(there are *plenty* of other great hackers who have made php what it is today)
8. you need more???

I doubt very much his motivation is the language so much as his motivation
is building cool techologies. if he was that petty then I doubt very much he or 
the
language he inadvertly created would have been so successful.

the greeks had Zeus, 'we' have Rasmus. you had better be Agile[tm] because
if you thought the last load of vitrole was bad wait until the shitstorm from
the comment quotesd above arrives in your inbox.

with regard to php being stuck - on the contrary it's moving so fast it's
getting hard to keep up with some of the changes - that IT for though, no rest 
for
the wicked.

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



Re: [PHP] PHP with Oracle

2006-04-19 Thread tedd

Brad:

Yes, I'm having problems as well (as well as top posting).

Bu,t there are other sources, such as:

http://www.weberdev.com/oci_connect

tedd


At 9:13 AM -0400 4/19/06, Brad Bonkoski wrote:
Assuming the PHP web page is available, anyone else having problems 
connecting to php.net?

-B

Jay Blanchard wrote:


[snip]
is there a ready script that handle entering user name and password for
authentication by extracting the Data from Oracle10g DB without showing
the
URL in the address bar...I am thinking of using a popup window
Spec.
[/snip]

Please RTFM at http://www.php.net/oracle and have a look at oci_connect




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



--

http://sperling.com

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



Re: [PHP] PHP with Oracle

2006-04-19 Thread pons
http://us2.php.net/ http://us3.php.net/

using mirror


On 4/19/06, Thomas Munz <[EMAIL PROTECTED]> wrote:
>
> Only the main US Server.
>
> Try: http://us2.php.net/
> on Wednesday 19 April 2006 15:13, Brad Bonkoski wrote:
> > Assuming the PHP web page is available, anyone else having problems
> > connecting to php.net?
> > -B
> >
> > Jay Blanchard wrote:
> > >[snip]
> > >is there a ready script that handle entering user name and password for
> > >authentication by extracting the Data from Oracle10g DB without showing
> > >the
> > >URL in the address bar...I am thinking of using a popup window
> > >Spec.
> > >[/snip]
> > >
> > >Please RTFM at http://www.php.net/oracle and have a look at oci_connect
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
PONS
Communications/Network  and Systems Engineer


Re: [PHP] New image already cached.

2006-04-19 Thread tedd

You're also better off embedding the parameters in the URL so that it
"looks like" a directory to the browser:

http://example.com/actual_script/57823642346963/copyright/whatever.png

The PHP scritp is actual_script.

You can use .htaccess and ForceType to make Apache run it.

$_SERVER['PATH_INFO'] will have all the parameters you need.

The embedded parameters pretty much give the browser NO opportunity to
screw up.




Richard:

Far out ! -- I never saw .htaccess and ForceType used before. But it 
works slick in dropping the extension of "program.php" to "program". 
(Now if I can only get my editor to still treat the document as php, 
but that's a different matter).


However, I don't see how I can generate a random number for a url 
each time an image is needed and have .htaccess and ForceType make 
Apache run it -- do I rewrite. htaccess each time, or what?


Also, $_SERVER['PATH_INFO'] (or in my case 
$_SERVER['PATH_TRANSLATED'] ) gives me the path -- so how does that 
fit in?


Please explain.

Thanks.

tedd

--

http://sperling.com

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



RE: [PHP] PHP with Oracle

2006-04-19 Thread Jay Blanchard
[snip]
php.net  is DOWN!!! or what
[/snip]

Use your resources. There are mirrors if the main is down, also here is 
Oracle's PHP Dev Center;

http://www.oracle.com/technology/tech/php/index.html

http://us3.php.net/oci8

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



Re: [PHP] PHP with Oracle

2006-04-19 Thread Thomas Munz
Only the main US Server.

Try: http://us2.php.net/
on Wednesday 19 April 2006 15:13, Brad Bonkoski wrote:
> Assuming the PHP web page is available, anyone else having problems
> connecting to php.net?
> -B
>
> Jay Blanchard wrote:
> >[snip]
> >is there a ready script that handle entering user name and password for
> >authentication by extracting the Data from Oracle10g DB without showing
> >the
> >URL in the address bar...I am thinking of using a popup window
> >Spec.
> >[/snip]
> >
> >Please RTFM at http://www.php.net/oracle and have a look at oci_connect

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



Re: [PHP] PHP with Oracle

2006-04-19 Thread pons
php.net  is DOWN!!! or what

On 4/19/06, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
>
> Assuming the PHP web page is available, anyone else having problems
> connecting to php.net?
> -B
>
> Jay Blanchard wrote:
>
> >[snip]
> >is there a ready script that handle entering user name and password for
> >authentication by extracting the Data from Oracle10g DB without showing
> >the
> >URL in the address bar...I am thinking of using a popup window
> >Spec.
> >[/snip]
> >
> >Please RTFM at http://www.php.net/oracle and have a look at oci_connect
> >
> >
> >
>
>


--
PONS
Communications/Network  and Systems Engineer


Re: [PHP] PHP with Oracle

2006-04-19 Thread Brad Bonkoski
Assuming the PHP web page is available, anyone else having problems 
connecting to php.net?

-B

Jay Blanchard wrote:


[snip]
is there a ready script that handle entering user name and password for
authentication by extracting the Data from Oracle10g DB without showing
the
URL in the address bar...I am thinking of using a popup window
Spec.
[/snip]

Please RTFM at http://www.php.net/oracle and have a look at oci_connect

 



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



RE: [PHP] PHP with Oracle

2006-04-19 Thread Jay Blanchard
[snip]
is there a ready script that handle entering user name and password for
authentication by extracting the Data from Oracle10g DB without showing
the
URL in the address bar...I am thinking of using a popup window
Spec.
[/snip]

Please RTFM at http://www.php.net/oracle and have a look at oci_connect

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



[PHP] PHP with Oracle

2006-04-19 Thread pons
is there a ready script that handle entering user name and password for
authentication by extracting the Data from Oracle10g DB without showing the
URL in the address bar...I am thinking of using a popup window
Spec.

The server is Linux king 2.6.5-7.191-bigsmp #1 SMP Tue Jun 28 14:58:56 UTC
2005 i686 i686 i386 GNU/Linux

PHP 4.3.4 (cli) (built: Jul  1 2004 16:44:46)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

DB
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

--
PONS
Communications/Network  and Systems Engineer


RE: [PHP] session_destroy

2006-04-19 Thread tedd

At 12:51 PM +0930 4/19/06, Shannon Doyle wrote:

That’s just it,

I am not setting a session cookie.

Just starting a session with the following :-

session_name("XPCSESS");
session_start();
$sessID = session_id();


Try:

http://sperling.com

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



Re: [PHP] Help using a function within a function, both within a class

2006-04-19 Thread Adele Botes

chris smith wrote:


On 4/19/06, Adele Botes <[EMAIL PROTECTED]> wrote:
 


To anyone who can help, I would like to know why or how I can execute a
function within a function used within this class. I want to redirect if
the results of a insert query was successful, so i made a simple redirect
function for later use, once I've build onto the class. The problem is that
i am not sure why or how to get the redirect($url) to work within
insert_data($table,$values,$where)

Even if I call the function: print redirect($url); and add the $url
argument
to insert_data it still doesn't work. I get undefined function error. What
am I doing wrong?

http://www.example.com'); and $db_connection

class DATA {
   // variables
   var $table;
   var $fields;
   var $where;
   var $url;

   // Constructor must be the same name as the class

   // Functions
   function insert_data($table,$values,$where) {
   global $redirect;
   



You don't use globals inside a class to reference other data inside
the same class.

Instead you need to do something like this:

$add_location->url = 'blah';

then inside the class:

if ($result) {
  # redirect here
  print $this->redirect($this->url);
...

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


 


Chris

Thanx allot for your help. I works gr8.

Adele
--

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



Re: [PHP] session_destroy

2006-04-19 Thread Peter Hoskin

Should not make any difference. Try it instead of posting.

Regards,
Peter Hoskin

Shannon Doyle wrote:

That’s just it,

I am not setting a session cookie.

Just starting a session with the following :-


session_name("XPCSESS");
session_start();
$sessID = session_id();


  


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



Re: [PHP] Help using a function within a function, both within a class

2006-04-19 Thread chris smith
On 4/19/06, Adele Botes <[EMAIL PROTECTED]> wrote:
> To anyone who can help, I would like to know why or how I can execute a
> function within a function used within this class. I want to redirect if
> the results of a insert query was successful, so i made a simple redirect
> function for later use, once I've build onto the class. The problem is that
> i am not sure why or how to get the redirect($url) to work within
> insert_data($table,$values,$where)
>
> Even if I call the function: print redirect($url); and add the $url
> argument
> to insert_data it still doesn't work. I get undefined function error. What
> am I doing wrong?
>
>  require_once('../config.inc.php'); // contains define(WEB_ROOT,
> 'http://www.example.com'); and $db_connection
>
> class DATA {
> // variables
> var $table;
> var $fields;
> var $where;
> var $url;
>
> // Constructor must be the same name as the class
>
> // Functions
> function insert_data($table,$values,$where) {
> global $redirect;

You don't use globals inside a class to reference other data inside
the same class.

Instead you need to do something like this:

$add_location->url = 'blah';

then inside the class:

if ($result) {
   # redirect here
   print $this->redirect($this->url);
...

--
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] Help using a function within a function, both within a class

2006-04-19 Thread Adele Botes

To anyone who can help, I would like to know why or how I can execute a
function within a function used within this class. I want to redirect if
the results of a insert query was successful, so i made a simple redirect
function for later use, once I've build onto the class. The problem is that
i am not sure why or how to get the redirect($url) to work within
insert_data($table,$values,$where)

Even if I call the function: print redirect($url); and add the $url 
argument

to insert_data it still doesn't work. I get undefined function error. What
am I doing wrong?

require_once('../config.inc.php'); // contains define(WEB_ROOT, 
'http://www.example.com'); and $db_connection


class DATA {
   // variables
   var $table;
   var $fields;
   var $where;
   var $url;
  
   // Constructor must be the same name as the class
  
   // Functions

   function insert_data($table,$values,$where) {
   global $redirect;
   $insert = "INSERT INTO $table VALUES('',".$values.") $where";
   $result = mysql_query($insert);
   if ($result) {
   # redirect here
   print $redirect;
   } else {
   print die(mysql_error());
   }
   }
  
   function redirect($url) {
   $redirect = "URL=".WEB_ROOT."$url\">";

   return $redirect;
   }
  
}

?>


   
   
  $add_location = new DATA; // creates new object named DATA 
without ("constructor arguments")

   $add_location->redirect('site/index.php');
   $add_location->insert_data('locations',"'Vredendal','02721'",'');
   ?>
   
   


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



Re: [PHP] php 3 to 5 upgrade: foreach loop no longer working

2006-04-19 Thread Paul Waring
On 18/04/06, Vernon Webb <[EMAIL PROTECTED]> wrote:
> I've recently upgraded a server from Fedora Core 3 to Core 5 in the process 
> php had
> been upgraded from either 3 or 4 to php 5. In doing so I had to do a major 
> overhaul of
> a web site as many things stopped working (.i.e $HTTP_POST_VAR, etc).

There is actually an option in php.ini to switch on the $HTTP_*_VAR
variables, although it's off by default in PHP 5. It's still better in
my opinion to use the $_* superglobals ($_POST, $_GET etc), but if
you've got hundreds of scripts and no time to convert them (or you're
running phpBB, which relies on the deprecated behaviour), then enabled
register_long_arrays in php.ini.

Paul

--
Data Circle
http://datacircle.org

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



Re: [PHP] Bar codes

2006-04-19 Thread Tom Chubb
Under the GD Image Functions within the PHP Help file (on php.net) there is
an example for barcodes.
It also refers to barcodeisland.com which may be of use to you.
HTH

On 13/04/06, Emil Edeholt <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've never used bar codes before. And now I need to print out bar codes,
> and I've been told it should be in the format K39 Normal (I could have
> misunderstood since I can't find that on google. Maybe Code 39 Normal?).
> Any idea how to find that bar code font or what it's called? And what
> shall I use to print it out? Is it just as a regulat font, or do I need
> some special bar code lib?
>
> Thanks for your time
>
> Best regards Emil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Tom Chubb
[EMAIL PROTECTED]
07915 053312


Re: [PHP] Forking a search - pcntl

2006-04-19 Thread Jochem Maas

James Nunnerley wrote:

Thanks for everyone's replies - but I'm a little uncertain as to what the
reasons for not running the pcntl functions under the web browser are - is
it down to security?


http://php.net/pcntl


Process Control should not be enabled within a webserver environment and 
unexpected
results may happen if any Process Control functions are used within a webserver 
environment.


in short you don't want to be forking your apache processes from within
php. you don't need to understand why so much as trust that there is a
good reason for not doing it - the more you delve in the underbelly of
process control/forking/etc the more you'll understand why the above advice
is sound :-)



cheers

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2006 22:52

To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] Forking a search - pcntl

On Tue, April 18, 2006 5:21 am, James Nunnerley wrote:


What we'd like to do is run the actual search query in the background
(i.e.
fork) while the viewable page shows a nice scrollie banner etc!



fork is not the only solution for this, thank [insert deity here]



Due to various problems with the server we are using (Zeus) we can't
just
run an exec().  I've had a look around, and it would seem that pcntl
maybe
the way forward.



NO WAY!

pcntl should NOT be run in a web-hosted environment, according to the
docs.

I don't think Zeus' threading model is going to make it "okay" to use.



Does anyone have an example working script, or indeed a decent
tutorial on
how to use the functionality?  The php manual has limited information
on
using the functions, and I just can't get my head around how it's
meant to
work?!!!



pctnl should only be used from CLI/CGI

The examples should be sufficient for that, but you don't really care,
as it's not useful for what you want.

Here is what *I* would recommend:

Create a new table of "searches":
create table search(
  search_id int(11) auto_increment unique not null primary key,
  status enum{0, 1, 2} default 0,
  search_pid int(11) default null,
  inputs text,
  results text
);

0 = new search
1 = in progress
2 = complete

Now, when somebody wants you to do a search, just insert a record:
$query = "insert into search(inputs) values('$CLEAN[inputs]')";
where $CLEAN is your sanitized validated $_REQUEST input, of course.
$id = mysql_insert_id();

Your scrolling banner can than have a META Refresh of a few
seconds/minutes/whatever, and embed the $id into the URL for that.
See: http://php.net/mysql_insert_id

Then, of course, you need something to actually PERFORM the searches,
which is where a nice cron job comes in.

That cron job can start a new search task which will do this:
[in psuedo-code]

$pid = getmypid(); // or something like that:
UPDATE search set status = 1, search_pid = $pid where status = 0 LIMIT 1
SELECT id, inputs from search where search_pid = $pid
$id = $row['id'];
update search set status = 1 where id = $id
//do the search
//when done:
update search set status = 2, results = '$search_results' where id = $id

Doing it this way means you could even run several processes at once,
each working on a different search.

Note that the UPDATE marks the record as "in progress" and ties it to
the process running, so that there is NO race condition.

If MySQL does not support LIMIT 1 in an UPDATE, which I'm pretty sure
it does, but not 100% certain, then you'd have to just update all the
inputs available, and have the thread handle each search that it
"took" in the UPDATE.

You could still have an army of search processes, though, as new
search inputs are coming in all the time, and each search process
would handle however many were on the "To Do" (status 0) stack when
they started.

This is very scalable, and you could even buy more computers and throw
them at it, with just one database, provided you tagged the process_id
with a machine_id of some kind as well, to avoid duplciate process IDs
on 2 computers.  I'll leave that part as an exercise.



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



[PHP] a funny variable composition out of my daily programmer life

2006-04-19 Thread Barry

He really didn't knew what he hase done when he came to this varname.

$_POST["f-art-nlid"];

burn baby :D *boom* xD
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



RE: [PHP] Forking a search - pcntl

2006-04-19 Thread James Nunnerley
Thanks for everyone's replies - but I'm a little uncertain as to what the
reasons for not running the pcntl functions under the web browser are - is
it down to security?

cheers

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: 18 April 2006 22:52
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] Forking a search - pcntl

On Tue, April 18, 2006 5:21 am, James Nunnerley wrote:
> What we'd like to do is run the actual search query in the background
> (i.e.
> fork) while the viewable page shows a nice scrollie banner etc!

fork is not the only solution for this, thank [insert deity here]

> Due to various problems with the server we are using (Zeus) we can't
> just
> run an exec().  I've had a look around, and it would seem that pcntl
> maybe
> the way forward.

NO WAY!

pcntl should NOT be run in a web-hosted environment, according to the
docs.

I don't think Zeus' threading model is going to make it "okay" to use.

> Does anyone have an example working script, or indeed a decent
> tutorial on
> how to use the functionality?  The php manual has limited information
> on
> using the functions, and I just can't get my head around how it's
> meant to
> work?!!!

pctnl should only be used from CLI/CGI

The examples should be sufficient for that, but you don't really care,
as it's not useful for what you want.

Here is what *I* would recommend:

Create a new table of "searches":
create table search(
  search_id int(11) auto_increment unique not null primary key,
  status enum{0, 1, 2} default 0,
  search_pid int(11) default null,
  inputs text,
  results text
);

0 = new search
1 = in progress
2 = complete

Now, when somebody wants you to do a search, just insert a record:
$query = "insert into search(inputs) values('$CLEAN[inputs]')";
where $CLEAN is your sanitized validated $_REQUEST input, of course.
$id = mysql_insert_id();

Your scrolling banner can than have a META Refresh of a few
seconds/minutes/whatever, and embed the $id into the URL for that.
See: http://php.net/mysql_insert_id

Then, of course, you need something to actually PERFORM the searches,
which is where a nice cron job comes in.

That cron job can start a new search task which will do this:
[in psuedo-code]

$pid = getmypid(); // or something like that:
UPDATE search set status = 1, search_pid = $pid where status = 0 LIMIT 1
SELECT id, inputs from search where search_pid = $pid
$id = $row['id'];
update search set status = 1 where id = $id
//do the search
//when done:
update search set status = 2, results = '$search_results' where id = $id

Doing it this way means you could even run several processes at once,
each working on a different search.

Note that the UPDATE marks the record as "in progress" and ties it to
the process running, so that there is NO race condition.

If MySQL does not support LIMIT 1 in an UPDATE, which I'm pretty sure
it does, but not 100% certain, then you'd have to just update all the
inputs available, and have the thread handle each search that it
"took" in the UPDATE.

You could still have an army of search processes, though, as new
search inputs are coming in all the time, and each search process
would handle however many were on the "To Do" (status 0) stack when
they started.

This is very scalable, and you could even buy more computers and throw
them at it, with just one database, provided you tagged the process_id
with a machine_id of some kind as well, to avoid duplciate process IDs
on 2 computers.  I'll leave that part as an exercise.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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] PHP6 just became my worst nightmare.

2006-04-19 Thread Jochem Maas

Robert Cummings wrote:

On Tue, 2006-04-18 at 17:29, Jochem Maas wrote:



...



*lol* While I feel for you, I'm pretty sure you were on that bandwagon
telling all us PHP4 clinger-ons to suck it up and upgrade cuz PHP5 is
sooo KEWL. Now you have an inkling why some of us weren't so keen ;)


my argument for _using_ php5 was a little more subtle, I argued that developing
*new* applications on php4 when php5 was already long out of the door was 
counter
productive to adoption of php5 (which eventually has a kickback to it's general
usage and therefore our employability - if php never moves beyond php4 how long
will it remain such a force?)

besides I run a number of php4 servers which will never make the move to php5
because the code is too big/nasty/complex to make the refactoring a viable
option.

oh well back to the drawingboard - I guess I still have few months to refactor
100,000 lines of code :-P

rgds,
Jochem



Cheers,
Rob.


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