php-general Digest 11 Apr 2004 01:11:05 -0000 Issue 2698

Topics (messages 183066 through 183096):

How to do this?
        183066 by: Mike Mapsnac
        183068 by: Duncan Hill
        183069 by: John W. Holmes
        183083 by: Mike Mapsnac

Re: Store e-mail in DB
        183067 by: Raditha Dissanayake

Re: PHP5 and pear
        183070 by: Aidan Lister

Most bizarre date problem ever
        183071 by: Brian Dunning
        183075 by: trlists.clayst.com

Read file backwards
        183072 by: Kim Steinhaug
        183073 by: Kim Steinhaug

PHP e-commerce questions
        183074 by: Matt Hedges

Re: Smarty Summary was Re: [PHP] smarty
        183076 by: Jochem Maas

Re: cleaning up html output from php in apache
        183077 by: Jason Sheets

MVC based frameworks and PHP5 Object Model.
        183078 by: Lukasz Karapuda
        183079 by: Robert Cummings

video thumbnail generation
        183080 by: Stuart Gilbert

php 5 install
        183081 by: Andy B
        183082 by: Andy B
        183084 by: Richard Harb
        183091 by: Rainer Müller

configure php solaris with openssl
        183085 by: Sascha Ferley

query strings coming from the same page going back to the same page
        183086 by: Andy B
        183088 by: Rainer Müller
        183090 by: Andy B
        183092 by: John W. Holmes

imap_open() fails with CouirerIMAP
        183087 by: Pembo13
        183089 by: Elfyn McBratney
        183093 by: Pembo13
        183094 by: Elfyn McBratney

phpextdist and phpize
        183095 by: gayard.ig.com.br
        183096 by: Elfyn McBratney

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- My php page takes data from the database such as ID, Date, Value and prints on the screen. About 20 entries are printed on the screen. The each entry has option 'yes' or 'no'.

So I need to gather the information about each entry and update database. I cannot access the variable from $_POST because parameter is not static and $_POST is not working like this $_POST['$id'];


Any ideas how I can make this working?


_________________________________________________________________
Tax headache? MSN Money provides relief with tax tips, tools, IRS forms and more! http://moneycentral.msn.com/tax/workshop/welcome.asp

--- End Message ---
--- Begin Message ---
On Saturday 10 April 2004 14:36, Mike Mapsnac wrote:

> So I need to gather the information about each entry and update database. I
> cannot access the variable from $_POST because parameter is not static and
> $_POST is not working like this $_POST['$id'];

$_POST["$id"]

" does variable substitution, ' does not.

--- End Message ---
--- Begin Message --- Mike Mapsnac wrote:
My php page takes data from the database such as ID, Date, Value and prints on the screen. About 20 entries are printed on the screen. The each entry has option 'yes' or 'no'.

So I need to gather the information about each entry and update database. I cannot access the variable from $_POST because parameter is not static and $_POST is not working like this $_POST['$id'];

Make a radio button such as:


<input type="radio" name="option[<?=$id?>]" value="Yes">
<input type="radio" name="option[<?=$id?>]" value="No">

Then, you'll have $_POST['option'][$id] that you can use.

$yes_ids = array_keys($_POST['option'],'Yes');
$yes_list = implode(',',$yes_ids);

$no_ids = array_keys($_POST['option'],'No');
$no_ids = implode(',',$no_ids);

$entire_list = implode(',',array_keys($_POST['option']));

$query = "UPDATE table SET option = CASE WHEN id IN ($yes_list) THEN 'Yes' WHEN id IN ($no_list) THEN 'No' END CASE WHERE id IN ($entire_list)";

Need to add in some validation, but that's the basic idea. Well, that's not really "basic", but it gives you an idea of a very efficient way to handle this. :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Thanks a lot
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Mike Mapsnac" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, April 10, 2004 10:34 AM
Subject: Re: [PHP] How to do this?


> Mike Mapsnac wrote:
> > My php page takes data from the database such as ID, Date, Value and
> > prints on the screen. About 20 entries are printed on the screen. The
> > each entry has option 'yes' or 'no'.
> >
> > So I need to gather the information about each entry and update
> > database. I cannot access the variable from $_POST because parameter is
> > not static and $_POST is not working like this $_POST['$id'];
>
> Make a radio button such as:
>
> <input type="radio" name="option[<?=$id?>]" value="Yes">
> <input type="radio" name="option[<?=$id?>]" value="No">
>
> Then, you'll have $_POST['option'][$id] that you can use.
>
> $yes_ids = array_keys($_POST['option'],'Yes');
> $yes_list = implode(',',$yes_ids);
>
> $no_ids = array_keys($_POST['option'],'No');
> $no_ids = implode(',',$no_ids);
>
> $entire_list = implode(',',array_keys($_POST['option']));
>
> $query = "UPDATE table SET option = CASE WHEN id IN ($yes_list) THEN
> 'Yes' WHEN id IN ($no_list) THEN 'No' END CASE WHERE id IN
($entire_list)";
>
> Need to add in some validation, but that's the basic idea. Well, that's
> not really "basic", but it gives you an idea of a very efficient way to
> handle this. :)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
>
>

--- End Message ---
--- Begin Message --- MadHD wrote:

Hi,
i'm searching some script that can read e-mails with attachments from an
account pop3 and that store them in a db.


Michelle has an informative post on how to do this. I am proposing an alternative. If you are setting up a new system you might want to consider using IMAP since it's pretty much like DB+POP3. (supports searching etc)


Someone can help me?
Thanks, Heber.





--
Raditha Dissanayake.
---------------------------------------------
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions

--- End Message ---
--- Begin Message ---
Was that from a > pear install xml_rpc ?



"Electroteque" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Pear does not seem to be actually in the sources for some reason
>
> [PEAR] XML_RPC: The following errors where found (use force option to
> install an
> yway):
> missing package name
> missing summary
> missing description
> missing license
> missing version
> missing release state
> missing release date
> missing release notes
> no maintainer(s)
> no files
>
> did this for all of them ??

--- End Message ---
--- Begin Message --- Check this out: I'm returning a list of the last 30 days, looping through i, subtracting it from $end_date where $end_date is 2004-04-10 00:00:00. I'm just trying to derive a timestamp $check_date for each iteration, like 1081321200. Here's the code within the loop:

$check_date = mktime(0, 0, 0, substr($end_date, 5, 2), substr($end_date, 8, 2) - $i, substr($end_date, 0, 4), -1);

Note that this works PERFECTLY for every date, and always has. Except for one particular day. When $end_date - $i is supposed to be April 4, the timestamp returned is -7262, which it thinks is 12/31/1969. Can somebody PLEASE tell me how the above code manages to produce -7262, when it's always worked properly for every other day in history?

Confused,
- Brian

--- End Message ---
--- Begin Message ---
On 10 Apr 2004 Brian Dunning wrote:

> Check this out: I'm returning a list of the last 30 days, looping 
> through i, subtracting it from $end_date where $end_date is 2004-04-10 
> 00:00:00. I'm just trying to derive a timestamp $check_date for each 
> iteration, like 1081321200. Here's the code within the loop:
> 
> $check_date = mktime(0, 0, 0, substr($end_date, 5, 2), 
> substr($end_date, 8, 2) - $i, substr($end_date, 0, 4), -1);
> 
> Note that this works PERFECTLY for every date, and always has. Except 
> for one particular day. When $end_date - $i is supposed to be April 4, 
> the timestamp returned is -7262, which it thinks is 12/31/1969. 

I don't see the same problem.  This code:

<?php
$end_date = "2004-04-10";
for ($i = 1; $i <= 30; $i++) {
        $check_date = mktime(0, 0, 0, substr($end_date, 5, 2),
                substr($end_date, 8, 2) - $i, substr($end_date, 0, 4), -1);
        $strdate = date("m-d-Y", $check_date);
        print("$check_date = $strdate\n");
}
?>

Produces this output:

1081483200 = 04-09-2004
1081396800 = 04-08-2004
1081310400 = 04-07-2004
1081224000 = 04-06-2004
1081137600 = 04-05-2004
1081054800 = 04-04-2004
1080968400 = 04-03-2004
1080882000 = 04-02-2004
1080795600 = 04-01-2004
1080709200 = 03-31-2004
1080622800 = 03-30-2004
1080536400 = 03-29-2004
1080450000 = 03-28-2004
1080363600 = 03-27-2004
1080277200 = 03-26-2004
1080190800 = 03-25-2004
1080104400 = 03-24-2004
1080018000 = 03-23-2004
1079931600 = 03-22-2004
1079845200 = 03-21-2004
1079758800 = 03-20-2004
1079672400 = 03-19-2004
1079586000 = 03-18-2004
1079499600 = 03-17-2004
1079413200 = 03-16-2004
1079326800 = 03-15-2004
1079240400 = 03-14-2004
1079154000 = 03-13-2004
1079067600 = 03-12-2004
1078981200 = 03-11-2004

Tested on PHP 4.3.4 on Win2K.

--
Tom

--- End Message ---
--- Begin Message ---
Anyone have a script that reads a file backwards? Im looking for
a way to trace a log file, say the last 30 lines each time I run the script.
I havnt found any DOS tools so I guess doing it in PHP will be just as
fine, and Im on a Win32 platform.

I could however read the entire file, and count the files and show the
last lines, but this wouldnt really read it backwards and would work
very "foolishly" on large files I would think.

If there isnt a way of doing this Ill have to do the above, but you never
know. Ill google in the meantime.

-- 
-- 
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Got a tip by email,

Might look here and modify it if needed ...

http://tailforwin32.sourceforge.net/

Thanks, this is atleast much better than switching windows and refershing
the files in Textpad
which I do at the moment. tail was ofcourse the word I was looking for, not
the trace word.

Thanks for the tip,

Kim Steinhaug


"Kim Steinhaug" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anyone have a script that reads a file backwards? Im looking for
> a way to trace a log file, say the last 30 lines each time I run the
script.
> I havnt found any DOS tools so I guess doing it in PHP will be just as
> fine, and Im on a Win32 platform.
>
> I could however read the entire file, and count the files and show the
> last lines, but this wouldnt really read it backwards and would work
> very "foolishly" on large files I would think.
>
> If there isnt a way of doing this Ill have to do the above, but you never
> know. Ill google in the meantime.
>
> -- 
> -- 
> Kim Steinhaug
> ----------------------------------------------------------------------
> There are 10 types of people when it comes to binary numbers:
> those who understand them, and those who don't.
> ----------------------------------------------------------------------
> www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
> ----------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Hello.

I have built a site where people can register their weddings.  I use
MySQL/PHP to handle the database.  I wish to add a step where people must
pay to enter their information into the database.

How do I do this?  What services do ya'll recommend?  I won't need a
complicated shopping cart, since there will just be one thing to purchase...
I just need something that takes credit card information and then assigns
the user a username and password...

thanks a lot,
Matt

-- 

--- End Message ---
--- Begin Message --- Justin Patrin wrote:

Jochem Maas wrote:

...



Smarty does force that at all; you have to make the distinction and apply liberal self-restraint.

I meant 'does NOT force' - thinko!


...

PLEASE WORLD: GET BEHIND CSS, AND FREE CONTENT FROM STYLE ON THE CLIENT.
why because it allows the structrully mark-uped to be display more flexibly, for diff. display, aural readers, braille etc. removing the styling definitions it also allows you to specify different markup.


I want to. I so want to, but I can never get it to make the layout as I want it. I want to take a div and make it vertically or horizontally

be practical - if you need to vertical align something and can't get it to work another way use a table.


I CSS site that I found really inspiring is http://www.csszengarden.com/
if you really 'want to' then take the time to read it and view all the styles (well not ness. all 247) - take a look at the HTML (and the CSS file for each style), maybe have a go at it yourself.


centered in another div....if you figure out how to do it with dynamic

try to let go of the assumption that you can control the display of your pages (think of the all the platform/hardware/software/user-settings/etc combinations there are.) - you can only guide it. one of the founding ideas of the 'webpage' if that the manner in which it is displayed is upto the user (braille/speech/mobile/PC/Barney).


also attempt a site contruction by first creating a bare bones text only site with proper markup (P,H tags etc. prefer XHTML over HTML), the see what you can add. (have a look at the effect is of using different DOC-TYPEs)

sizes that is easy and works on all the major browsers, let me know. I've tried for hours, looks on I don't know how many websites, and I still couldn't do it. I went back to tables because it's just so easy. CSS makes my life very hard...it doesn't seem to have the basics needed to create an entire layout.

er but it really does (and the trick is to). not to worry I have been hacking css for about 3 years now, in the beginning it was even worse - support is getting better which means documentation often more closely ressembles truth ;-)


Make Mozilla/Opera part of your testing kit - they support CSS better (they are not 3+ years old like IE6).

instead of approaching it from the view of a print designer - ie fixed, static layout - assume the layout is a liquid (http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=liquid+design)

to be honest - in this game you really have to study something to truely get a grip on it. I mean, how many scripts have you poured over, how many hours with just one of those scripts to get it to play just right? CSS is no different.

That said, I do use lots of CSS for styling (font sizes, colors, images, printable pages, etc.), but fill-page styling via CSS is just beyond my reach.

dumping all those style definitions in a seperate file in a good start.



--- End Message ---
--- Begin Message ---
If you use Smarty you can use the {trim} m

Otherwise you can also use output buffering to grab the output buffer and
remove the sapces that you want.  

Note that you can't actually remove all whitespace as this sometimes has the
side effect of breaking cetain scripts, etc.

I'd rather implement gzip compression, you can do this through output
buffering (see http://www.php.net/ob_start) with PHP or through mod_gzip
(http://sourceforge.net/projects/mod-gzip/) for Apache.

Jason 

-----Original Message-----
From: Merlin [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 10, 2004 1:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] cleaning up html output from php in apache

Hi there,

I am searching for a way to strip the white spaces from each php generated
html site. Goal is to speed up the pages.

During my research for apache modules I found one for perl:
http://search.cpan.org/~geoff/Apache-Clean-0.05/Clean.pm

Is there something for php as well?

Thanx for any hint,

Merlin

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

--- End Message ---
--- Begin Message ---
I am curious to see if the experienced PHP developers have a recommendation
as far as which MVC or Model 2 based framework is the most robust to use in
web applications that will be developed in PHP5. For Java developers the
Struts Framework has become an Industry Accepted choice, whereas in PHP we
have a few MVC Open Source frameworks available, such as php.MVC, phrame. I
am considering options for web app frameworks, that I can adapt and feel
comfortable about the fact that they will be continiously maintained and
adjusted to use the new OO capabilities of PHP5.

I think it would beneficial to endorse a specific framework for web app
development in order to gain more unity in the patterns that developers
utilize to build web applications. I believe that the existence of unified
and endorsed standards is what still makes the Java related frameworks for
web application development more accepted by the enterprise world.

This is a request for comment :D

Regards,

Lukasz Karapuda

--- End Message ---
--- Begin Message ---
On Sat, 2004-04-10 at 15:19, Lukasz Karapuda wrote:
> I am curious to see if the experienced PHP developers have a recommendation
> as far as which MVC or Model 2 based framework is the most robust to use in
> web applications that will be developed in PHP5. For Java developers the
> Struts Framework has become an Industry Accepted choice, whereas in PHP we
> have a few MVC Open Source frameworks available, such as php.MVC, phrame. I
> am considering options for web app frameworks, that I can adapt and feel
> comfortable about the fact that they will be continiously maintained and
> adjusted to use the new OO capabilities of PHP5.
> 
> I think it would beneficial to endorse a specific framework for web app
> development in order to gain more unity in the patterns that developers
> utilize to build web applications. I believe that the existence of unified
> and endorsed standards is what still makes the Java related frameworks for
> web application development more accepted by the enterprise world.
> 
> This is a request for comment :D

Lack of choice makes beasts like Microsoft which are hard to put to
sleep despite their inferiority IMHO.

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

--- End Message ---
--- Begin Message --- I'd really like to generate video thumbnails within PHP, are there any libraries available or anything? I can't find very much on the subject on php.net and not a lot more on google.

I'd appreciate any pointers you could give me.

Regards,
             Stuart Gilbert.

--- End Message ---
--- Begin Message ---
if i install php5 will it affect any of the php4.3.3 code that i have
running at all...?? i want to install 5 and see what they have new going on
and stuff but i dont want to crash my 4.3.3 running code any....

and where would i be able to read a list of stuff that is new in 5??

--- End Message ---
--- Begin Message ---
anybody know how to put that in english?? i have no clude what it says...


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 10, 2004 5:13 PM
Subject: Re: [PHP] php 5 install


> Hallo und guten Tag,
>
> herzlichen Dank für Ihre Mail.
>
> Zeit zu leben und Zeit zum Schreiben machen gerade Osterpause, weshalb
Emails nur sehr sporadisch gelesen werden.
> Aber keine Sorge - keine Mail geht verloren :-)
>
> Der nächste Newsletter für Zeit zu leben erscheinen zum 19.4.04, der für
Zeit zum Schreiben zum 1.5.04.
>
> Ab dem 19.4.04 sind wir dann auch wieder regulär für Sie da - Ihre
Anfragen werden spätestens dann beantwortet.
>
> Wundervolle Frühlingstage und ein schönes Osterfest wünschen Ihnen
>
> Tania Konnerth & Ralf Senftleben
>
> --
> Alles für ein aktives Leben - http://www.zeitzuleben.de Lust zum
Schreiben? http://www.zeitzumschreiben.de
>
>
>

--- End Message ---
--- Begin Message ---
That's just one of those annoying out of office messages...
I could translate it .. but if the sender didn't care I guess it's not
important enough for him to provide an english translation himself.

Saturday, April 10, 2004, 11:17:44 PM, you wrote:

> anybody know how to put that in english?? i have no clude what it says...


> ----- Original Message ----- 
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, April 10, 2004 5:13 PM
> Subject: Re: [PHP] php 5 install


>> Hallo und guten Tag,
>>
>> herzlichen Dank für Ihre Mail.
>>
>> Zeit zu leben und Zeit zum Schreiben machen gerade Osterpause, weshalb
> Emails nur sehr sporadisch gelesen werden.
>> Aber keine Sorge - keine Mail geht verloren :-)
>>
>> Der nächste Newsletter für Zeit zu leben erscheinen zum 19.4.04, der für
> Zeit zum Schreiben zum 1.5.04.
>>
>> Ab dem 19.4.04 sind wir dann auch wieder regulär für Sie da - Ihre
> Anfragen werden spätestens dann beantwortet.
>>
>> Wundervolle Frühlingstage und ein schönes Osterfest wünschen Ihnen
>>
>> Tania Konnerth & Ralf Senftleben
>>
>> --
>> Alles für ein aktives Leben - http://www.zeitzuleben.de Lust zum
> Schreiben? http://www.zeitzumschreiben.de
>>
>>
>>

--- End Message ---
--- Begin Message --- Andy B schrieb:
anybody know how to put that in english?? i have no clude what it says...


----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 10, 2004 5:13 PM
Subject: Re: [PHP] php 5 install




Hallo und guten Tag,

herzlichen Dank für Ihre Mail.

Zeit zu leben und Zeit zum Schreiben machen gerade Osterpause, weshalb

Emails nur sehr sporadisch gelesen werden.


Aber keine Sorge - keine Mail geht verloren :-)

Der nächste Newsletter für Zeit zu leben erscheinen zum 19.4.04, der für

Zeit zum Schreiben zum 1.5.04.


Ab dem 19.4.04 sind wir dann auch wieder regulär für Sie da - Ihre

Anfragen werden spätestens dann beantwortet.


Wundervolle Frühlingstage und ein schönes Osterfest wünschen Ihnen

Tania Konnerth & Ralf Senftleben

--
Alles für ein aktives Leben - http://www.zeitzuleben.de Lust zum

Schreiben? http://www.zeitzumschreiben.de





Okay, I try it:


Hello and a good day,
thanks for your mail.
"Zeit zu leben" (Time To Life) and "Zeit zum Schreiben" (Time To Write) have an easter break at the moment,
so emails will be read only sporadically.
But don't worry - no mail will be lost.
The next newsletter for "Zeit zu leben" will be released at 19.04.04 and for "Zeit zum Schreiben" at 01.05.04.
After 19.04.04 we will be back for you regularly - Your requests will be answered then at the latest.
Wonderful spring-days and a beautiful Easter wish you
Tania Konnerth & Ralf Senftleben


Hope it is not too bad :)
Seems like an auto-reply...

Rainer
--- End Message ---
--- Begin Message ---
Hi, 
I am having a issue with configure in that it doesn't like to find the openssl 
libraries when running configure. Looking through the log it states that there is a 
issue with configure itself.. 
 
---- config.log -----------------------
configure:16174: checking for OpenSSL version "configure", line 16182: Error: "," 
expected instead of "end of file".
"configure", line 16182: Error: Use ";" to terminate declarations.
2 Error(s) detected.

======================
 
The openssl lib that is installed is: OpenSSL 0.9.7d 17 Mar 2004
The specific section in configure that it is complaining about is:
 
------------ Section from  configure code with comment.. 
 
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
  yes       <---------------- issue right here....
#endif
 
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
      echo "$ac_t"">= 0.9.6" 1>&6
else
  rm -rf conftest*
      { echo "configure: error: OpenSSL version 0.9.6 or greater required." 1>&2; exit 
1; }
==================================
 
It is kind of strange, since the compiles used to work, without any problem, but since 
about 4.3.4 i am running into this issue. 
 
If anyone has any idea, please let me know
Thanks
S.

--- End Message ---
--- Begin Message ---
was wondering if this would work or do i need different code:
<?php
include("libs/conf.db");
if(($_GET['month']==0)||($_GET['month']>12)){
$query="SELECT
 Type,
 StartDate,
 EndDate,
 Name,
 County,
 Notes
FROM $EventsTable
ORDER BY StartDate DESC";
} else {
$query="SELECT
 Type,
 StartDate,
 EndDate,
 Name,
 County,
 Notes
FROM $EventsTable WHERE
StartingMonth='{$_GET['month']}'
ORDER BY StartDate DESC";}
mysql_pconnect($host, $mysqluser, $mysqlpwd)||die(mysql_error());
$result=mysql_query($query) or die(mysql_error());
?>
then i would have a link on the same page this code came from:
<a href="ViewEvents.php?month=1">Jan</a>
the link is supposed to reload the same page it came from and be bart of the
query above... the thing im not sure of is if that will work or not or do i
need something else...(new to self referrencing pages)...

--- End Message ---
--- Begin Message --- Andy B schrieb:
was wondering if this would work or do i need different code:
<?php
include("libs/conf.db");
if(($_GET['month']==0)||($_GET['month']>12)){
$query="SELECT
 Type,
 StartDate,
 EndDate,
 Name,
 County,
 Notes
FROM $EventsTable
ORDER BY StartDate DESC";
} else {
$query="SELECT
 Type,
 StartDate,
 EndDate,
 Name,
 County,
 Notes
FROM $EventsTable WHERE
StartingMonth='{$_GET['month']}'
ORDER BY StartDate DESC";}
mysql_pconnect($host, $mysqluser, $mysqlpwd)||die(mysql_error());
$result=mysql_query($query) or die(mysql_error());
?>
then i would have a link on the same page this code came from:
<a href="ViewEvents.php?month=1">Jan</a>
the link is supposed to reload the same page it came from and be bart of the
query above... the thing im not sure of is if that will work or not or do i
need something else...(new to self referrencing pages)...

Probably it is better to use <a href="<?php echo $_SERVER['PHP_SELF']; ?>?month=1">Jan</a> Then it is not in dependency to the filename.

And btw. you should check with is_numeric() if the value from $_GET['month'] is really a number or you will have an security hole in you script.

Rainer
--- End Message ---
--- Begin Message ---
going to try some different things out... the if statement didnt work cuz
when i didnt put a query string at the end of the page name when going to it
it complained about month being an undefined index...


----- Original Message ----- 
From: "Rainer Müller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 10, 2004 6:33 PM
Subject: [PHP] Re: query strings coming from the same page going back to the
same page


> Andy B schrieb:
> > was wondering if this would work or do i need different code:
> > <?php
> > include("libs/conf.db");
> > if(($_GET['month']==0)||($_GET['month']>12)){
> > $query="SELECT
> >  Type,
> >  StartDate,
> >  EndDate,
> >  Name,
> >  County,
> >  Notes
> > FROM $EventsTable
> > ORDER BY StartDate DESC";
> > } else {
> > $query="SELECT
> >  Type,
> >  StartDate,
> >  EndDate,
> >  Name,
> >  County,
> >  Notes
> > FROM $EventsTable WHERE
> > StartingMonth='{$_GET['month']}'
> > ORDER BY StartDate DESC";}
> > mysql_pconnect($host, $mysqluser, $mysqlpwd)||die(mysql_error());
> > $result=mysql_query($query) or die(mysql_error());
> > ?>
> > then i would have a link on the same page this code came from:
> > <a href="ViewEvents.php?month=1">Jan</a>
> > the link is supposed to reload the same page it came from and be bart of
the
> > query above... the thing im not sure of is if that will work or not or
do i
> > need something else...(new to self referrencing pages)...
>
> Probably it is better to use
> <a href="<?php echo $_SERVER['PHP_SELF']; ?>?month=1">Jan</a>
> Then it is not in dependency to the filename.
>
> And btw. you should check with is_numeric() if the value from
> $_GET['month'] is really a number or you will have an security hole in
> you script.
>
> Rainer
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message --- Andy B wrote:

going to try some different things out... the if statement didnt work cuz
when i didnt put a query string at the end of the page name when going to it
it complained about month being an undefined index...

if(!isset($_GET['month']) || $_GET['month'] <= 0 || $_GET['month'] > 12)


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- Hello,

Does anyone have php's imap functions working with CourierIMAP as their imap server?

Thank you
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Saturday 10 Apr 2004 22:59, Pembo13 wrote:
> Hello,
>
> Does anyone have php's imap functions working with CourierIMAP as their
> imap server?

Yes, as does IMP (see horde.org).  What errors do you get?  What code are you 
using (strip it down to something simple like connect/disconnect)?

If you need help, theres examples in the manual:
  <http://www.php.net/manual/en/ref.imap.php>

Elfyn

- -- 
Elfyn McBratney, EMCB
mailto:[EMAIL PROTECTED]
http://www.emcb.co.uk/

PGP Key ID: 0x456548B4
PGP Key Fingerprint:
  29D5 91BB 8748 7CC9 650F  31FE 6888 0C2A 4565 48B4

"When I say something, I put my name next to it." -- Isaac Jaffee

>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
<< ~  Linux london 2.6.5-emcb-241 #2 i686 GNU/Linux  ~ >>
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAeI3UaIgMKkVlSLQRAlGJAJ40vHmcldx23hSFt9rpbYlEZ+MrigCgmRfz
V1Pq2IrZz0RarH8RI3yPj/o=
=ctL7
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message --- Well I've setup a reltively simple code block:

function mailboxmsginfo($mailbox='INBOX', $username, $password) {
$username = $username."@dalive.com";
$imap_stream = "{localhost:143/notls}".$mailbox;
$mbox = imap_open($imap_stream, $username, $password)
or die("can't connect ($username with $password): " . imap_last_error());
$check = imap_mailboxmsginfo($mbox);
imap_close($mbox);


  return $check;
}

Client side I get (from imap_last_error): Can not authenticate to IMAP server: Authentication failed.

Serverside, from Courier's logs i see the commands that differ from what normally comes from my mail clients. The normal mail client commands are of the format:

imapd: Connection, ip=[::ffff:192.168.100.11], command=LOGIN
imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], username=myusername
imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], password=mypassword
imapd: LOGIN, [EMAIL PROTECTED], ip=[::ffff:192.168.100.11], protocol=IMAP


while the commands as a result of the PHP funcion are of the format:

imapd: Connection, ip=[::ffff:192.168.100.11], command=LOGIN
imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], command=AUTHENTICATE imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], command=LOGOUT
imapd: LOGOUT, ip=[::ffff:192.168.100.11]


Any ideas?
Thanks


Elfyn McBratney wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Saturday 10 Apr 2004 22:59, Pembo13 wrote:

Hello,

Does anyone have php's imap functions working with CourierIMAP as their
imap server?


Yes, as does IMP (see horde.org). What errors do you get? What code are you using (strip it down to something simple like connect/disconnect)?

If you need help, theres examples in the manual:
  <http://www.php.net/manual/en/ref.imap.php>

Elfyn

- -- Elfyn McBratney, EMCB
mailto:[EMAIL PROTECTED]
http://www.emcb.co.uk/


PGP Key ID: 0x456548B4
PGP Key Fingerprint:
  29D5 91BB 8748 7CC9 650F  31FE 6888 0C2A 4565 48B4

"When I say something, I put my name next to it." -- Isaac Jaffee


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<

<< ~ Linux london 2.6.5-emcb-241 #2 i686 GNU/Linux ~ >>


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAeI3UaIgMKkVlSLQRAlGJAJ40vHmcldx23hSFt9rpbYlEZ+MrigCgmRfz
V1Pq2IrZz0RarH8RI3yPj/o=
=ctL7
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 10 Apr 2004 23:42, Pembo13 wrote:
> Well I've setup a reltively simple code block:
>
> function mailboxmsginfo($mailbox='INBOX', $username, $password) {
>       $username = $username."@dalive.com";
>    $imap_stream = "{localhost:143/notls}".$mailbox;
>    $mbox = imap_open($imap_stream,  $username, $password)
>       or die("can't connect ($username with $password): " .
> imap_last_error());
>    $check = imap_mailboxmsginfo($mbox);
>    imap_close($mbox);
>
>    return $check;
> }

OK, can you try this:

  <?php
    $mbox = imap_open('{127.0.0.1:143/notls)INBOX', 'user', 'pass')
      or die(imap_last_error());
    echo("Connected..\n");
    imap_close($mbox);
  ?>

(If courier isn't compiled with SSL/TLS support, drop the '/notls'.)

Also have a look at the docs/comments here:
  <http://www.php.net/manual/en/function.imap-open.php>

> Client side I get (from imap_last_error): Can not authenticate to IMAP
> server: Authentication failed.
>
> Serverside, from Courier's logs i see the commands that differ from what
> normally comes from my mail clients. The normal mail client commands are
> of the format:
>
> imapd: Connection, ip=[::ffff:192.168.100.11], command=LOGIN
> imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], username=myusername
> imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], password=mypassword
> imapd: LOGIN, [EMAIL PROTECTED], ip=[::ffff:192.168.100.11],
> protocol=IMAP
>
> while the commands as a result of the PHP funcion are of the format:
>
> imapd: Connection, ip=[::ffff:192.168.100.11], command=LOGIN
> imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], command=AUTHENTICATE
> imapd: LOGIN: DEBUG: ip=[::ffff:192.168.100.11], command=LOGOUT
> imapd: LOGOUT, ip=[::ffff:192.168.100.11]

hrmm..no.. anyone? 8)

Elfyn

- -- 
Elfyn McBratney, EMCB
mailto:[EMAIL PROTECTED]
http://www.emcb.co.uk/

PGP Key ID: 0x456548B4
PGP Key Fingerprint:
  29D5 91BB 8748 7CC9 650F  31FE 6888 0C2A 4565 48B4

"When I say something, I put my name next to it." -- Isaac Jaffee

>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
<< ~  Linux london 2.6.5-emcb-241 #2 i686 GNU/Linux  ~ >>
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAeJowaIgMKkVlSLQRAvAhAKCV+oLhJbjE6IrsPEA3SAq4+1cNHACfdu4t
LHJsC3JzuVKeR8FeI0J8oWY=
=fmBO
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
Hello, 

I have just installed PHP 5.0b4, and had a look into /usr/local/php5/bin. I 
have found these files: 

php 
pear 
php-config 
phpextdist 
phpize 

php is the only file I know, it is the one that interprets (interpretates ?) 
the PHP code. 

But what do the other programs do ? None of them has a man page, and they do 
not explain themselves to the --help argument. 

Thanks 
Leonel 

_________________________________________________________
Voce quer um iGMail protegido contra vírus e spams? 
Clique aqui: http://www.igmailseguro.ig.com.br


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 11 Apr 2004 00:22, [EMAIL PROTECTED] wrote:
> Hello,
>
> I have just installed PHP 5.0b4, and had a look into /usr/local/php5/bin. I
> have found these files:
>
> php

You know :)

> pear

Can be used to install/remove/update/etc pear/pecl packages

> php-config

Gives you information on your install..  used by phpize..

> phpextdist

Can't remember.. Google is your friend :)

> phpize

It bootstraps a directory for a standalone/out-of-tree module

Elfyn

- -- 
Elfyn McBratney, EMCB
mailto:[EMAIL PROTECTED]
http://www.emcb.co.uk/

PGP Key ID: 0x456548B4
PGP Key Fingerprint:
  29D5 91BB 8748 7CC9 650F  31FE 6888 0C2A 4565 48B4

"When I say something, I put my name next to it." -- Isaac Jaffee

>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
<< ~  Linux london 2.6.5-emcb-241 #2 i686 GNU/Linux  ~ >>
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAeKjIaIgMKkVlSLQRAnTVAJ9h+8+N8WkUo43rmybs8vFc/F+B3QCeLRoF
DvEfjUAqGnaFEHsHsUuBkBU=
=2csS
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to