php-general Digest 1 Apr 2002 05:24:49 -0000 Issue 1260

Topics (messages 90888 through 90921):

Re: HTML Question
        90888 by: Gary
        90898 by: Justin French

Re: APACHE + SSL + PHP
        90889 by: Septic Flesh

ask for suggestion about printing
        90890 by: php.gurubase.com
        90892 by: eric.coleman.zaireweb.com
        90894 by: Ashley M. Kirchner
        90897 by: Miguel Cruz

Re: Changing black to blue (2)
        90891 by: Andy

Re: Has anyone written such a function?
        90893 by: Rouvas Stathis

hosting
        90895 by: Heidi Belal

Newman Says: Error when starting sessions.
        90896 by: Philip J. Newman
        90904 by: Yasuo Ohgaki
        90915 by: Philip J. Newman

Re: Nead Help With A Php Script
        90899 by: martinahingis

Is it possible to call an external client or server program?
        90900 by: martinahingis
        90901 by: Cal Evans
        90902 by: martinahingis
        90903 by: Cal Evans

Re: Postgres question
        90905 by: Yasuo Ohgaki

Issues with long SQL inserts
        90906 by: Chris Snyder
        90907 by: Cal Evans
        90908 by: Chris Snyder
        90909 by: Cal Evans
        90910 by: Chris Snyder
        90911 by: Chris Snyder
        90913 by: Cal Evans
        90914 by: Chris Snyder
        90916 by: Cal Evans
        90921 by: Jason Wong

Help with nested if statements, is this possible?
        90912 by: Jim Hankins

Re: where i get .so [dll] file of linux ?
        90917 by: Prachait Saxena
        90920 by: Rasmus Lerdorf

return
        90918 by: Gary
        90919 by: Rasmus Lerdorf

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 ---
<iframe src="http://foo.com"; name="MyFrame" id="MyFrame" width="400" 
height="300" marginwidth="0" marginheight="0" scrolling="no" 
frameborder="0"></iframe>

You need to give a height. NN4 does not support iframe

Gary

Jtjohnston wrote:

> I suppse this is an HTML question more than PHP.
> I have a server elsewhere that does not have PHP accessible. Stupid &
> cheap of them, but true.
> I want to display a page within a page, WITHOUT using <?php ... ?> which
> won't work.
> 
> I tried stuff like:
> 
> <IFRAME SRC="http://www.somewhere.ca/test.php"; frameborder="no"
> border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no">
> </IFRAME>
> 
> Does not work of course.
> 
> Can I even do this?
> 
> 

--- End Message ---
--- Begin Message ---
You may also get better mileage in Netscape with the use of <OBJECT>.  Or,
if you're on Apache, good old server side includes (Apache SSI) may be
enough.

Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------



on 01/04/02 5:27 AM, Gary ([EMAIL PROTECTED]) wrote:

> <iframe src="http://foo.com"; name="MyFrame" id="MyFrame" width="400"
> height="300" marginwidth="0" marginheight="0" scrolling="no"
> frameborder="0"></iframe>
> 
> You need to give a height. NN4 does not support iframe
> 
> Gary
> 
> Jtjohnston wrote:
> 
>> I suppse this is an HTML question more than PHP.
>> I have a server elsewhere that does not have PHP accessible. Stupid &
>> cheap of them, but true.
>> I want to display a page within a page, WITHOUT using <?php ... ?> which
>> won't work.
>> 
>> I tried stuff like:
>> 
>> <IFRAME SRC="http://www.somewhere.ca/test.php"; frameborder="no"
>> border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no">
>> </IFRAME>
>> 
>> Does not work of course.
>> 
>> Can I even do this?
>> 
>> 
> 

--- End Message ---
--- Begin Message ---
I know I just wanna say that I use both these two switches...just borded to
write them again

--enable-module=ssl
--enable-module=so


--
~~~~~~~~~~~~~~~~

Sapilas@/dev/pinkeye

~~~~~~~~~~~~~~~~
"Septic Flesh" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I download apache 1.3.24 + php 4.1.2 + mod_ssl-2.8.8-1.3.24
>
> $ compile all
>
> $install all (not php yet)
>
> apache runs ok with or without ssl
>
> then compile php and install it..
>
> I get an error cannot load shared library libphp4.so....
>
> y ? I compile apache -enablemodule-ssl/so
> what I miss out and I get that
>
> cannot load shared library libphp4.so..
>
> file exists . . in the directory that apache reads it but . . .what is
wrong
> ?
>
>
> Thanks..
>
>
>
> --
> ~~~~~~~~~~~~~~~~
>
> Sapilas@/dev/pinkeye
>
> ~~~~~~~~~~~~~~~~
>
>


--- End Message ---
--- Begin Message ---
Dear Sir,

We are choosing some tools for building applications. Php is a very good tools to 
build web applications, but we don't know if it can generate printable 
reports. "Printable reports" mean the report you can print what you see on screen 
(like winword). 

We are asking if at here, there are good solutions to generate reports. Simply 
generate html files and print them are not good solutions to us, becuase you have 
to remove header / footer of html files, and html files seems not to be used for 
printing.

We know we can use pdflib to generate pdf files, but it is very expensive.... (at 
least US $1,000) .

If there are no other ways, we will be forced to use the old client-server approach 
again because printing report is very important to us. 


Many thanks!!!

Boris




---------------------------------------------------------------------------
PLEASE READ: The information contained in this e-mail is confidential and 
intended for the named recipient(s) only. If you are not an intended 
recipient of this e-mail you must not copy, distribute or take any further
action in reliance upon it and you should delete it and notify the sender 
immediately. E-mail is not a secure method of communication. GuruBase 
Technology Limited cannot accept responsibility for the accuracy or 
completeness of this message or any attachment(s). This transmission could 
contain viruses, be corrupted, destroyed, incomplete, intercepted, lost or 
arrive late. If verification of this e-mail is sought then please request 
a hard copy. Unless otherwise stated any views or opinions presented are 
solely those of the author and do not represent those of GuruBase Technology 
Limited. This e-mail is intended for information purposes only.
--- End Message ---
--- Begin Message ---
This can be done easily...

And since when does PDFLIB cost money? I thought it was free...

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, March 31, 2002 2:02 PM
Subject: [PHP] ask for suggestion about printing


> Dear Sir,
>
> We are choosing some tools for building applications. Php is a very good
tools to
> build web applications, but we don't know if it can generate printable
> reports. "Printable reports" mean the report you can print what you see on
screen
> (like winword).
>
> We are asking if at here, there are good solutions to generate reports.
Simply
> generate html files and print them are not good solutions to us, becuase
you have
> to remove header / footer of html files, and html files seems not to be
used for
> printing.
>
> We know we can use pdflib to generate pdf files, but it is very
expensive.... (at
> least US $1,000) .
>
> If there are no other ways, we will be forced to use the old client-server
approach
> again because printing report is very important to us.
>
>
> Many thanks!!!
>
> Boris
>
>
>
>
> --------------------------------------------------------------------------
-
> PLEASE READ: The information contained in this e-mail is confidential and
> intended for the named recipient(s) only. If you are not an intended
> recipient of this e-mail you must not copy, distribute or take any further
> action in reliance upon it and you should delete it and notify the sender
> immediately. E-mail is not a secure method of communication. GuruBase
> Technology Limited cannot accept responsibility for the accuracy or
> completeness of this message or any attachment(s). This transmission could
> contain viruses, be corrupted, destroyed, incomplete, intercepted, lost or
> arrive late. If verification of this e-mail is sought then please request
> a hard copy. Unless otherwise stated any views or opinions presented are
> solely those of the author and do not represent those of GuruBase
Technology
> Limited. This e-mail is intended for information purposes only.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

> This can be done easily...
>
> And since when does PDFLIB cost money? I thought it was free...

    http://www.pdflib.com/pdflib/business.html
    I'm guessing they need multiple CPU and the PDI - which costs money.

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin    .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.


--- End Message ---
--- Begin Message ---
On Mon, 1 Apr 2002 [EMAIL PROTECTED] wrote:
> We are choosing some tools for building applications. Php is a very good
> tools to build web applications, but we don't know if it can generate
> printable reports. "Printable reports" mean the report you can print
> what you see on screen (like winword).
> 
> We are asking if at here, there are good solutions to generate reports.
> Simply generate html files and print them are not good solutions to us,
> becuase you have to remove header / footer of html files, and html files
> seems not to be used for printing.
> 
> We know we can use pdflib to generate pdf files, but it is very
> expensive.... (at least US $1,000) .

In the past I've used RTF for this. Call header('Content-Type: 
application/rtf') and then just spit out RTF text.

The format is pretty simple; set up a sample file in your word processor
(the older the word processor you use, the better, since they're less
likely to clutter the file with the reams of clutter than new MS apps dump
into everything they write out; I used MS Word 4.0 as my guide) using the
various features you need, save it as RTF, look at it in a text editor,
repeat a few times, and you should have it mastered within an afternoon.

Many word processors can read it, it's much less work than a PDF, and it's
particularly well-suited for tabular data like reports. You can't get the
same level of graphical prettiness than you can with a PDF, but if you
just need something flexible and easy to work with that almost everyone 
can open/read, it's a good way to go.

miguel

--- End Message ---
--- Begin Message ---
thanx!

"Hugh Bothwell" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a map of the world with all countries. I have
> > 250 maps of the same size as png where only one
> > country is black, rest is transp.
> > Now I neeed to set this country color to blue or red
> > to indicate a special spot.
> > I just don't want to save the same map double or tripple.
>
> Good!  Makes much more sense.
>
> Call this like
> <img src='country.php?cty=germany&col=255,0,0'>
> (functions in bold you will have to write yourself)
> ====== country.php ===========
> <?php
>     Header("Content-type: image/png");
>     $mapURL = '\images\countrymask\'.MAKESAFE($cty);
>
>     // load image
>     $img = ImageCreateFromPNG($mapURL.$mapname)
>         or MAKEDEFAULTIMAGE();
>
>     // parse new desired color
>     $newcolor = split(',', $col);
>
>     // find black
>     $oldcolor = ImageColorResolve($img, 0, 0, 0);
>
>     // change to new color
>     ImageColorSet($img, $oldcolor, $newcolor[0], $newcolor[1],
> $newcolor[2]);
>
>     // ... and return result
>     ImagePNG($img);
> ?>
>
> Note that depending on how much this gets used,
> it may indeed be better (faster, less computationally
> intensive) in the long run to use multiple image
> copies, ie country_red.png, country_blu.png etc.
>
>


--- End Message ---
--- Begin Message ---
See attached file.
-Stathis.

Boaz Yahav wrote:
> 
> Hi
> 
> I need a function that will get a date in the past and return how much
> time has passed since that date till now.
> The input to the function is a MySQL DATETIME format and the output
> should be something like :
> 
> 2 Years, 36 Days, 7 hours , 25 minutes
> 
> I would write it but I'm pretty sure it has been done.
> 
> thanks
> 
> Sincerely
> 
>       berber
> 
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
<?

//
// modified by [EMAIL PROTECTED], 2000/10/01
// original: Scott Sinclair ([EMAIL PROTECTED]) submitted at www.zend.com
//
// $Id: sec2hms.php,v 1.8 2000/12/04 20:55:52 rouvas Exp $
// $Revision: 1.8 $
//
// Convert $num_secs to Hours:Minutes:Seconds 

function sec2hms($num_secs) {
  $str = '';

  $hours = intval(intval($num_secs) / 3600); 
  $str .= $hours.':'; 

  $minutes = intval(((intval($num_secs) / 60) % 60));
  if ($minutes < 10) $str .= '0'; 
  $str .= $minutes.':'; 

  $seconds = intval(intval(($num_secs % 60)));
  if ($seconds < 10) $str .= '0'; 
  $str .= $seconds;
  
  return($str);
}

?>

--- End Message ---
--- Begin Message ---
Hi All,
was just wondering if anybody had any comments on
web-x.com hosting services. Good/bad, reliable/not,
up-time? support? etc...
Thanks,
Heidi

=====
Heidi Belal
www.code-corner.com
ICQ# 32127109

A bus stops at a bus station.
A train stops at a train station.  On my desk
I have a work station...

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/
--- End Message ---
--- Begin Message ---
I'm trying to start a session, and I get this error.

I have been told its something to do with a missing dir is my php dir?

Warning: open(1\sess_0513b5c5d7021f1acdcf9f732032081f, O_RDWR) failed: No such file or 
directory (2) in Unknown on line 0


Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012
--- End Message ---
--- Begin Message ---
Philip J. Newman wrote:
> I'm trying to start a session, and I get this error.
> 
> I have been told its something to do with a missing dir is my php dir?
> 
> Warning: open(1\sess_0513b5c5d7021f1acdcf9f732032081f, O_RDWR) failed: No such file 
>or directory (2) in Unknown on line 0
> 

You have invalid session.save_path

--
Yasuo Ohgaki

--- End Message ---
--- Begin Message ---
so it should be

session.save_path = c:\php\temp

at the moment it says

session.save_path = 1

----- Original Message -----
From: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "Philip J. Newman" <[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 2:16 PM
Subject: Re: Newman Says: Error when starting sessions.


> Philip J. Newman wrote:
> > I'm trying to start a session, and I get this error.
> >
> > I have been told its something to do with a missing dir is my php dir?
> >
> > Warning: open(1\sess_0513b5c5d7021f1acdcf9f732032081f, O_RDWR) failed:
No such file or directory (2) in Unknown on line 0
> >
>
> You have invalid session.save_path
>
> --
> Yasuo Ohgaki
>
>
>



--- End Message ---
--- Begin Message ---

"Alain Kumschick FrançOis Robert" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>     Hello,
>
> I need a php script that checks if the there is a cookie set with the
users
> username
> and if not
> it brings you to an other page and telling you that you are not loged in!
>
> thanks for any help
>
>
> alain kumschick
> [EMAIL PROTECTED]
> http://www.kumschicknw.com
>
>
//simply chech the username as a cookie
if(!isset($HTTP_COOKIE_VARS["username"])
{
    header("Location: loginerror.php"); //no cookie forward to the
loginerror.php
}
else
{
    //cookie exists. you should check whether the username is valid. besides
your code is going here
}


-----------------------------
martina.


--- End Message ---
--- Begin Message ---
Is it possible to call an external program via PHP. The program will most
probably be in server.

My aim is to call a scanner input program and want the client to scan a
paper and upload it.

thanks for help.
--------------------
martina.


--- End Message ---
--- Begin Message ---
Martina,

If you mean, from within a browser, is it possible to invoke a program on a
client's machine then...yes,  with a caveat.  If the OS is windows, and the
program has a COM interface and the user has set the security settings to a
moronically low level, it is possible to invoke COM objects via either
VBScript or JavaScript. (JSrcipt).

It's not a good idea. From your side, since you have little or no control
over it. From the users side, they have to lower their security settings to
allow you to do it.  Users who know that means won't want to. Those who
don't will require a lot of hand holding.

My $.02 worth. Hope you found an answer somewhere among the rant.  :)

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: martinahingis [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 6:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Is it possible to call an external client or server
program?


Is it possible to call an external program via PHP. The program will most
probably be in server.

My aim is to call a scanner input program and want the client to scan a
paper and upload it.

thanks for help.
--------------------
martina.



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


--- End Message ---
--- Begin Message ---
hmm..
very thanks Cal.

I don't have any problem with security settings or another client side
setting. Because actually I'm using PHP for an application (but not a web
application) just works for the machine which is the server or in the same
LAN with the werver. And all settings of their browsers are made by me. So
that i can make all settings  proper to do so. Also OS is win98 or maybe
win2000. Most scanner's user interfaces can absolutely do their job perfect
on scanning and sending the output to the caller. But the only problem here
I understand is that it's not possible to call an EXE file?


"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Martina,
>
> If you mean, from within a browser, is it possible to invoke a program on
a
> client's machine then...yes,  with a caveat.  If the OS is windows, and
the
> program has a COM interface and the user has set the security settings to
a
> moronically low level, it is possible to invoke COM objects via either
> VBScript or JavaScript. (JSrcipt).
>
> It's not a good idea. From your side, since you have little or no control
> over it. From the users side, they have to lower their security settings
to
> allow you to do it.  Users who know that means won't want to. Those who
> don't will require a lot of hand holding.
>
> My $.02 worth. Hope you found an answer somewhere among the rant.  :)
>
> =C=
>
> *
> * Cal Evans
> * Journeyman Programmer
> * Techno-Mage
> * http://www.calevans.com
> *
>
>
> -----Original Message-----
> From: martinahingis [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 31, 2002 6:26 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is it possible to call an external client or server
> program?
>
>
> Is it possible to call an external program via PHP. The program will most
> probably be in server.
>
> My aim is to call a scanner input program and want the client to scan a
> paper and upload it.
>
> thanks for help.
> --------------------
> martina.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
If you are running a PHP script (like a shell script or a batch file) then
you can use the back tiks (`) to execute a command on the machine that the
PHP script is running on. (On my keyboard the backtik is on the same key as
the tilde.)

But if you are running this out of a web server then not really. Since the
PHP never gets executed on the client machine. The best you could hope for
was a JavaScript/VBScript solution. Of the two, I'd look hardest at VBscript
since M$ likes it better.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: martinahingis [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 7:05 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Is it possible to call an external client or server
program?


hmm..
very thanks Cal.

I don't have any problem with security settings or another client side
setting. Because actually I'm using PHP for an application (but not a web
application) just works for the machine which is the server or in the same
LAN with the werver. And all settings of their browsers are made by me. So
that i can make all settings  proper to do so. Also OS is win98 or maybe
win2000. Most scanner's user interfaces can absolutely do their job perfect
on scanning and sending the output to the caller. But the only problem here
I understand is that it's not possible to call an EXE file?


"Cal Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Martina,
>
> If you mean, from within a browser, is it possible to invoke a program on
a
> client's machine then...yes,  with a caveat.  If the OS is windows, and
the
> program has a COM interface and the user has set the security settings to
a
> moronically low level, it is possible to invoke COM objects via either
> VBScript or JavaScript. (JSrcipt).
>
> It's not a good idea. From your side, since you have little or no control
> over it. From the users side, they have to lower their security settings
to
> allow you to do it.  Users who know that means won't want to. Those who
> don't will require a lot of hand holding.
>
> My $.02 worth. Hope you found an answer somewhere among the rant.  :)
>
> =C=
>
> *
> * Cal Evans
> * Journeyman Programmer
> * Techno-Mage
> * http://www.calevans.com
> *
>
>
> -----Original Message-----
> From: martinahingis [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 31, 2002 6:26 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is it possible to call an external client or server
> program?
>
>
> Is it possible to call an external program via PHP. The program will most
> probably be in server.
>
> My aim is to call a scanner input program and want the client to scan a
> paper and upload it.
>
> thanks for help.
> --------------------
> martina.
>
>
>
> --
> 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


--- End Message ---
--- Begin Message ---
In addition to oid2name mentioned, you might want to know
about system catalog schema.

It's explained in manual

http://www.postgresql.org/idocs/index.php?catalogs.html

--
Yasuo Ohgaki

Robert Abbate wrote:
> Greetings to all!
> 
> I have a webhosting company, and I'm trying to be able to use PHP to
> calculate each of my hosting customer's Postgres database disk usage. It
> doesn't seem as easy as MySQL (since MySQL uses the user name to store all
> their database files).
> 
> Does anyone know how I can calculate PostgreSQL disk space usage for each of
> my hosting user accounts?
> 
> It seems I'm going to have to find out how Postgres keeps track of which
> user's database name is and it's corresponding number (so far, I've been
> able to determin that Postges uses numbers instead of names).
> 
> Can anyone give me some insight?
> 
> Thanks!
> Robert
> 
> 


--- End Message ---
--- Begin Message ---
Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23 
on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5, 
and gcc 3.0.4.

I'm using a fairly simple script to take input from a form, and add it 
to a database.  The database has the following structure:
ID - mediumint(8), primary key, auto_increment
Added - date
Modified - timestamp(8)
Title - varchar(60)
Text - text

What's happening is whenever I try to add an article that has text with 
a size of over around 9 KB, the browser never finishes loading, and the 
article doesn't appear in the list.  When I hit the stop button on the 
browser, the article will then appear in the article list, but 
incomplete - it is always cut off at the same spot.

This sounds like some kind of buffer issue, but I've looked through all 
of the applicable settings that I could find in both my PHP and MySQL 
configuration files, and have found nothing.  Any ideas?  Thanks in 
advance.  To see the source code for this script, go to 
http://test.mvpsoft.com/add.txt .  Thanks in advance for any help!

--- End Message ---
--- Begin Message ---
Have you tried shaving the article off a couple of chrs before the last one
and seeing if the insert works? Also, what is the size limit on a MySQL TEXT
field?

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BLO
B

May give a hint.

=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Chris Snyder [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 3:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Issues with long SQL inserts


Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23
on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5,
and gcc 3.0.4.

I'm using a fairly simple script to take input from a form, and add it
to a database.  The database has the following structure:
ID - mediumint(8), primary key, auto_increment
Added - date
Modified - timestamp(8)
Title - varchar(60)
Text - text

What's happening is whenever I try to add an article that has text with
a size of over around 9 KB, the browser never finishes loading, and the
article doesn't appear in the list.  When I hit the stop button on the
browser, the article will then appear in the article list, but
incomplete - it is always cut off at the same spot.

This sounds like some kind of buffer issue, but I've looked through all
of the applicable settings that I could find in both my PHP and MySQL
configuration files, and have found nothing.  Any ideas?  Thanks in
advance.  To see the source code for this script, go to
http://test.mvpsoft.com/add.txt .  Thanks in advance for any help!


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


--- End Message ---
--- Begin Message ---
Cal Evans wrote:

>Have you tried shaving the article off a couple of chrs before the last one
>and seeing if the insert works? Also, what is the size limit on a MySQL TEXT
>field?
>
>http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BLO
>B
>
Thanks for the quick response.  I looked at the MySQL doc, and it didn't 
seem to offer any explanation.  The column type is text, with no limit, 
which theoretically should give me around 8 meg - I'm getting around 
8-9K.<g>  The docs say that memory might be a problem, but the server 
has 512 meg, with 40 meg free, and around 450 meg of swap - shouldn't be 
a problem.

>-----Original Message-----
>From: Chris Snyder [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, March 31, 2002 3:43 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Issues with long SQL inserts
>
>
>Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23
>on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5,
>and gcc 3.0.4.
>
>I'm using a fairly simple script to take input from a form, and add it
>to a database.  The database has the following structure:
>ID - mediumint(8), primary key, auto_increment
>Added - date
>Modified - timestamp(8)
>Title - varchar(60)
>Text - text
>
>What's happening is whenever I try to add an article that has text with
>a size of over around 9 KB, the browser never finishes loading, and the
>article doesn't appear in the list.  When I hit the stop button on the
>browser, the article will then appear in the article list, but
>incomplete - it is always cut off at the same spot.
>
>This sounds like some kind of buffer issue, but I've looked through all
>of the applicable settings that I could find in both my PHP and MySQL
>configuration files, and have found nothing.  Any ideas?  Thanks in
>advance.  To see the source code for this script, go to
>http://test.mvpsoft.com/add.txt .  Thanks in advance for any help!
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--- End Message ---
--- Begin Message ---
I'm not up on the exact spec on MySQL but if it has an 'unlimited' text type
then it is a rarity among SQL engines.  M$SQL's limit is (used to be?) 8MB
in a single text field.

FoxPro/dBase had an unlimited text field but that's not so must a SQL engine
as a file format.

My guess is that you are banging your head against the upper limit.  I did
notice that it has a BIGTEXT type.  Maybe try that.  It still won't solve
the problem but it may give you more room.

HTH,
=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Chris Snyder [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 4:45 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Issues with long SQL inserts


Cal Evans wrote:

>Have you tried shaving the article off a couple of chrs before the last one
>and seeing if the insert works? Also, what is the size limit on a MySQL
TEXT
>field?
>
>http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BL
O
>B
>
Thanks for the quick response.  I looked at the MySQL doc, and it didn't
seem to offer any explanation.  The column type is text, with no limit,
which theoretically should give me around 8 meg - I'm getting around
8-9K.<g>  The docs say that memory might be a problem, but the server
has 512 meg, with 40 meg free, and around 450 meg of swap - shouldn't be
a problem.

>-----Original Message-----
>From: Chris Snyder [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, March 31, 2002 3:43 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Issues with long SQL inserts
>
>
>Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23
>on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5,
>and gcc 3.0.4.
>
>I'm using a fairly simple script to take input from a form, and add it
>to a database.  The database has the following structure:
>ID - mediumint(8), primary key, auto_increment
>Added - date
>Modified - timestamp(8)
>Title - varchar(60)
>Text - text
>
>What's happening is whenever I try to add an article that has text with
>a size of over around 9 KB, the browser never finishes loading, and the
>article doesn't appear in the list.  When I hit the stop button on the
>browser, the article will then appear in the article list, but
>incomplete - it is always cut off at the same spot.
>
>This sounds like some kind of buffer issue, but I've looked through all
>of the applicable settings that I could find in both my PHP and MySQL
>configuration files, and have found nothing.  Any ideas?  Thanks in
>advance.  To see the source code for this script, go to
>http://test.mvpsoft.com/add.txt .  Thanks in advance for any help!
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>




--- End Message ---
--- Begin Message ---
Cal Evans wrote:

>Have you tried shaving the article off a couple of chrs before the last one
>and seeing if the insert works? Also, what is the size limit on a MySQL TEXT
>field?
>
>http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#BLO
>B
>
>May give a hint.
>
I tried shaving off the article to the size that it truncated it to on 
its own, and the add worked fine.  It seems to be a concrete limit of 
about 8-9K.

>-----Original Message-----
>From: Chris Snyder [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, March 31, 2002 3:43 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Issues with long SQL inserts
>
>
>Server is running PHP 4.1.2, APC 1.1.0pl1, MySQL 3.23.47, Apache 1.3.23
>on a built-from-scratch Linux system with kernel 2.4.17, glibc 2.2.5,
>and gcc 3.0.4.
>
>I'm using a fairly simple script to take input from a form, and add it
>to a database.  The database has the following structure:
>ID - mediumint(8), primary key, auto_increment
>Added - date
>Modified - timestamp(8)
>Title - varchar(60)
>Text - text
>
>What's happening is whenever I try to add an article that has text with
>a size of over around 9 KB, the browser never finishes loading, and the
>article doesn't appear in the list.  When I hit the stop button on the
>browser, the article will then appear in the article list, but
>incomplete - it is always cut off at the same spot.
>
>This sounds like some kind of buffer issue, but I've looked through all
>of the applicable settings that I could find in both my PHP and MySQL
>configuration files, and have found nothing.  Any ideas?  Thanks in
>advance.  To see the source code for this script, go to
>http://test.mvpsoft.com/add.txt .  Thanks in advance for any help!
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--- End Message ---
--- Begin Message ---
Cal Evans wrote:

>I'm not up on the exact spec on MySQL but if it has an 'unlimited' text type
>then it is a rarity among SQL engines.  M$SQL's limit is (used to be?) 8MB
>in a single text field.
>
>FoxPro/dBase had an unlimited text field but that's not so must a SQL engine
>as a file format.
>
>My guess is that you are banging your head against the upper limit.  I did
>notice that it has a BIGTEXT type.  Maybe try that.  It still won't solve
>the problem but it may give you more room.
>
Well, not strictly unlimited, but it basically is for my purpose - 
according to the manual, it's 65535 chars - I'm at around 8000-9000 
right now, much lower than the limit.  I tried going to mediumtext - 
limit of 16777215, and it acts the same.  Both are quite a bit above 
what I'm trying to do.

--- End Message ---
--- Begin Message ---
Sorry, I've reached the end of my tech-support flow-chart.  You might want
to try 2 things:

1: Fire up the MySQL client of choice and do the insert manually.  If it
works there.  If it does then at least you've isolated the problem to PHP or
your script.  If not then you've eliminated your script and PHP form the
list.

2: post the question, along with the results from the above experiment and
any other relevant information to the mysql list. (www.mysql.com if you are
not a member, there;s info on joining there)  My guess is that it's a MySQL
problem and there are people there who could help you better than I.

Sorry I wasn't more help,
=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Chris Snyder [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 5:06 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Issues with long SQL inserts


Cal Evans wrote:

>I'm not up on the exact spec on MySQL but if it has an 'unlimited' text
type
>then it is a rarity among SQL engines.  M$SQL's limit is (used to be?) 8MB
>in a single text field.
>
>FoxPro/dBase had an unlimited text field but that's not so must a SQL
engine
>as a file format.
>
>My guess is that you are banging your head against the upper limit.  I did
>notice that it has a BIGTEXT type.  Maybe try that.  It still won't solve
>the problem but it may give you more room.
>
Well, not strictly unlimited, but it basically is for my purpose -
according to the manual, it's 65535 chars - I'm at around 8000-9000
right now, much lower than the limit.  I tried going to mediumtext -
limit of 16777215, and it acts the same.  Both are quite a bit above
what I'm trying to do.


--- End Message ---
--- Begin Message ---
Cal Evans wrote:

>Sorry, I've reached the end of my tech-support flow-chart.  You might want
>to try 2 things:
>
>1: Fire up the MySQL client of choice and do the insert manually.  If it
>works there.  If it does then at least you've isolated the problem to PHP or
>your script.  If not then you've eliminated your script and PHP form the
>list.
>
I altered the add.php script to print the query to screen instead of 
sending it to MySQL to try this.  It still acted the same, regardless of 
whether it was sending it to the MySQL server or printing it.  In fact, 
it even had the same reaction when I commented out the print command as 
well.  This appears to be something in the form-handling of PHP.  Any 
ideas now?  Thanks for all your help.

>
>2: post the question, along with the results from the above experiment and
>any other relevant information to the mysql list. (www.mysql.com if you are
>not a member, there;s info on joining there)  My guess is that it's a MySQL
>problem and there are people there who could help you better than I.
>
Well, I guess I won't do that now - MySQL seems to not be the culprit.


--- End Message ---
--- Begin Message ---
Wow!  Nope, I'm stumped now. It does seem to be a problem with PHP handing
large blocked of text but as I've personally posted 8k of test from a form
into a text field I'll be dogged if I know what's happening. Any possibility
that it's a quotes problem?  If you view the source, is there a PHP error
masked by an HTML tag in there? (grasping at straws here)

=C=


*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Chris Snyder [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 5:22 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Issues with long SQL inserts


Cal Evans wrote:

>Sorry, I've reached the end of my tech-support flow-chart.  You might want
>to try 2 things:
>
>1: Fire up the MySQL client of choice and do the insert manually.  If it
>works there.  If it does then at least you've isolated the problem to PHP
or
>your script.  If not then you've eliminated your script and PHP form the
>list.
>
I altered the add.php script to print the query to screen instead of
sending it to MySQL to try this.  It still acted the same, regardless of
whether it was sending it to the MySQL server or printing it.  In fact,
it even had the same reaction when I commented out the print command as
well.  This appears to be something in the form-handling of PHP.  Any
ideas now?  Thanks for all your help.

>
>2: post the question, along with the results from the above experiment and
>any other relevant information to the mysql list. (www.mysql.com if you are
>not a member, there;s info on joining there)  My guess is that it's a MySQL
>problem and there are people there who could help you better than I.
>
Well, I guess I won't do that now - MySQL seems to not be the culprit.



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


--- End Message ---
--- Begin Message ---
On Monday 01 April 2002 07:22, Chris Snyder wrote:


> I altered the add.php script to print the query to screen instead of
> sending it to MySQL to try this.  It still acted the same, regardless of
> whether it was sending it to the MySQL server or printing it.  In fact,
> it even had the same reaction when I commented out the print command as
> well.  This appears to be something in the form-handling of PHP.  Any
> ideas now?  Thanks for all your help.

Are you using POST or GET for your form? Both have a limit on how much data 
you can send with GET having a lower limit than POST. So if you were using 
GET then try using POST. Both limits are, I think, browser dependent.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
What's another word for "thesaurus"?
                -- Steven Wright
*/
--- End Message ---
--- Begin Message ---
Here is a portion of a work in progress, I tested by sending the script with
a payment status of incomplete yet it still executed other portions of the
code. Should it not have jumped out.  Or is my nested if invalid for some
reason?

if ($payment_status = "Completed")
{
echo "1st if is passed<br>";
// check that txn_id has not been previously processed

$db_conn = mysql_connect("localhost:/var/lib/mysql/mysql.sock", "apache",
"xxx");
  mysql_select_db("telnetlabs", $db_conn);
  $query = "select pp_txn_id from orders "
           ."where pp_txn_id ='.$txn_id.' ";
  $result = mysql_query($query, $db_conn);
  echo "This is the result of 1st query<br>";
  echo $result;
  echo "<br>";
  $num_results = mysql_num_rows($result);
  echo $num_results;

if ($num_results)
{
}
else {

  echo "2nd if is passed<br>";
  $query = "select cust_email from customers "
           ."where cust_email = '$payer_mail' ";
  $result = mysql_query($query, $db_conn);
  $num_results = mysql_num_rows($result);

if ($num_results)
{
}
else
{
echo "3rd if is passed<br>";
$item_name=addslashes($item_name);
$receiver_email=addslashes($receiver_email);
$item_number=addslashes($item_number);
$invoice=addslashes($invoice);
$payment_status=addslashes($payment_status);
$payment_gross=addslashes($payment_gross);
$txn_id=addslashes($txn_id);
$payer_email=addslashes($payer_email);
$payer_status=addslashes($payer_status);
$first_name=addslashes($first_name);
$last_name=addslashes($last_name);
$address_status=addslashes($address_status);
$address_street=addslashes($address_street);
$address_city=addslashes($address_city);
$address_state=addslashes($address_state);
$address_country=addslashes($address_country);
echo $first_name;
echo $last_name;
echo $address_street;
echo $address_city;
echo $address_state;
echo $address_status;
echo $address_zip;
echo $payer_status;
echo $item_name;
echo $receiver_email;
echo $item_number;
echo $invoice;
echo $payment_status;
echo $address_country;

//$query = "insert into customers values ('"null"', '".$first_name."',
'".$last_name."', '".$address_street."', '".$address_city."' ,
'".$address_state."', '".$address_status."', '".$payer_email."' ,
'".$payer_status."', '".$payer_email."' , '".$txn_id."', '"1"')";
// check that receiver_email is an email address in your PayPal account
// check that payer_email doesn't already exist in customer database
// if exist, increment customer.balanace by 1
// if not exist, create user and increment balance by 1
// then send schedule email with userid and password
// process payment
// first stab does none of the processes above, just emails the customer and
us for testing
mail ("[EMAIL PROTECTED]", "order info", trim($mailcontent), "From:
[EMAIL PROTECTED]", "[EMAIL PROTECTED]");
mail ($payer_email, "Your Order", $custconfirmation, "From:
[EMAIL PROTECTED]", "[EMAIL PROTECTED]");
}
}
}
?>


--- End Message ---
--- Begin Message ---
So can u tell me how to complie one module only ?
as i am thinkg to complie that module on my local machine [Linux] and then
upload to the server.

Bye, Have a nice day.

Prachait

If you do for other's !
Other's will do for you !!

Visit me at http://www.sitesontesting.com/prachait
----- Original Message -----
From: Rouvas Stathis <[EMAIL PROTECTED]>
Newsgroups: php.general
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 8:46 PM
Subject: Re: [PHP] where i get .so [dll] file of linux ?


> You should ask your administrator to do it for you.
> BTW, most propably you don't have to recompile Apache.
>
> -Stathis.


--- End Message ---
--- Begin Message ---
For example:

./configure --enable-ftp=shared
make

this will create modules/ftp.so

-Rasmus

On Mon, 1 Apr 2002, Prachait Saxena wrote:

> So can u tell me how to complie one module only ?
> as i am thinkg to complie that module on my local machine [Linux] and then
> upload to the server.
>
> Bye, Have a nice day.
>
> Prachait
>
> If you do for other's !
> Other's will do for you !!
>
> Visit me at http://www.sitesontesting.com/prachait
> ----- Original Message -----
> From: Rouvas Stathis <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, March 29, 2002 8:46 PM
> Subject: Re: [PHP] where i get .so [dll] file of linux ?
>
>
> > You should ask your administrator to do it for you.
> > BTW, most propably you don't have to recompile Apache.
> >
> > -Stathis.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Can someone explain to me the reason for using return.

function _getValue($foo)
        {
                $foo = $_POST;
                return ${$foo};
        }

TIA
Gary

--- End Message ---
--- Begin Message ---
Nope, that code makes no sense.  $_POST is an array containing the POST
variables.  You make a copy of that array an put it in $foo thereby
overwriting the passed in $foo.  Then you return $$foo which actually ends
up returning a variable named $Array.  It does not look like you have a
$Array variable in scope, and it is surely not what the misguided coder
behind this code was trying to achieve.  In short, this is completely
bogus.

-Rasmus

On Sun, 31 Mar 2002, Gary wrote:

> Can someone explain to me the reason for using return.
>
> function _getValue($foo)
>       {
>               $foo = $_POST;
>               return ${$foo};
>       }
>
> TIA
> Gary
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---

Reply via email to