php-windows Digest 16 Feb 2001 20:38:45 -0000 Issue 449

Topics (messages 5589 through 5607):

Re: CGI error: incomplete headers?
        5589 by: Paco Ortiz
        5607 by: Maurice Barnes

Re: About PDF
        5590 by: Rainer Schaaf
        5606 by: alain samoun

remote_user
        5591 by: Paul Mileham
        5596 by: Ignatius Teo

Re: Apache PHP/Win98 Binaries?
        5592 by: Madhon
        5593 by: Daniel Beulshausen
        5594 by: Madhon
        5597 by: Daniel Beulshausen
        5602 by: Madhon
        5604 by: Daniel Beulshausen

Regarding new homepage
        5595 by: Charles Williams \( CEO ACNS \)

My Dilema
        5598 by: Ben Cairns
        5599 by: Tom Mathews
        5600 by: Asendorf, John
        5601 by: Asendorf, John

Using curl with php
        5603 by: Victor Hugo Gonzales

Serialized data gets corrupted in DBM
        5605 by: samlam

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]


----------------------------------------------------------------------


Hi:

I don't know whether this is your case or not, but this happened me once I didn't 
properly URLencoded the variables within my query string (GET method), and some of 
those variables had blank spaces.

Greetings,

F.J. Ortiz

----- Mensaje original ----- 
De: "Chaz Yoon" <[EMAIL PROTECTED]>
Para: <[EMAIL PROTECTED]>
Enviado: Friday, February 16, 2001 2:01 AM
Asunto: [PHP-WIN] CGI error: incomplete headers?


> I'm having a curious problem with PHP on IIS while setting up a message
> board (Phorum) on IIS 5.0, SQL Server 2000, and PHP 4.0.4pl1 (latest). While
> posting a message, post.php receives a POST, processes the passed data to
> check for completeness, inserts a row into the database, and then redirects
> the user via the header("Location .../list.php?f=1") function.  However,
> once the redirect occurs, I receive the following message:
> 
> CGI Error
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
> 
> Now, I know this has been in the archives, and I checked it out. The thing
> that's different for me is that when I refresh the page, it works just fine.
> Somehow, the GET is different from the POST. Does anybody have any thoughts
> on how I can fix this? Thanks.
> 
> Chaz
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




While I dont have a solution for this problem I can confirm that the problem
is in the Header("Location:xxxx") command. Because of this obvious quirk
with IIS and PHP4 we have had to resort to PHP3 for a major e-business site
we were trying to upgrade to PHP4. I am not sure why this has not yet been
corrected as it has been discussed and I think its also in the bugs
database. We even tried using include files to get around the problme but
tht proved too messy. If there is anyone out there who has a solution or
willing to look into please do. This is a showstopper for users on the
Windows platform and should be fixed asap

Regards,
Maurice

----- Original Message -----
From: "Chaz Yoon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 8:01 PM
Subject: [PHP-WIN] CGI error: incomplete headers?


> I'm having a curious problem with PHP on IIS while setting up a message
> board (Phorum) on IIS 5.0, SQL Server 2000, and PHP 4.0.4pl1 (latest).
While
> posting a message, post.php receives a POST, processes the passed data to
> check for completeness, inserts a row into the database, and then
redirects
> the user via the header("Location .../list.php?f=1") function.  However,
> once the redirect occurs, I receive the following message:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
of
> HTTP headers. The headers it did return are:
>
> Now, I know this has been in the archives, and I checked it out. The thing
> that's different for me is that when I refresh the page, it works just
fine.
> Somehow, the GET is different from the POST. Does anybody have any
thoughts
> on how I can fix this? Thanks.
>
> Chaz
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>






> I´m making a Pdf document with Php.
>
> Questions:
>
> · ¿Can i make TABLES with Pdf?
>   (Something like Html...)
>
Yes and no. There is no special highlevel API defined for the PDFlib
functions to do that. So you have to do the programin on your own.

>
> · I'm going to write a text, but i don´t know the lenght of this text. What
> i want is that Pdf breaks the line and jumps to the next line automatically.
>   ¿How can i make this with Pdf functions?
>
>
You may user PDF_show_boxed(), or you user PDF_stringwidth() to build
your own formatting routine.

> · The function 'PDF_curveto' draws a curve around 4 points. I want to draw
> a curve around N points.
> ¿How can i do that?
>
Then you have to call PDF_curveto() more than once.

>
>
> Thankyou very much for any help.
>
Rainer

--
Rainer Schaaf       [EMAIL PROTECTED]        http://www.pdflib.com
_______PDFlib - a library for generating PDF on the fly________






If you can wait, I should be posting a class, that will do what you
want. Look for it in a week or two at:
phpclasses.upperdesign.com/browse.html 
Alain

Antonio Lopez wrote:
> 
> I´m making a Pdf document with Php.
> 
> Questions:
> 
> · ¿Can i make TABLES with Pdf?
>   (Something like Html...)
> 
> · I'm going to write a text, but i don´t know the lenght of this text. What
> i want is that Pdf breaks the line and jumps to the next line automatically.
>   ¿How can i make this with Pdf functions?
> 
> · The function 'PDF_curveto' draws a curve around 4 points. I want to draw
> a curve around N points.
> ¿How can i do that?
> 
> Thankyou very much for any help.
> 
> ===================================================
> Antonio López Luna
> Ingeniería e Integración Avanzadas (Ingenia), S.A.
> Parque Tecnológico de Andalucía
> 29590  - Málaga (Spain)
> 
> Tel. 34-952029300 Ext. 386
> Fax. 34-952029309
> Web: http://www.ingenia.es
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Now look - this is utterly ridiculous.
Last week, $HTTP_REMOTE_USER was working perfectly, and now - zilch.
I've changed nothing, so far as I know.
Could it be anything to do with our IT brigade installing a firewall? Dunno.

Any help gratefully received.

paul

___________________________________________________
Paul Mileham                                      [EMAIL PROTECTED]
Administration Manager
Church Pastoral Aid Society
Athena Drive                               (home: [EMAIL PROTECTED])
Tachbrook Park
WARWICK
CV34 6NG
01926 458473                                    (home: 01926 426250)
___________________________________________________





Absolutely riduculous! Dang IT brigades! They've probably set it so the
firewall prevents $HTTP_REMOTE_USER from being set. However, $REMOTE_USER
may still work...


Ignatius

> -----Original Message-----
> From: Paul Mileham [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 16 February 2001 22:32
> To: '[EMAIL PROTECTED]'
> Subject: [PHP-WIN] remote_user
>
>
> Now look - this is utterly ridiculous.
> Last week, $HTTP_REMOTE_USER was working perfectly, and now - zilch.
> I've changed nothing, so far as I know.
> Could it be anything to do with our IT brigade installing a
> firewall? Dunno.
>
> Any help gratefully received.
>
> paul
>
> ___________________________________________________
> Paul Mileham                                      [EMAIL PROTECTED]
> Administration Manager
> Church Pastoral Aid Society
> Athena Drive                               (home: [EMAIL PROTECTED])
> Tachbrook Park
> WARWICK
> CV34 6NG
> 01926 458473                                    (home: 01926 426250)
> ___________________________________________________
>
>





you can get a version from www.php4win.de

i also have v4.04 compiled with eapi if you wont it
i havent been able to get 4.04pl1 to compile yet has anybody else

"Lee Goddard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Does anyone have a URL of PHP4 compiled with the Apache EAPI?
>
> I downloaded PHP4 for Windows, and get this message from Apache:
>
> [Thu Feb 15 17:15:05 2001] [warn] Loaded DSO
D:/Lang/php4/sapi/php4apache.dll uses plain Apache 1.3 API, this module
might crash under EAPI! (please recompile it with -DEAPI)
> [Thu Feb 15 17:15:05 2001] [warn] pid file
d:/apache/modperlsrv/logs/httpd.pid overwritten -- Unclean shutdown of
previous Apache run?
>
> Thanks in anticipation,
> Lee
>
> --
>
> Lee Goddard     <[EMAIL PROTECTED]>
> -------------------------------------
> Perl : XML : XSLT : XHTML / JS : Java
>
> "Post-modernism....the meta-narrative that denies meta-narrative."
>                                       - Cedric Watts, Sussex 1997
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






At 11:44 16.02.2001 +0000, Madhon wrote:
>you can get a version from www.php4win.de
>
>i also have v4.04 compiled with eapi if you wont it
>i havent been able to get 4.04pl1 to compile yet has anybody else

you'll have to patch the zend source. i believe in zend_ini.c/zend_ini.h 
some of the needed functions aren't exported.
you must prefix them with ZEND_API and recompile, take a look at the cvs 
where it's already fixed.

daniel

/*--
daniel beulshausen - [EMAIL PROTECTED]
using php on windows? http://www.php4win.de





when i say not been able to compile 4.04pl1 i only refere to the apache
module, i can get t php.exe, php4ts.dll and php4isapi.dll to compile ok
but the apache module is the problem

"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 11:44 16.02.2001 +0000, Madhon wrote:
> >you can get a version from www.php4win.de
> >
> >i also have v4.04 compiled with eapi if you wont it
> >i havent been able to get 4.04pl1 to compile yet has anybody else
>
> you'll have to patch the zend source. i believe in zend_ini.c/zend_ini.h
> some of the needed functions aren't exported.
> you must prefix them with ZEND_API and recompile, take a look at the cvs
> where it's already fixed.
>
> daniel
>
> /*--
> daniel beulshausen - [EMAIL PROTECTED]
> using php on windows? http://www.php4win.de
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






At 12:42 16.02.2001 +0000, Madhon wrote:
>when i say not been able to compile 4.04pl1 i only refere to the apache
>module, i can get t php.exe, php4ts.dll and php4isapi.dll to compile ok
>but the apache module is the problem

i got that, and the fix is to export the ini function from zend which 
aren't exported in 4.0.4pl1.
so edit zend_ini.h/zend_ini.c and change the definitions of the functions to:

ZEND_API int zend_ini_startup(ELS_D);
ZEND_API int zend_ini_shutdown(ELS_D);
ZEND_API int zend_ini_deactivate(ELS_D);

daniel

>"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > At 11:44 16.02.2001 +0000, Madhon wrote:
> > >you can get a version from www.php4win.de
> > >
> > >i also have v4.04 compiled with eapi if you wont it
> > >i havent been able to get 4.04pl1 to compile yet has anybody else
> >
> > you'll have to patch the zend source. i believe in zend_ini.c/zend_ini.h
> > some of the needed functions aren't exported.
> > you must prefix them with ZEND_API and recompile, take a look at the cvs
> > where it's already fixed.
> >
> > daniel
> >
> > /*--
> > daniel beulshausen - [EMAIL PROTECTED]
> > using php on windows? http://www.php4win.de
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


/*--
daniel beulshausen - [EMAIL PROTECTED]
using php on windows? http://www.php4win.de





a have been looking for the function definitions u mention and cant find
them in any of
the source files that i have
have u any ideas about this if u want to see the zend_ini.h and zend_ini.c i
can email them to u

"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 12:42 16.02.2001 +0000, Madhon wrote:
> >when i say not been able to compile 4.04pl1 i only refere to the apache
> >module, i can get t php.exe, php4ts.dll and php4isapi.dll to compile ok
> >but the apache module is the problem
>
> i got that, and the fix is to export the ini function from zend which
> aren't exported in 4.0.4pl1.
> so edit zend_ini.h/zend_ini.c and change the definitions of the functions
to:
>
> ZEND_API int zend_ini_startup(ELS_D);
> ZEND_API int zend_ini_shutdown(ELS_D);
> ZEND_API int zend_ini_deactivate(ELS_D);
>
> daniel
>
> >"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > At 11:44 16.02.2001 +0000, Madhon wrote:
> > > >you can get a version from www.php4win.de
> > > >
> > > >i also have v4.04 compiled with eapi if you wont it
> > > >i havent been able to get 4.04pl1 to compile yet has anybody else
> > >
> > > you'll have to patch the zend source. i believe in
zend_ini.c/zend_ini.h
> > > some of the needed functions aren't exported.
> > > you must prefix them with ZEND_API and recompile, take a look at the
cvs
> > > where it's already fixed.
> > >
> > > daniel
> > >
> > > /*--
> > > daniel beulshausen - [EMAIL PROTECTED]
> > > using php on windows? http://www.php4win.de
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> >
> >--
> >PHP Windows Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> /*--
> daniel beulshausen - [EMAIL PROTECTED]
> using php on windows? http://www.php4win.de
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






At 14:51 16.02.2001 +0000, Madhon wrote:
>a have been looking for the function definitions u mention and cant find
>them in any of
>the source files that i have
>have u any ideas about this if u want to see the zend_ini.h and zend_ini.c i
>can email them to u

in the folder zend you'll find the files zend_ini.c and zend_ini.h.
edit zend_ini.h, there you'll find the lines:

int zend_ini_mstartup(void);
int zend_ini_mshutdown(void);
int zend_ini_rshutdown(void);
void zend_ini_sort_entries(void);

changed them to:

ZEND_API int zend_ini_mstartup(void);
ZEND_API int zend_ini_mshutdown(void);
ZEND_API int zend_ini_rshutdown(void);
ZEND_API void zend_ini_sort_entries(void);

now edit zend_ini.c and changed the function definitions there as well.

int zend_ini_mstartup()
{

ZEND_API int zend_ini_mstartup()
{

...

got it? then recompile.

daniel

/*--
daniel beulshausen - [EMAIL PROTECTED]
using php on windows? http://www.php4win.de





WOW!  Thanks for the response on my page (didn't think it would go over that
good. hehe).  Nice to know so many of you like the design (not mine though.
hehe.  It's called "Harpia" and it's free.  If you'd like more info let me
know).  The content of course will grow as more people contribute.  There
have been 2 questions that really seem to be more prolifant than any other
at this time though.

1. Why should I register?  The answer is simple really.  This is my
personnal site.  I feel that a persons personnal site is, in part, an
extension of thier home and thus deserves respect.  I love the thought of
people sharing ideas.  However, the thought of people sharing rude comments
and such does not appeal to me.  I would not allow such actions in my home,
thus, I won't allow them on my site.  Everyone that visits my site deserves
the same respect that they would recieve in my home.  By registering you are
helping me protect your respect while on my site.  Anyone that is rude, and
after being warned, does not cease such behaviour will have thier account
suspended.  If after the suspension is lifted and it happens again they will
have thier account disabled, thus, saving the rest of us the need to forge
through unneccesary crap.  If you are making a valid argument you need have
no fear.  It is the rude and vulgar comments that will not be tolerated
only.  Also, there is no need to worry about being put on an email list.
The email addy you provide is just to ensure that you recieve your account
info only.  If you hadn't noticed there are no commercial ads on my site.  I
would like to keep it so. hehe.  I hate banner ads myself and will not use
them.  I will provide links to certain sites and will post others links if
appropriate, but only in the links area and other pertainent areas.

2. WHERE THE HELL DO I SIGN UP AT?  Sorry, for the confusion.  Here is the
addy for signups: http://www.acns-online.com/chuck/users/op/ShowNewUser/
There are links available on the main page, but they seem to be a little too
small.  They will be enlarged and an extra link will be posted to help
remedy the situation.

Note:  There seems to be a slight problem with the logon script on the main
page.  In some cases the login is not successful and you will need to login
a second time.  Am looking into the problem and it will, hopefully, be fixed
soon.

Also, have added an area for you folks looking to sell your excess cobalt
equipment.  The url is:
http://www.acns-online.com/chuck/topics/op/topicsView/tid/27/
This area is for personnal use.  I don't wish to see a bunch of spam ads.
If you have equipment that is extra and you are offering a good deal please
feel free to post.

Chuck




==============================================
Charles Williams
(Owner)
Accent Computer & Network Services
Markt 2
D-95679 Waldershof
Tel: +49 (0) 9231 972670
Fax: +49 (0) 9231 972671
http://www.acns-online.com
GB/CS/O/U d-- -p+ c+++ l++ u- e+ m+ s++/ !n h---- f !g w++ t+ r x**
==============================================






I have a slight problem with this....

I am returning numerical values (i.e. 22.64, 2.54 etc. All with two Decimal 
Places) from a database. I then want to add these together.

But, I don't know how many rows there are, so I cant do:
$row+$row
There may only be one row, or there may be hundreds of rows. How can I add 
all of the values together?

Any help appreciated, cos. I'm stuck!..

-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com

"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK......"





SELECT SUM(Row_x) FROM Table_y;

Tom

Ben Cairns wrote:

> I have a slight problem with this....
>
> I am returning numerical values (i.e. 22.64, 2.54 etc. All with two Decimal
> Places) from a database. I then want to add these together.
>
> But, I don't know how many rows there are, so I cant do:
> $row+$row
> There may only be one row, or there may be hundreds of rows. How can I add
> all of the values together?
>
> Any help appreciated, cos. I'm stuck!..
>
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
>
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK......"
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Which database are you using?  It will make a difference in how to do this.

Generally, you'll want some type of FOR loop:

ATTENTION:  THIS IS NOT REAL CODE, JUST AN IDEA


$num_results = count (results);

for ( $i=1 ; $i <= $num_results ; $i++ ) {

        fetch_row ( results );

        $grand_total = $grand_total + results[$i];

}






---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Ipsa scientia potestas est


> -----Original Message-----
> From: Ben Cairns [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 9:10 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] My Dilema
> 
> 
> I have a slight problem with this....
> 
> I am returning numerical values (i.e. 22.64, 2.54 etc. All 
> with two Decimal 
> Places) from a database. I then want to add these together.
> 
> But, I don't know how many rows there are, so I cant do:
> $row+$row
> There may only be one row, or there may be hundreds of rows. 
> How can I add 
> all of the values together?
> 
> Any help appreciated, cos. I'm stuck!..
> 
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
> 
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK......"
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 




Or like Tom suggested, you can do it with SQL (I'm an idiot... seeing as how
I did this just two days ago)

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Ipsa scientia potestas est


> -----Original Message-----
> From: Asendorf, John [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 9:18 AM
> To: Ben Cairns; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] My Dilema
> 
> 
> Which database are you using?  It will make a difference in 
> how to do this.
> 
> Generally, you'll want some type of FOR loop:
> 
> ATTENTION:  THIS IS NOT REAL CODE, JUST AN IDEA
> 
> 
> $num_results = count (results);
> 
> for ( $i=1 ; $i <= $num_results ; $i++ ) {
> 
>       fetch_row ( results );
> 
>       $grand_total = $grand_total + results[$i];
> 
> }
> 
> 
> 
> 
> 
> 
> ---------------------
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> Ipsa scientia potestas est
> 
> 
> > -----Original Message-----
> > From: Ben Cairns [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 16, 2001 9:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] My Dilema
> > 
> > 
> > I have a slight problem with this....
> > 
> > I am returning numerical values (i.e. 22.64, 2.54 etc. All 
> > with two Decimal 
> > Places) from a database. I then want to add these together.
> > 
> > But, I don't know how many rows there are, so I cant do:
> > $row+$row
> > There may only be one row, or there may be hundreds of rows. 
> > How can I add 
> > all of the values together?
> > 
> > Any help appreciated, cos. I'm stuck!..
> > 
> > -- Ben Cairns - Head Of Technical Operations
> > intasept.COM
> > Tel: 01332 365333
> > Fax: 01332 346010
> > E-Mail: [EMAIL PROTECTED]
> > Web: http://www.intasept.com
> > 
> > "MAKING sense of
> > the INFORMATION
> > TECHNOLOGY age
> > @ WORK......"
> > 
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: 
> > [EMAIL PROTECTED]
> > 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 




Hi

I have been reading de curl tutorial and I try to aplicate it using php
but
I have problems with php.

In this  tutorial  there's this example (to transfer data with post
method):

           curl -d "birthyear=1905&press=OK"
www.hotmail.com/when/junk.cgi

Do you know how can I do this using  functions of php (curl_init,
curl_setopt, etc.)?

Regards

            Victor Hugo





Operating system: Windows 98
PHP version:      4.0.4pl1
Description:  Serialized data gets corrupted in DBM

I created a set of programs for maintaining userid and password information
using the DBM functions. (dbmopen, dbminsert, etc).. I keep userid,
password, effective date, expiry dates, etc... Hence I need to keep more
than just name & password pairs... I use the userid as the name and the
value is a serialized variable containing an associative array of the
remaining fields...

My PHP programs to add and display the user records works - unfortunately it
works intermittently... Some time all records are written correctly and are
displayed correctly.. but sometime several are written but when are
displayed, the details of the serialized data are missing.. it seems to be
corrupted...

I attach some code for the dbminsert and dbmfetch here...

Notes: $user is an associative array containing the password, start dates,
etc.

function addUser( $dbName, &$dbStatus,  $userid, $user ) {
  $dbh = dbmopen( "$dbName", "w" )
         or die("Couldn't open $dbName database");
  $serial_user = serialize( $user );
  print "serial_user is equal to <br> $serial_user <br>";
  $dbStatus = dbminsert( $dbh, "$userid", "$serial_user" );
  dbmclose( $dbh );
  }

function getUser( $dbName, &$dbStatus, $userid ) {
  $dbh = dbmopen( "$dbName", "r" )  // --- read db ----
         or die("Couldn't open $dbName database");
  if ( dbmexists( $dbh, $userid ) )
    {
    $serial_user = dbmfetch( $dbh, $userid );
    print "serial_user is equal to <br> $serial_user <br>";
    $user = unserialize( $serial_user );
    }
  else
    { $dbStatus = -1; }
  dbmclose( $dbh );
  return $user;
  }

I looked at the dbm file itself using a text editor and all the data are
present, even for those records that shows blanks for the details.

I opened 2 Internet Explorer windows side by side and ran the insert program
on one and the display on the other. I displayed the serialized value (i.e.
$serial_user) on both windows...

In the add window, the serialized data always looks like this:
a:5:{s:4:"name;s:1:"a";s:3:"pwd.... ETC ETC...

In the display window, the serialized data also looked as above when the
data is displayed correctly...

However, when the data is 'missing' the serialized data looks like this
:5:{s:4:"name;s:1:"a";s:3:"pwd.... ETC ETC...
(i.e. the 'a' is missing).

(you can see my debugging print statements in the code that I attached
above).

I am running PHP on Apache Web Server (1.3.14) for Windows. Both the browser
client and the Apache server are running on the same PC.

Thanks in advance for your help!





Reply via email to