OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 4 Dec 2003 21:55:46 -0000 Issue 2454

php-general-digest-helplists.php.net
Date: Thu Dec 04 2003 - 15:55:46 CST


php-general Digest 4 Dec 2003 21:55:46 -0000 Issue 2454

Topics (messages 171786 through 171900):

Re: SID problem
        171786 by: Wouter van Vliet
        171791 by: Binay
        171835 by: Marek Kilimajer

Re: File - Success Warning Message
        171787 by: Richard Davey
        171789 by: Richard Davey
        171790 by: David Otton

Execute a linux binary that generates a registration code...
        171788 by: Karam Chand
        171792 by: Sophie Mattoug

Re: New line problem - but for Excel
        171793 by: Sven

cookies
        171794 by: Maris Kalnins
        171870 by: Chris Shiflett

Re: preserving blank space padding when using fgetcsv
        171795 by: David Robley

Re: Variables scope question
        171796 by: Steve Fulleylove

Re: XML, strings and foreign (swedish/danish) characters
        171797 by: Victor Spång Arthursson
        171799 by: Victor Spång Arthursson

Problem with references
        171798 by: Terry
        171801 by: David Otton
        171862 by: Eduardo R. Maciel
        171867 by: Chris W. Parker
        171879 by: David Otton

Re: BLOB - PHP Peformance DB vs. Web server Opinions
        171800 by: Leendert
        171808 by: Jay Blanchard

open rtf in IE
        171802 by: Egil Berntsen
        171803 by: David Otton

Premature end of script headers: php.exe
        171804 by: Goran Ristic
        171813 by: David Otton
        171817 by: Marek Kilimajer

Re: copy_file() files
        171805 by: Jay Blanchard
        171832 by: Ajai Khattri
        171833 by: Jay Blanchard

Re: for help :how to detect norton client through php socket
        171806 by: Marek Kilimajer

[OT MySQL] Syntax for selecting within a range of time from database
        171807 by: Dave G
        171811 by: Jay Blanchard

related products, how to's best practices
        171809 by: Jon Bennett
        171810 by: Richard Davey
        171812 by: Jon Bennett
        171814 by: Richard Davey
        171815 by: Jon Bennett
        171816 by: Richard Davey
        171824 by: Justin French
        171834 by: Jon Bennett
        171840 by: Jon Bennett
        171842 by: Richard Davey
        171846 by: Matt Matijevich
        171864 by: Ajai Khattri
        171865 by: Chris W. Parker

CHMOD...
        171818 by: Tristan.Pretty.risk.sungard.com
        171819 by: Jay Blanchard
        171821 by: Sophie Mattoug
        171823 by: Marek Kilimajer
        171827 by: Jay Blanchard
        171831 by: Neil Freeman
        171849 by: Justin Patrin
        171856 by: Marek Kilimajer

How does one run PHP scripts in 'silent mode' ???
        171820 by: Keith
        171822 by: Jay Blanchard
        171825 by: Jay Blanchard
        171826 by: Sophie Mattoug
        171829 by: Jay Blanchard

How to display a "waiting page" while a CGI is running ?
        171828 by: Jean-Marc Godart
        171830 by: Jay Blanchard

What do you say to someone who says...
        171836 by: Daniel Pupius
        171838 by: Jay Blanchard
        171841 by: Brent Baisley
        171857 by: David Otton
        171858 by: Jay Blanchard
        171860 by: Cesar Cordovez
        171861 by: Ajai Khattri
        171863 by: Chris W. Parker
        171868 by: Cesar Cordovez
        171869 by: Chris W. Parker
        171871 by: Jay Blanchard
        171876 by: Chris Shiflett
        171881 by: Blake Schroeder
        171882 by: Rob Adams
        171884 by: Jay Blanchard
        171887 by: CPT John W. Holmes
        171888 by: Aaron Wolski
        171889 by: Chris Shiflett
        171890 by: Richard Davey
        171899 by: Cesar Cordovez

html stripping
        171837 by: php-general.mccullough-net.com

Changing User Agent for fopen
        171839 by: Gohaku
        171843 by: jon
        171845 by: Gerard Samuel

International Addresses and Telephones
        171844 by: Rankin, Randy
        171847 by: Sophie Mattoug
        171848 by: Richard Davey
        171851 by: Ajai Khattri
        171854 by: Mike

Overload of private atributes ?
        171850 by: Eduardo R. Maciel

DB / Tables Question
        171852 by: Pushpinder Singh Garcha
        171853 by: Richard Davey
        171855 by: Robert Sossomon

Re: Session Expiration Problem....
        171859 by: CF High

Re: replace %rand[x]-[y]% macro in string with random string
        171866 by: daniel hahler

PHP, MySQL and datetime
        171872 by: Jough Jeaux
        171874 by: Richard Davey
        171875 by: John

Showing absolute path in $_FILES
        171873 by: David Green

hmm.. anyone else get a "friendly" message from Kenneth Uzzi?!
        171877 by: Richard Davey
        171880 by: Jay Blanchard

accepting form data and store it in mysql and display the contents in a html form
        171878 by: ramesh konjeti

Losing Sessions.
        171883 by: Tony Crockford
        171898 by: Luke

Re: Invalid library (maybe not a PHP library)
        171885 by: Anas Mughal
        171891 by: Curt Zirzow
        171892 by: Anas Mughal

gd error with latest source install
        171886 by: Rob Yelvington

how to determine if shopping cart has been abandoned?
        171893 by: Chris W. Parker
        171894 by: Anas Mughal
        171895 by: Richard Davey
        171896 by: Eric Wood
        171897 by: Jay Blanchard

Exporting Data as CSV - IE6/HTTPS Problem?
        171900 by: Geoffrey Thompson

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


On donderdag 4 december 2003 10:53 Binay told the butterflies:
> Yes AllowOverride is set to None ....
>
> But then i can not change it as i don have access .. wht
> other method/solution i can look except ini_set then ??
>
> ----- Original Message -----
> From: "Wouter van Vliet" <mewoutervanvliet.nl>
> To: "'Binay'" <binayoliveinternet.com>; <php-generallists.php.net>
> Sent: Thursday, December 04, 2003 3:08 PM
> Subject: RE: [PHP] SID problem
>
>
> > On donderdag 4 december 2003 10:36 Binay told the butterflies:
> > > Hi everybody,
> > >
> > > I m trying to disable/off "session.use_trans_sid".
> > > I don have access to php.ini file... hence trying to unset in the
> > > php scripts and .htaccess file .
> > >
> > > While this works in php script i.e
> > > ini_set("session.use_trans_sid","0");
> > >
> > > but in .htaccess it seems it doesn't i.e php_flag
> > > session.use_trans_sid off ... This doesn't work..
> > >
> > > My .htaccess file contain only above statement and nothing else
> > > ...
> > >
> > > I can not go for ini_set as it needs to be done in all the file
> > > ... so .htaccess is the right solution for me .....
> > > but it doesn't work in .htaccess ...
> > >
> > > What may be the possible reason/causes??
> > >
> > > Please help me ..
> > >
> > > PHP 4.2.2
> > >
> > > Thanks in advance
> > >
> > > Binay
> >
> > Reason is possibly/most likely that "AllowOverride" is disabled on
> > the server.

I'm sorry, but there are no other options. You can, though, ask your hosting
provider to change the setting in the "httpd.conf" file for you. Or else I'd
advice you to create one file to include in all other files, which sets
global options.

< global.inc.php >
<?php
ini_set('session.use_trans_sid", '0');

// I've got my database connection settings and some other
// global calls also in this file.
?>

< any-other-file.php >
<?php
include('global.inc.php');

(.. the rest of your code ..)
?>

attached mail follows:


I have one more question.

Is it necessary to call ini_set before session_start()??
or any where in the scope of the script?
----- Original Message -----
From: "Wouter van Vliet" <mewoutervanvliet.nl>
To: "'Binay'" <binayoliveinternet.com>; <php-generallists.php.net>
Sent: Thursday, December 04, 2003 3:28 PM
Subject: RE: [PHP] SID problem

> On donderdag 4 december 2003 10:53 Binay told the butterflies:
> > Yes AllowOverride is set to None ....
> >
> > But then i can not change it as i don have access .. wht
> > other method/solution i can look except ini_set then ??
> >
> > ----- Original Message -----
> > From: "Wouter van Vliet" <mewoutervanvliet.nl>
> > To: "'Binay'" <binayoliveinternet.com>; <php-generallists.php.net>
> > Sent: Thursday, December 04, 2003 3:08 PM
> > Subject: RE: [PHP] SID problem
> >
> >
> > > On donderdag 4 december 2003 10:36 Binay told the butterflies:
> > > > Hi everybody,
> > > >
> > > > I m trying to disable/off "session.use_trans_sid".
> > > > I don have access to php.ini file... hence trying to unset in the
> > > > php scripts and .htaccess file .
> > > >
> > > > While this works in php script i.e
> > > > ini_set("session.use_trans_sid","0");
> > > >
> > > > but in .htaccess it seems it doesn't i.e php_flag
> > > > session.use_trans_sid off ... This doesn't work..
> > > >
> > > > My .htaccess file contain only above statement and nothing else
> > > > ...
> > > >
> > > > I can not go for ini_set as it needs to be done in all the file
> > > > ... so .htaccess is the right solution for me .....
> > > > but it doesn't work in .htaccess ...
> > > >
> > > > What may be the possible reason/causes??
> > > >
> > > > Please help me ..
> > > >
> > > > PHP 4.2.2
> > > >
> > > > Thanks in advance
> > > >
> > > > Binay
> > >
> > > Reason is possibly/most likely that "AllowOverride" is disabled on
> > > the server.
>
> I'm sorry, but there are no other options. You can, though, ask your
hosting
> provider to change the setting in the "httpd.conf" file for you. Or else
I'd
> advice you to create one file to include in all other files, which sets
> global options.
>
> < global.inc.php >
> <?php
> ini_set('session.use_trans_sid", '0');
>
> // I've got my database connection settings and some other
> // global calls also in this file.
> ?>
>
> < any-other-file.php >
> <?php
> include('global.inc.php');
>
> (.. the rest of your code ..)
> ?>
>
>

attached mail follows:


Before session_start()

Binay wrote:

> I have one more question.
>
> Is it necessary to call ini_set before session_start()??
> or any where in the scope of the script?
> ----- Original Message -----
> From: "Wouter van Vliet" <mewoutervanvliet.nl>
> To: "'Binay'" <binayoliveinternet.com>; <php-generallists.php.net>
> Sent: Thursday, December 04, 2003 3:28 PM
> Subject: RE: [PHP] SID problem
>
>
>
>>On donderdag 4 december 2003 10:53 Binay told the butterflies:
>>
>>>Yes AllowOverride is set to None ....
>>>
>>>But then i can not change it as i don have access .. wht
>>>other method/solution i can look except ini_set then ??
>>>
>>>----- Original Message -----
>>>From: "Wouter van Vliet" <mewoutervanvliet.nl>
>>>To: "'Binay'" <binayoliveinternet.com>; <php-generallists.php.net>
>>>Sent: Thursday, December 04, 2003 3:08 PM
>>>Subject: RE: [PHP] SID problem
>>>
>>>
>>>
>>>>On donderdag 4 december 2003 10:36 Binay told the butterflies:
>>>>
>>>>>Hi everybody,
>>>>>
>>>>>I m trying to disable/off "session.use_trans_sid".
>>>>>I don have access to php.ini file... hence trying to unset in the
>>>>>php scripts and .htaccess file .
>>>>>
>>>>>While this works in php script i.e
>>>>>ini_set("session.use_trans_sid","0");
>>>>>
>>>>>but in .htaccess it seems it doesn't i.e php_flag
>>>>>session.use_trans_sid off ... This doesn't work..
>>>>>
>>>>>My .htaccess file contain only above statement and nothing else
>>>>>...
>>>>>
>>>>>I can not go for ini_set as it needs to be done in all the file
>>>>>... so .htaccess is the right solution for me .....
>>>>>but it doesn't work in .htaccess ...
>>>>>
>>>>>What may be the possible reason/causes??
>>>>>
>>>>>Please help me ..
>>>>>
>>>>>PHP 4.2.2
>>>>>
>>>>>Thanks in advance
>>>>>
>>>>>Binay
>>>>
>>>>Reason is possibly/most likely that "AllowOverride" is disabled on
>>>>the server.
>>
>>I'm sorry, but there are no other options. You can, though, ask your
>
> hosting
>
>>provider to change the setting in the "httpd.conf" file for you. Or else
>
> I'd
>
>>advice you to create one file to include in all other files, which sets
>>global options.
>>
>>< global.inc.php >
>><?php
>>ini_set('session.use_trans_sid", '0');
>>
>>// I've got my database connection settings and some other
>>// global calls also in this file.
>>?>
>>
>>< any-other-file.php >
>><?php
>>include('global.inc.php');
>>
>>(.. the rest of your code ..)
>>?>
>>
>>
>

attached mail follows:


Hello [-^-!-%-,

Thursday, December 4, 2003, 9:54:31 AM, you wrote:

> $_html = implode('',file('http://myaddress.com'));

> Warning: Bad arguments to implode() in

> $_html is empty, even though the remote page exist and is working
> properly.

implode creates a string from an array. Your web page is not an array!
The "Bad arguments" warning is trying to tell you this. That is why
$_html is empty.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Hello [-^-!-%-,

Thursday, December 4, 2003, 9:54:31 AM, you wrote:

> $_html = implode('',file('http://myaddress.com'));

Sorry, just noticed you're bringing it back via file which (should)
convert it to an array. In which case the bad argument would be the
lack of a delimeter (the first value). Try setting it to \n or
something?

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


On Thu, 4 Dec 2003 01:54:31 -0800 (PST), you wrote:

>Warning: file("http://webmail.juicemarketing.net") - Success in

/me notes this is a pyramid scam site

Don't know about the rest of you... but there are some people I'd prefer
/not/ to do free consultancy for.

attached mail follows:


Hello

I have got an app wherein you need to pass a name as
the first parameter and it will output that is cout <<
a registraion code for my app based on the name.

I would like to give a web based interface wherein a
user can give his name on the form and I will be able
to generate the code from PHP.

I tried the commands - exec(), shell_exec() but none
seems to getting the output.

in the shell i execute it as - ./appname "karam"

the output is something like a223asas2323 ? How can i
get the output.

any ideas..

thanks in advance..

Karam

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

attached mail follows:


See www.php.net/passthru

Karam Chand wrote:

>Hello
>
>I have got an app wherein you need to pass a name as
>the first parameter and it will output that is cout <<
>a registraion code for my app based on the name.
>
>I would like to give a web based interface wherein a
>user can give his name on the form and I will be able
>to generate the code from PHP.
>
>I tried the commands - exec(), shell_exec() but none
>seems to getting the output.
>
>in the shell i execute it as - ./appname "karam"
>
>the output is something like a223asas2323 ? How can i
>get the output.
>
>any ideas..
>
>thanks in advance..
>
>Karam
>
>__________________________________
>Do you Yahoo!?
>Free Pop-Up Blocker - Get it now
>http://companion.yahoo.com/
>
>
>

attached mail follows:


David T-G schrieb:
> Manisha --
>
> ...and then Manisha Sathe said...
> %
> % Actually I do not have phpscript for this. I am using readymade function
> % from PHPMyAdmin 2.1.0. They are having option to export to csv file with
> % delimeter ';' (It comes on screen first and then i copy to file manually.)
>
> Ah.
>
>
> %
> % So my csv fil looks like
> %
> % 22;33;address line1
> % address line2

hi newsgroup,

maybe a quotation helps? i remember, the php-csv-export-functions have a
param for that. so if the results look like this:

22;33;"address line1
address line2"

the line-break isn't interpreted?

maybe someone can give it a try?

ciao SVEN

attached mail follows:


Let's assume that we have an html page where we plant a call
to cookie registering php script. This is done by
the following html line which is placed on that page
we would like to have cookies stats for:

<html>
...
<body>
..
<img nocache border=0 width=2 height=1
src=http://www.cookiedomain.com/cookies/cookies.php>
..
</body>

</html>

Php cookie registering script has the following
cookie set operation:

setcookie("test", 1, time() + 3600, "/", "");

The problem is that when executing HTML above, everything
works fine as long as page and php script are on
the same domain

But as soon as page is for example www.pagedomain.com and
cookie script is still on www.cookiedomain.com
No cookies are set no more.

My understanding is that with line
<img nocache border=0 width=2 height=1
src=http://www.synchrodat.com/sdcookies/cookies.php>
we simply execute php script the same way as it would be typed
in url line and executed, why there's a difference?

Could you share with your experience and point out where
is the problem here. I tried different variations for
domain parameter in setcookie command but it didnt help

Is this construction usable in this case with different
domains at all?

Thanks

attached mail follows:


--- Maris Kalnins <proximuse-teliamtc.lv> wrote:
> <img nocache border=0 width=2 height=1
> src=http://www.cookiedomain.com/cookies/cookies.php>

[snip]

> Php cookie registering script has the following
> cookie set operation:
>
> setcookie("test", 1, time() + 3600, "/", "");
>
>
> The problem is that when executing HTML above, everything
> works fine as long as page and php script are on the same
> domain
>
> But as soon as page is for example www.pagedomain.com and
> cookie script is still on www.cookiedomain.com No cookies
> are set no more.

Right, and this makes sense, if you think about it.

Actually, the cookie is set, but you can only set cookies for your own
domain, not someone else's. Thanks goodness, right? :-)

So, when the browser requests the resource
http://www.cookiedomain.com/cookies/cookies.php, the cookie is set within
that domain. When the browser requests a page at pagedomain.com, it is not
going to send cookies for cookiedomain.com. This is just how cookies work.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

attached mail follows:


In article <3FCE3429.7000606bgnet.bgsu.edu>, rogerbgnet.bgsu.edu says...
> Hello,
>
> I've been researching this for most of the day and am unable to find an
> answer.
>
> I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).
> I'm trying to create a PHP application which will read a csv file line
> by line, remove the commas and preserve the padding that is in each
> column. That means if a column is a fixed length of 15 characters and
> the actual text in that column is only 5 characters long, the
> application will preserve the extra 10 blank spaces.
>
> I'm able to open and read the csv using fgetcsv:
> $handle = fopen ($filename, "r");
> while ($mpt_line = fgetcsv ($handle, filesize ($filename), ","))
> {
> Then I check each member of that array to make sure it is the proper
> length for that column:
> if (strlen($mpt_line[0])<4)
> {
> str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT);
> }
> When all of the length checks are finished I remove the commas and then
> print out the finished product:
> }
> $no_commas = str_replace(",", "", $mpt_line);
> print "aa/".$no_commas[0]."/aa";
>
> For output all I get is the actual text and no blank space padding.
> Meaning that if the field contains two characters of data it should
> still appear 4 characters in length. I was hoping to achieve aa/hi /aa
> instead all I get is aa/hi/aa.

If you want to see multiple white space in the browser, you'll need to
surround the text with <PRE> tags. Browsers tend to ignore white space
(multiple spaces, tabs, EOL etc).

If you do a view source of your current output you will see the spaces.

Cheers
--
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

attached mail follows:


Mike,

It depends what you mean by local scope.

If you declare the variable as global, it should be available to the code
inside include1.txt and index.php. It will not be available to other pages
however (i.e. it is not session global). To create a truly global
(available to all pages in the site) variable, you should use a session
variable.

Regards,
Steve

"Mike D" <mikeawn.com> wrote in message news:BBF3B319.DEEB%mikeawn.com...
> Hello,
>
> I have recently noticed something that I wasn't aware of until now. I have
> index.php which contains include1.txt and include2.txt. If a variable is
set
> in include1.txt it will *only* have a local scope, even if I declare it
> GLOBAL. Is this normal or a bug?
>
> - MD
>
> ....................................
> Mike Dunlop
> AWN, Inc.
> // www.awn.com
> [ e ] webmasterawn.com
> [ p ] 323.606.4237

attached mail follows:


2003-12-03 kl. 11.18 skrev Victor Spång Arthursson:

> Temporarely solved the problem using substring to trim the crap-chars
> away, but I'ld prefer to solve it in a more beautiful way, but perhaps
> this behaviour is a bug and therefore not possible to solve in any
> other way…

But do we think it works when uploaded to the production server? No… It
runs php on Wintendo™ though, but shouldn't make any difference -
should it?

2 days just to apply a xsl-stylesheet on a xml file!? :(

If anyone successfully has succeeded doing this, please give me some
hints.

Sincerely

Victor

attached mail follows:


Here is the error message, that the code produces:

<http://tosti.dk/xml/error.php>

And here is a copy of the code:

<http://tosti.dk/xml/error.txt>

I really cant figure what is wrong, especially not since it works on
the dev-server and the outputted xml is valid, at least as far as IE
concerns…

Sincerely

Victor

attached mail follows:


I wonder if there is a simple techique to help me here. I wish to return 2
references to objects from a function.

The following code describes what I want to do but obviously will not work
(and I understand why):

function Test (&$P1, &$P2)
{
    $Object = new Thing();
    $P1 =& $Object;
    $P2 =& $Object->Property;
}

More generally is there a technique I can use for setting a referenced
variable to be a reference?

Thanks.
Terry

attached mail follows:


On Thu, 4 Dec 2003 11:16:10 -0000, you wrote:

>I wonder if there is a simple techique to help me here. I wish to return 2
>references to objects from a function.
>
>The following code describes what I want to do but obviously will not work
>(and I understand why):
>
>function Test (&$P1, &$P2)
>{
> $Object = new Thing();
> $P1 =& $Object;
> $P2 =& $Object->Property;
>}
>
>More generally is there a technique I can use for setting a referenced
>variable to be a reference?

Ok, the third line of that function is really weird. You're returning the
object anyway, so why would you want to return a property of the object? It
breaks encapsulation.

To return more than one item... have you considered simply returning an
array?

function f()
{
        return (array (7, 5));
}

list ($a, $b) = f();

I can't really see a benefit to passing in $P1 and $P2 at all, let alone by
reference... maybe you could go into more detail about what you're trying to
do? Why do you need to return a reference to the object, rather than the
object itself?

attached mail follows:


> On Thu, 4 Dec 2003 11:16:10 -0000, you wrote:
> >I wonder if there is a simple techique to help me
here. I wish to return
> 2
> >references to objects from a function.
> >
> >The following code describes what I want to do but
obviously will not
> work
> >(and I understand why):
> >
> >function Test (&$P1, &$P2)
> >{
> > $Object = new Thing();
> > $P1 =& $Object;
> > $P2 =& $Object->Property;
> >}

It probably is possible if , but IF AND ONLY IF your
property is encapsulated in another object. Try it is
possible for you.

But as David said, it looks a litle bit insane....
:-)

Att,
Eduardo R. Maciel

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

attached mail follows:


David Otton <mailto:phpmailjawbone.freeserve.co.uk>
    on Thursday, December 04, 2003 3:43 AM said:

> function f()
> {
> return (array (7, 5));
> }
>
> list ($a, $b) = f();

Hey cool! I never knew about that.

Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

attached mail follows:


On Thu, 4 Dec 2003 09:58:09 -0800, you wrote:

>David Otton <phpmailjawbone.freeserve.co.uk>
> on Thursday, December 04, 2003 3:43 AM said:
>
>> function f()
>> {
>> return (array (7, 5));
>> }
>>
>> list ($a, $b) = f();
>
>Hey cool! I never knew about that.

Yeah, compared with returning a pointer to an array of pointers to
structs... well, scripting languages make you lazy :)

But without some feedback, I have no idea whether it solved his problem or
not :(

attached mail follows:


"Ahbaid Gaffoor" <ahbaidatt.net> wrote in message
news:3FCEA806.30006att.net...
> Thanks to all who helped with my earlier questions on pulling BLOB data
> out of Oracle using PHP.
>
> I am however finding that performance is slow when downloading huge
> files from the database.
>
> A typical 2Meg GIF file being downloaded from Oracle via. PHP is taking
> about thirty seconds.
>
> Everything (database, web server, development box) are all on a 100
> Megabit Switched ethernet setup.
>
>
> 1) Are there any pitfalls or guidelines when working with BLOBs and web
> apps?
>
> 2) Is there any advice for or against storing images as blobs in a
> database? Or is it better to store them on the web server file system?
>
> So far I am finding the web server file system to be faster, but I tend
> to think that it is less manageable from a relational data perspective.
>
> thoughts?
>
> thanks
>
> Ahbaid

As 1) and 2) are closely related, I'll write the answer to both at once. The
only real advantage to storing files in BLOBs that I can think of is
replication. If your database is replicated over X amount of servers, you'd
have to write seperate procedures to replicate the images that go with the
database, as they are not stored in the DBMS. That can be quite annoying if
you consider all the issues that come with it (locking etc.). Application
logic (or, right, manageability) is another issue that jumps to mind
(especially when trying to write generic database handling stuff), but
minor, and often you can overcome that problem by abstracting filesystem
logic in its design. In some situations, it's simply impractical. Imagine a
page with thumbnails, where the data for the thumbnails has to be pulled
from database BLOBs. You'd have to have a seperate request to the database
for every thumbnail on the page, as you have to spit out different headers
for images (you'd get those <img src="get_my_darn_blob.php?recid=5"> a lot).
If you didn't store them in a BLOB, you could simply output the paths to the
images and they'd be fetched from the webserver's filesystem. Another
disadvantage is that doing a lot of updating operations on BLOB fields tends
to fragment your harddisk pretty fast. Another issue, as already mentioned,
is speed. While it should be said that speed depends on how the DBMS
optimizes the search operations thus will vary between database servers, it
is usually just faster to fetch a file directly from the filesystem without
interference of the DBMS. In high-traffic situations, you're likely to
notice the speed difference. There are probably more disadvantages, but this
is what I can come up with from the top of my head. So, if you must depend
on replication, that's a good reason to choose BLOBs for storage. In any
other case I'd suggest you don't.

Regards,

Leendert Brouwer
Freelance consultancy
http://www.daholygoat.com

attached mail follows:


[snip]
2) Is there any advice for or against storing images as blobs in a
database? Or is it better to store them on the web server file system?
[/snip]

Never store images as blobs, never. The read/write operation to the
database for these is expensive and unnecessary. Store a reference to
the image instead, which can be quickly and easily called.

Also, a 2Mb image file...even on an intranet this is just wrong unless
you have a need for high-res photos. If someone accessed this on a
dial-up it would cause them avery long wait indeed.

attached mail follows:


I generate and save a rtf file with php in my MySQL db. Is it possible to
open this file in IE?

thanks

/egil

attached mail follows:


On Thu, 4 Dec 2003 12:48:45 +0100, you wrote:

>I generate and save a rtf file with php in my MySQL db. Is it possible to
>open this file in IE?

Probably not; I doubt IE understands RTF documents.

You're probably asking how to make IE pass the document over to Word,
though. Try variations on

header ("Content-type: text/rtf");
header ("Content-Disposition: attachment; filename=myfile.rtf");

header ("Content-type: application/msword");

These may not be exactly the attributes you want... read

http://www.faqs.org/rfcs/rfc2183

and experiment. Maybe "inline" rather than "attachment" would do it; I'm not
really sure. Most people want to stop IE embedding Word, rather than
encourage it.

attached mail follows:


Hello,

I have a problem. When I start my PHP script, I get message "Premature end
of script headers: php.exe". How can I solve this problem?

attached mail follows:


On Thu, 4 Dec 2003 13:17:57 +0100 , you wrote:

>I have a problem. When I start my PHP script, I get message "Premature end
>of script headers: php.exe". How can I solve this problem?

Run from the command line, or via a webserver? IIS or Apache? CGI or Apache
module? Do all scripts throw the error, or just some? What about an empty
script? What error code is the webserver returning? What do your error logs
show?

(My guess is that Apache is complaining that PHP is misconfigured or can't
be found - maybe a bad ScriptAlias or Action line in httpd.conf. But you're
not giving us much to work with here.)

attached mail follows:


This is a common error with php/iis combination, google for the error
string to find possible solutions.

Goran Ristic wrote:

> Hello,
>
> I have a problem. When I start my PHP script, I get message "Premature end
> of script headers: php.exe". How can I solve this problem?
>

attached mail follows:


[snip]
> What is the chmod of those files/directories.
[/snip]

You had already stated the owner/group...I want to know what the
read/write permissions are. For 'nobody' to be able to write to a
directory that directory must be owned by 'nobody'

drw------- (chmod 600)

If the group is 'nobody' it must also have permission

drw-rw--- (chmod 660)

These are called absolute permissions and are oft misunderstood. The
first digit is the owner's permission, the second is the group's, and
the third is everyone else. Numbers range from 0 (no permissions) to 7
(read write and execute permissions).

In order to copy a file to a directory the 'person' must have write
permissions.

attached mail follows:


On Thu, Dec 04, 2003 at 06:21:05AM -0600, Jay Blanchard wrote:

> You had already stated the owner/group...I want to know what the
> read/write permissions are. For 'nobody' to be able to write to a
> directory that directory must be owned by 'nobody'
>
> drw------- (chmod 600)
>
> If the group is 'nobody' it must also have permission
>
> drw-rw--- (chmod 660)

Of course, user nobody had read/write permission and the group too.

> These are called absolute permissions and are oft misunderstood. The
> first digit is the owner's permission, the second is the group's, and
> the third is everyone else. Numbers range from 0 (no permissions) to 7
> (read write and execute permissions).
>
> In order to copy a file to a directory the 'person' must have write
> permissions.

As an administrator with 15 years experience of Unix, I think I understand
this! ;-)

Anyway, I solved my problem - I just needed to tweak open_base_dir in php.ini.

--
Aj.
Sys. Admin / Developer

attached mail follows:


[snip]
Of course, user nobody had read/write permission and the group too.

As an administrator with 15 years experience of Unix, I think I
understand
this! ;-)
[/snip]

Glad you solved your problem. Sorry for making an assumption about your
lack of knowledge or experience.

attached mail follows:


Why are you asking this on php list? You might want to do it in php, but
it's not a php problem. Ask the sofware vendor if it is possible.

lph wrote:
> why ? I manager a network including 2000 hosts, and i want to post the
> hosts ip and department not installing the norton client on our web page
> so i wonder to how to detect detect whether norton antivirus client are
> installed on the hosts through
> php socket????
>
> "Lph" <lphslof.com> дÈëÏûÏ¢ÐÂÎÅ:20031204073426.33695.qmailpb1.pair.com...
>
>>how can i detect whether norton antivirus client are installed on the
>
> hosts
>
>>through php socket ?
>
>

attached mail follows:


PHP Gurus,
        What I'm trying to accomplish can be done in PHP, but someone on
this list told me once that it's far more efficient to try and do as
much on the MySQL side as possible. But I'm not really enough of an SQL
guy to join an SQL list, so I hope I can be forgiven this posting here.
        I'm looking right now at mysql.com's online manual, at the date
and time functions page. I'm pretty sure it is describing the function I
need, but I can't quite understand how they describe the syntax.
        What I have is a table which contains a series of events which
have a field that specifies the date on which they occur. I have two
fields to specify the workshop. One is a date field, which specifies
year, month, and date. Then I have a separate time field for the start
time of the event, specifying hours and minutes.
        What I want to be able to do is select an event based on whether
or not the start time is within 3 days from now.
        What's got me confused are two things:
        1. How do I combine the two fields in one SQL query in order to
make a complete start time useful for comparing dates?
        2. I think INTERVAL is the command I want to use. Is what I'm
after something like the following (I put in question marks where I'm
not sure how that variable would be formed)?
        SELECT date(?) FROM table WHERE DATE_ADD(now(?), INTERVAL 72
HOURS)

--
Yoroshiku!
Dave G
mlautotelic.com

attached mail follows:


[snip]
        SELECT date(?) FROM table WHERE DATE_ADD(now(?), INTERVAL 72
HOURS)
[/snip]

careful of keywords

SELECT dateThing FROM table WHERE dateThing BETWEEN NOW() AND
DATE_ADD(NOW(), INTERVAL 72 HOUR)

attached mail follows:


Hi,

I'm currently working on my first e-commerce site and would like to
offer my client the option of adding, maybe 3, related products for
each product using the CMS I'm developing. I guess this would be much
like Amazon et all.

I don't think getting the info into the db will be a problem, what I
see as a problem is how an admin will select 3 out of 200+ products.
Obviously a drop down is a bad idea, but so would a alphabetical list.
has anyone got any insight into the best way to solve this.

Thanks,

Jon

jon bennett | jonjben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/

attached mail follows:


Hello Jon,

Thursday, December 4, 2003, 12:42:28 PM, you wrote:

JB> I don't think getting the info into the db will be a problem, what I
JB> see as a problem is how an admin will select 3 out of 200+ products.
JB> Obviously a drop down is a bad idea, but so would a alphabetical list.
JB> has anyone got any insight into the best way to solve this.

When they add the products in the first place, couldn't they put them
into groups? You could then code something to select 3 random products
out of the same group, they would, by their grouped nature, be
"related" and no-one has to admin anything.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


They are in groups (type, category) but the problem is the way their
products relate doesn't correspond to their type (book, video etc) or
their category (like Classic Books, Rewarding Social Skills etc) and
some products appear in more than one category as well.

Any other ideas ??

Thanks,

Jon

jon bennett | jonjben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/

On 4 Dec 2003, at 12:46, Richard Davey wrote:

> Hello Jon,
>
> Thursday, December 4, 2003, 12:42:28 PM, you wrote:
>
> JB> I don't think getting the info into the db will be a problem, what
> I
> JB> see as a problem is how an admin will select 3 out of 200+
> products.
> JB> Obviously a drop down is a bad idea, but so would a alphabetical
> list.
> JB> has anyone got any insight into the best way to solve this.
>
> When they add the products in the first place, couldn't they put them
> into groups? You could then code something to select 3 random products
> out of the same group, they would, by their grouped nature, be
> "related" and no-one has to admin anything.
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hello Jon,

Thursday, December 4, 2003, 12:59:17 PM, you wrote:

JB> They are in groups (type, category) but the problem is the way their
JB> products relate doesn't correspond to their type (book, video etc) or
JB> their category (like Classic Books, Rewarding Social Skills etc) and
JB> some products appear in more than one category as well.

Not much choice then - you have to present them an interface to all of
the products for them to select from. Alphabetical sorting perhaps,
with a small search field so they can search on product title perhaps,
or filter out specific categories.

You can't have them in a drop-down (well, technically you could, but
this isn't a PHP issue anymore, it's a user-interface one).

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Hi,

Why should I not use drop downs ?? are they generally out of favour now
?? why ???

I ask because I was thinking of having each categories products listed
in a drop down !

Thanks,

Jon

jon bennett | jonjben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/

On 4 Dec 2003, at 13:05, Richard Davey wrote:

> Hello Jon,
>
> Thursday, December 4, 2003, 12:59:17 PM, you wrote:
>
> JB> They are in groups (type, category) but the problem is the way
> their
> JB> products relate doesn't correspond to their type (book, video etc)
> or
> JB> their category (like Classic Books, Rewarding Social Skills etc)
> and
> JB> some products appear in more than one category as well.
>
> Not much choice then - you have to present them an interface to all of
> the products for them to select from. Alphabetical sorting perhaps,
> with a small search field so they can search on product title perhaps,
> or filter out specific categories.
>
> You can't have them in a drop-down (well, technically you could, but
> this isn't a PHP issue anymore, it's a user-interface one).
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hello Jon,

Thursday, December 4, 2003, 1:08:36 PM, you wrote:

JB> Why should I not use drop downs ?? are they generally out of favour now
JB> ?? why ???

Not at all.

JB> I ask because I was thinking of having each categories products listed
JB> in a drop down !

You said there were over 200 of them. Create a drop-down list with 200
options and view it in a browser. The phrase "pain in the ass to
select from" springs to mind. Besides, if you let them search they
could tick and add all 3 related at once.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


On Thursday, December 4, 2003, at 11:42 PM, Jon Bennett wrote:

> I'm currently working on my first e-commerce site and would like to
> offer my client the option of adding, maybe 3, related products for
> each product using the CMS I'm developing. I guess this would be much
> like Amazon et all.
>
> I don't think getting the info into the db will be a problem, what I
> see as a problem is how an admin will select 3 out of 200+ products.
> Obviously a drop down is a bad idea, but so would a alphabetical list.
> has anyone got any insight into the best way to solve this.

Why is a drop-down a bad idea? My only concerns would be

a) bloated code (200 options at 20 chars each = 4000 chars (4k?)
b) a long list to scroll through for the user
c) combo boxes wouldn't allow the user to choose the order of the three
related products -- you'd need 3 drop-down menu's for that :)

Perhaps it could be a series of drop-downs (CDs|Books|Videos or A-K|L-Z
etc)

The other solutions I have depend on your target market -- for a CMS in
a controlled environment and limited user group, you might be able to
get away with the following ideas:

1. Using CSS2's overflow property to create a little scrollable area.
Again, these could be broken into categories to make it easier for the
user.

<div style='height:50px; overflow:auto'>
<input type='checkbox' name='foo' value='1' />A product<br />
<input type='checkbox' name='foo' value='1' />A product<br />
<input type='checkbox' name='foo' value='1' />A product<br />
<input type='checkbox' name='foo' value='1' />A product<br />
...
<input type='checkbox' name='foo' value='1' />A product<br />
</div>

2. Javascript pop-up -- you could take this part of the process out of
the main window, and into a JS pop-up window which let's the user dig
through categories, do searches, WHATEVER to find each product. Then
some JS code on the pop-up could talk back to the main window and 'fill
in' 3 text-fields / hidden fields with the related product ID's /
descriptions / etc.

You'd need to know a fair bit about JS, or get some serious help here,
but IT CAN BE DONE.

Justin French

attached mail follows:


How about a dropdown for each category (max 25 products per cat I'd
think) with either a series of radio buttons or another dropdown to
determine the order of preference (1,2 or3), how would something like
that stand up to the user interface and usuability bods ??

Dang, that wouldn't work, because it would only give you the option to
add one product from each category, bugger! Could only do the above if
I repeated all the dropdowns for each cat 3 times!

How easy is it to change the content of a dropdown without page
refreshes ??? I could then have a dropdown for categories and a dynamic
dropdown for the products in that category, that would be much easier
to repeat.

Thanks,

Jon

jon bennett | jonjben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/

On 4 Dec 2003, at 14:02, Justin French wrote:

> On Thursday, December 4, 2003, at 11:42 PM, Jon Bennett wrote:
>
>> I'm currently working on my first e-commerce site and would like to
>> offer my client the option of adding, maybe 3, related products for
>> each product using the CMS I'm developing. I guess this would be much
>> like Amazon et all.
>>
>> I don't think getting the info into the db will be a problem, what I
>> see as a problem is how an admin will select 3 out of 200+ products.
>> Obviously a drop down is a bad idea, but so would a alphabetical
>> list. has anyone got any insight into the best way to solve this.
>
> Why is a drop-down a bad idea? My only concerns would be
>
> a) bloated code (200 options at 20 chars each = 4000 chars (4k?)
> b) a long list to scroll through for the user
> c) combo boxes wouldn't allow the user to choose the order of the
> three related products -- you'd need 3 drop-down menu's for that :)
>
> Perhaps it could be a series of drop-downs (CDs|Books|Videos or
> A-K|L-Z etc)
>
>
> The other solutions I have depend on your target market -- for a CMS
> in a controlled environment and limited user group, you might be able
> to get away with the following ideas:
>
> 1. Using CSS2's overflow property to create a little scrollable area.
> Again, these could be broken into categories to make it easier for the
> user.
>
> <div style='height:50px; overflow:auto'>
> <input type='checkbox' name='foo' value='1' />A product<br />
> <input type='checkbox' name='foo' value='1' />A product<br />
> <input type='checkbox' name='foo' value='1' />A product<br />
> <input type='checkbox' name='foo' value='1' />A product<br />
> ...
> <input type='checkbox' name='foo' value='1' />A product<br />
> </div>
>
> 2. Javascript pop-up -- you could take this part of the process out of
> the main window, and into a JS pop-up window which let's the user dig
> through categories, do searches, WHATEVER to find each product. Then
> some JS code on the pop-up could talk back to the main window and
> 'fill in' 3 text-fields / hidden fields with the related product ID's
> / descriptions / etc.
>
> You'd need to know a fair bit about JS, or get some serious help here,
> but IT CAN BE DONE.
>
>
> Justin French
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Would I be right in thinking that php alone can't change the content of
a dropdown once the browser has loaded the file without a page refresh
??? In which case I need to source out some javascript, anyone got
anything that might help me (code, tute, urls etc) as I'm not having
much luck with google ??

Thanks,

Jon

jon bennett | jonjben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/

On 4 Dec 2003, at 14:57, Jon Bennett wrote:

> How about a dropdown for each category (max 25 products per cat I'd
> think) with either a series of radio buttons or another dropdown to
> determine the order of preference (1,2 or3), how would something like
> that stand up to the user interface and usuability bods ??
>
> Dang, that wouldn't work, because it would only give you the option to
> add one product from each category, bugger! Could only do the above if
> I repeated all the dropdowns for each cat 3 times!
>
> How easy is it to change the content of a dropdown without page
> refreshes ??? I could then have a dropdown for categories and a
> dynamic dropdown for the products in that category, that would be much
> easier to repeat.
>
> Thanks,
>
> Jon
>
>
> jon bennett | jonjben.net
> new media designer / developer
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> J b e n . n e t
>
> 91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
> t: +44 (0) 1225 341039 w: http://www.jben.net/
>
>
> On 4 Dec 2003, at 14:02, Justin French wrote:
>
>> On Thursday, December 4, 2003, at 11:42 PM, Jon Bennett wrote:
>>
>>> I'm currently working on my first e-commerce site and would like to
>>> offer my client the option of adding, maybe 3, related products for
>>> each product using the CMS I'm developing. I guess this would be
>>> much like Amazon et all.
>>>
>>> I don't think getting the info into the db will be a problem, what I
>>> see as a problem is how an admin will select 3 out of 200+ products.
>>> Obviously a drop down is a bad idea, but so would a alphabetical
>>> list. has anyone got any insight into the best way to solve this.
>>
>> Why is a drop-down a bad idea? My only concerns would be
>>
>> a) bloated code (200 options at 20 chars each = 4000 chars (4k?)
>> b) a long list to scroll through for the user
>> c) combo boxes wouldn't allow the user to choose the order of the
>> three related products -- you'd need 3 drop-down menu's for that :)
>>
>> Perhaps it could be a series of drop-downs (CDs|Books|Videos or
>> A-K|L-Z etc)
>>
>>
>> The other solutions I have depend on your target market -- for a CMS
>> in a controlled environment and limited user group, you might be able
>> to get away with the following ideas:
>>
>> 1. Using CSS2's overflow property to create a little scrollable area.
>> Again, these could be broken into categories to make it easier for
>> the user.
>>
>> <div style='height:50px; overflow:auto'>
>> <input type='checkbox' name='foo' value='1' />A product<br />
>> <input type='checkbox' name='foo' value='1' />A product<br />
>> <input type='checkbox' name='foo' value='1' />A product<br />
>> <input type='checkbox' name='foo' value='1' />A product<br />
>> ...
>> <input type='checkbox' name='foo' value='1' />A product<br />
>> </div>
>>
>> 2. Javascript pop-up -- you could take this part of the process out
>> of the main window, and into a JS pop-up window which let's the user
>> dig through categories, do searches, WHATEVER to find each product.
>> Then some JS code on the pop-up could talk back to the main window
>> and 'fill in' 3 text-fields / hidden fields with the related product
>> ID's / descriptions / etc.
>>
>> You'd need to know a fair bit about JS, or get some serious help
>> here, but IT CAN BE DONE.
>>
>>
>> Justin French
>>
>> --
>> 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
>

attached mail follows:


Hello Jon,

Thursday, December 4, 2003, 3:43:53 PM, you wrote:

JB> Would I be right in thinking that php alone can't change the content of
JB> a dropdown once the browser has loaded the file without a page refresh

Right.

JB> ??? In which case I need to source out some javascript, anyone got
JB> anything that might help me (code, tute, urls etc) as I'm not having
JB> much luck with google ??

http://www.mattkruse.com/javascript/

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


** Low Priority **

<snip>

>>> Jon Bennett <flashcoderjben.net> 12/4/2003 9:43:53 AM >>>
Would I be right in thinking that php alone can't change the content of

a dropdown once the browser has loaded the file without a page refresh

??? In which case I need to source out some javascript, anyone got
anything that might help me (code, tute, urls etc) as I'm not having
much luck with google ??
</snip>

Try the hidden iframe method. I have used it in a couple projects and
it works great
http://developer.apple.com/internet/javascript/iframe.html

attached mail follows:


On Thu, Dec 04, 2003 at 03:43:53PM +0000, Jon Bennett wrote:

> Would I be right in thinking that php alone can't change the content of
> a dropdown once the browser has loaded the file without a page refresh
> ??? In which case I need to source out some javascript, anyone got
> anything that might help me (code, tute, urls etc) as I'm not having
> much luck with google ??

I have done this in JavaScript - but I dont have any code handy.

Basically you will need to pre-generate a series of JavaScript arrays for each
category of product at the top of the web page. Then you have a JavaScript
event handler in the category pulldown that changes the product pulldown to a
different array whenever the category changes (use something like onClick or
onChange or a similar relevant event).

Works pretty well - I once worked on a project which pulled data from Access
via ODBC (I was coding in ASP - bleh! Never again... ;-) and generated the web
page with the arrays and JavaScript functions at the top to handle the
switching of the pulldowns.

--
Aj.
Sys. Admin / Developer

attached mail follows:


Justin French <mailto:justinindent.com.au>
    on Thursday, December 04, 2003 6:03 AM said:

> 2. Javascript pop-up -- you could take this part of the process out of
> the main window, and into a JS pop-up window which let's the user dig
> through categories, do searches, WHATEVER to find each product. Then
> some JS code on the pop-up could talk back to the main window and
> 'fill in' 3 text-fields / hidden fields with the related product ID's
> / descriptions / etc.

I like this idea best. Except let me suggest a few changes.

Let's say you have a section of page like this (this is the part on the
product page where the customer chooses the related products).

+----+----------------------------+----------+
| ID | Product ID | Category | <a>Add Item</a>
+----+----------------------------+----------+

When the user clicks the Add Item link a popup will appear. This popup
will allow the user (like Justin describes) to find their product using
any number of methods (searching, scrolling through dropdowns, etc.).
When the user has chosen their product they will click an Add Item
button. This popup will POST to another page that will add an entry to
your related item's table for the specific product loaded in the parent
window. The add related item popup will then refresh to a blank page
ready for more searching.

When the user is done adding products (let's say they've added 15
related products already*) they have two options. One is to click a link
titled "Finished Adding Products" and two is to click the X on the
window to close it. Your js will be setup in such a way that when the
window gets closed (either by method 1, or method 2) it will instruct
the parent window to reload. Upon reload the parent window will now
display all the related products and the categories those related
products are in (along with their order) like my picture shows above.

Make sense?

HTH!
Chris.

* You'll want to make sure you use a seperate table for the related
items so that the user can add as many as they want and are not limited
to a specific number (i.e. 3).
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

attached mail follows:


Is there anyway to use CHMOD:

chmod ("/somedir/somefile", 0755);

but have it set all files, folders etc to the CHMOD setting I want?

I have a folder, and within that, I wanna quickly, jsut set it all to
CHMOD 777.
all sub DIR's and files etc...

can it be done simply?

E.G. :
chmod ("/somedir/%", 0755);

*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************

attached mail follows:


[snip]
Is there anyway to use CHMOD:

chmod ("/somedir/somefile", 0755);

but have it set all files, folders etc to the CHMOD setting I want?

I have a folder, and within that, I wanna quickly, jsut set it all to
CHMOD 777.
all sub DIR's and files etc...

can it be done simply?

E.G. :
chmod ("/somedir/%", 0755);
[/snip]

Danger, Danger!! [tm]

Yes you can, but 'tis not a swell idea. You can exec the chmod command

exec("chmod 0777 /directory/*");

You still cannot set all sub directory and files within those
permissions. Best to loop through and set each as needed, don't forget
to cahnge them back.

attached mail follows:


Jay Blanchard wrote:

>[snip]
>Is there anyway to use CHMOD:
>
>chmod ("/somedir/somefile", 0755);
>
>but have it set all files, folders etc to the CHMOD setting I want?
>
>I have a folder, and within that, I wanna quickly, jsut set it all to
>CHMOD 777.
>all sub DIR's and files etc...
>
>can it be done simply?
>
>E.G. :
>chmod ("/somedir/%", 0755);
>[/snip]
>
>Danger, Danger!! [tm]
>
>Yes you can, but 'tis not a swell idea. You can exec the chmod command
>
>exec("chmod 0777 /directory/*");
>
>

Better : exec("chmod -R 0777 /directory");

>You still cannot set all sub directory and files within those
>permissions. Best to loop through and set each as needed, don't forget
>to cahnge them back.
>
>

attached mail follows:


Jay Blanchard wrote:
> Yes you can, but 'tis not a swell idea. You can exec the chmod command
>
> exec("chmod 0777 /directory/*");
>
> You still cannot set all sub directory and files within those
> permissions. Best to loop through and set each as needed, don't forget
> to cahnge them back.
>

Yes, you can:

exec("chmod -R 0777 /directory/*");

attached mail follows:


[snip]
> exec("chmod 0777 /directory/*");
>
> You still cannot set all sub directory and files within those
> permissions. Best to loop through and set each as needed, don't forget
> to cahnge them back.
>

Yes, you can:

exec("chmod -R 0777 /directory/*");
[snip]

*slaps forehead* Duh me! Of course! I so rarely (nearly never) use that
switch that in my haste to fire off an answer I forgot it.

attached mail follows:


How about:

exec("chmod -R 755 /somedir/");

Tristan.Prettyrisk.sungard.com wrote:
> ***********************************************
> This Email Has Been Virus Swept
> ***********************************************
>
> Is there anyway to use CHMOD:
>
> chmod ("/somedir/somefile", 0755);
>
> but have it set all files, folders etc to the CHMOD setting I want?
>
> I have a folder, and within that, I wanna quickly, jsut set it all to
> CHMOD 777.
> all sub DIR's and files etc...
>
> can it be done simply?
>
> E.G. :
> chmod ("/somedir/%", 0755);
>
> *********************************************************************
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***********************************************************************
>
>

--
----------------------
  www.curvedvision.com
----------------------

This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

attached mail follows:


In all fairness, that's not a very good solution. Using system commands
makes your script not cross platform, meaning it can't work on Windows.
For a better solution try writing a recursive chmod script that sets the
permission, the loops through the files and calls itself on them if the
input is a directory.

Jay Blanchard wrote:
> [snip]
>
>>exec("chmod 0777 /directory/*");
>>
>>You still cannot set all sub directory and files within those
>>permissions. Best to loop through and set each as needed, don't forget
>>to cahnge them back.
>>
>
>
> Yes, you can:
>
> exec("chmod -R 0777 /directory/*");
> [snip]
>
> *slaps forehead* Duh me! Of course! I so rarely (nearly never) use that
> switch that in my haste to fire off an answer I forgot it.

attached mail follows:


Justin Patrin wrote:

> In all fairness, that's not a very good solution. Using system commands
> makes your script not cross platform, meaning it can't work on Windows.
> For a better solution try writing a recursive chmod script that sets the
> permission, the loops through the files and calls itself on them if the
> input is a directory.
>

Hmm, chmod does not work on windows anyway, so it is not cross platform
either.

attached mail follows:


Hi all,
I need to know how to run a php script without it popping open a browser
window.
$cmd = 'start http://www.somedomain.com/somedir/somefile.php &'
exec( $cmd );
I have tried using exec & system with '&' at the end of the command but that
does not seem to work.
It always opens a browser window even though the script has no echo/print
statements in it.

Any advice would be appreciated

Thanks
Keith

attached mail follows:


[snip]
I need to know how to run a php script without it popping open a browser
window.
$cmd = 'start http://www.somedomain.com/somedir/somefile.php &'
exec( $cmd );
I have tried using exec & system with '&' at the end of the command but
that
does not seem to work.
It always opens a browser window even though the script has no
echo/print
statements in it.
[/snip]

Normally when executing a file from the command line that you don't want
any return you apply the -q attribute

$>php -q myScript.php

so, probably

exec("/full/path/to/php -q doSomething.php");

attached mail follows:


[snip]
I am running php as an apache module, which is why I used 'START' in
exec("START http://blablalga".
Not sure if this is the correct way of doing it but I cannot use -q with
start.
[/snip]

What is it that you are trying to accomplish? Then perhaps I can better
help.

Even if php is an Apache module there still should be a path to the PHP
executable (type 'which php') and you will not need the http://foo

attached mail follows:


Jay Blanchard wrote:

>[snip]
>I am running php as an apache module, which is why I used 'START' in
>exec("START http://blablalga".
>Not sure if this is the correct way of doing it but I cannot use -q with
>start.
>[/snip]
>
>What is it that you are trying to accomplish? Then perhaps I can better
>help.
>
>Even if php is an Apache module there still should be a path to the PHP
>executable (type 'which php') and you will not need the http://foo
>
>

Sorry but no : when php is an apache-module, there's no executable (only
a .so library)

attached mail follows:


[snip]
>Even if php is an Apache module there still should be a path to the PHP
>executable (type 'which php') and you will not need the http://foo

Sorry but no : when php is an apache-module, there's no executable (only

a .so library)
[/snip]

Depends on the installation and method of installation and the OS. I
guess that I need to stop making generalizations this morning.

attached mail follows:


Hello,

I need to have a "waiting page" displayed, with an animated GIF, while a CGI
is running. As soon as the CGI has finished running, the waiting page should
be replaced by a page displaying the results of the CGI.

I had no problem to do this in Windows, but it is not working in Linux. Any
idea about how to do this in Linux ? Thank you.

Regards,

            Jean-Marc

attached mail follows:


[snip]
I need to have a "waiting page" displayed, with an animated GIF, while a
CGI
is running. As soon as the CGI has finished running, the waiting page
should
be replaced by a page displaying the results of the CGI.

I had no problem to do this in Windows, but it is not working in Linux.
Any
idea about how to do this in Linux ? Thank you.
[/snip]

Are you using PHP? If so see http://www.php.net/flush . If not, see
another list.

attached mail follows:


What do you say to someone who says:

"PHP is just a kiddie language"?

(Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373)

PHP is currently my strongest development language and it annoys me that it
is a much less bankable skillset than .NET and Java. How long do you think
it's going to take to get respect? Will it ever happen?

attached mail follows:


[snip]
What do you say to someone who says:

"PHP is just a kiddie language"?

(Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373)
[/snip]

Lack of knowledge begets statements like that. (On a DHTML board at that
*snicker*) The only thing that you can say to them is this...when they
know PHP as well as they do [your language here] then, and only then,
will they be able to make this kind of statement truthfully.

As far as PHP getting respect and becoming bankable....it is.

attached mail follows:


I could understand a "programmer" saying something like that, since PHP
is after all a scripting language. As is Perl, Python, Ruby, etc. A
programming purist may even consider any language without direct memory
management a "kiddie" language. Of course, I think Java falls under
this "kiddie" category then.
But to get this from a DHTML list? Egads!

.NET can't even be considered a kiddie language because it's a
framework, not a language. C# is the language of choice for .NET.

On Dec 4, 2003, at 10:16 AM, Daniel Pupius wrote:

> What do you say to someone who says:
>
> "PHP is just a kiddie language"?
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

attached mail follows:


On Thu, 4 Dec 2003 15:16:06 -0000, you wrote:

>What do you say to someone who says:
>
>"PHP is just a kiddie language"?
>
>(Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373)
>
>PHP is currently my strongest development language and it annoys me that it
>is a much less bankable skillset than .NET and Java. How long do you think
>it's going to take to get respect? Will it ever happen?

PHP is a language designed for a limited problem domain (HTML processing),
with a gentle learning curve and missing a lot of modern syntax. These can
be strengths as well as weaknesses, of course - it all depends on the
problem you're trying to solve. However, these attributes do make it a
"kiddie language" (and I'm not using that in an especially pejorative sense)
when compared to languages with other design goals.

We're just fortunate that most web problems are kiddie problems, too.

(It's foolish to get into blind religious wars over languages, so I won't
take this any further, but it's also foolish to be wilfully ignorant of the
strengths and weaknesses of the tools you use.)

attached mail follows:


[snip]
(It's foolish to get into blind religious wars over languages, so I
won't
take this any further, but it's also foolish to be wilfully ignorant of
the
strengths and weaknesses of the tools you use.)
[/snip]

...or to make statements based on willfull ignornace of others tools. :)

attached mail follows:


People (and some boots):

I'm not against or in favor of all this stuff, but exactly all the
opposite... (lmao)

Seriously, there is no kiddie nor professional languages out there, what
is important is what you do with them. PHP will power yahoo in a couple
of months more, that is a company that generates millions of dollars a
year. I work on a project 100% made in PHP and MySQL that costs a lot
of money (6 figures) a copy.

On the other hand, my web site (cesamo.com) has php and costs a little
more than 0.02 cents. And actually is not working!

So there you go! We are all greek!!!

Cesar.

attached mail follows:


On Thu, Dec 04, 2003 at 12:25:25PM -0500, Cesar Cordovez wrote:

> So there you go! We are all greek!!!

Beware of Greeks bearing GIFs

(Sorry, couldn't resist ;-)

--
Aj.
Sys. Admin / Developer

attached mail follows:


Cesar Cordovez <mailto:phpgurucesamo.com>
    on Thursday, December 04, 2003 9:25 AM said:

> I work on a project 100% made in PHP and MySQL that
> costs a lot of money (6 figures) a copy.

Ok... I can't let this go.

Do tell! What is it? Or at the very least, what does it do?

Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

attached mail follows:


I'm byting my tongue off... I have to resist... I've signed a do not
tell anybody thingy... It is huge, as in database with a million
records, huge... But...

I can't tell. Sorry. Anyhow, we chose PHP over Java, C++, C#,
coldfusion and asp to do this. The process was very simple: it is
cheap, fast, scalable, cheap, reliable, cheap, easy to program and
maintain, lots of info source (think this list), cheap, etc.

Cesar

PD. Did I mention that it is cheap and reliable. Also, secure and
cross platform, too.

Chris W. Parker wrote:

> Cesar Cordovez <mailto:phpgurucesamo.com>
> on Thursday, December 04, 2003 9:25 AM said:
>
>
>>I work on a project 100% made in PHP and MySQL that
>>costs a lot of money (6 figures) a copy.
>
>
> Ok... I can't let this go.
>
> Do tell! What is it? Or at the very least, what does it do?
>
>
>
> Chris.
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
>

attached mail follows:


Cesar Cordovez <mailto:phpgurucesamo.com>
    on Thursday, December 04, 2003 10:21 AM said:

> I'm byting my tongue off... I have to resist... I've signed a do not
> tell anybody thingy... It is huge, as in database with a million
> records, huge... But...

ARGH! I understand. :(

Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

attached mail follows:


[snip]
> I'm byting my tongue off... I have to resist... I've signed a do not
> tell anybody thingy... It is huge, as in database with a million
> records, huge... But...

ARGH! I understand. :(
[/snip]

We process millions of records each day for a billing system based on
PHP and MySQL. Gives us centralized web-based interfaces where an
upgrade is rolled out to many many users all at once. There are several
large complex projects using PHP as the language, jsut as there are
several large projects out there using C++, JAVA, Fortran, Cobol
etc.etc.etc.

attached mail follows:


--- Daniel Pupius <dan.pupiusactelearning.com> wrote:
> What do you say to someone who says:
>
> "PHP is just a kiddie language"?
>
> (Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373)

I would suggest not even bothering with these types of people. Like
everyone else, they all have opinions (not necessarily based on anything).
If you're the type of person who enjoys enlightening people, it might be
worth your while, but it's much easier to convince an intelligent person
who has valid complaints than it is to convince a stupid person with none
(in my experience).

You can usually tell by the way they pose their argument whether they're
worth listening to or not. Take this for example:

"Why are you in a situation where you can't use a real server-side
solution, i.e. JSP or ASP.NET?" - Tim Scarfe

The reason that this type of statement can attract passionate responses is
that there is no logic in it and no statement that can be disputed. What
are the criteria of a "real" solution? Why makes JSP a "real" solution?
There aren't answers to questions like these, and this is probably because
Mr. Scarfe has no valid argument underneath his trollish remark. So, my
advice would be to ignore it.

> PHP is currently my strongest development language and it annoys me
> that it is a much less bankable skillset than .NET and Java. How
> long do you think it's going to take to get respect? Will it ever
> happen?

It's already beginning to happen. I must admit to having an "inside"
perspective much of the time, but this changed recently. A few months ago,
I spoke on a PHP Panel at an NYSIA meeting. This is a group of people who
are CEOs and entrepeneurs of software companies. What I learned is that,
to these types of people, PHP is considered to be bleeding-edge
technology. It's just now on their radar - something that they see as the
future of Web development, but not something they're using now. To most of
us, PHP is old news is the sense that it's been around for a decade. Our
perspectives are completely different. It was enlightening.

As far as job postings go, realize that the people who create the postings
(and even do the interviewing in some cases) do not know anything about
the position. They realize that they need a Web developer, so they throw
around some words they've heard in association with Web development. This
approach likely won't change, but I think that PHP will begin to become
one of these words.

The real savvy companies (Yahoo, Amazon, Ticketmaster, etc.) already
choose things like PHP and mod_perl over J* (choose your favorite Java
acronym) and ASP. I think everyone else will catch up, but it will
probably take time. I predict that the next ten years will be very
fruitful for PHP.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

attached mail follows:


Hey

Who cares what these people think. PHP ASP JSP are just tools to get
the job done. If the job calls for ASP, you do it in ASP. They are very
similar. Myself I like unix/linux servers, mysql and php are free. Find
a cheap hosting company that has JSP.

-Blake

>--- Daniel Pupius <dan.pupiusactelearning.com> wrote:
>
>
>>What do you say to someone who says:
>>
>>"PHP is just a kiddie language"?
>>
>>(Source: http://www.dhtmlcentral.com/forums/topic.asp?TOPIC_ID=19373)
>>
>>

--

+-----------------+-----------------+----------------+
| Blake Schroeder | Owner/Developer | lhwd.net |
+--(http://www.lhwd.net)------------+--/3174026352\--+

attached mail follows:


<snip>
"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B01AFAC39nemesis.niicommunications.com...

There are several
large complex projects using PHP as the language, jsut as there are
several large projects out there using C++, JAVA, Fortran, Cobol
etc.etc.etc.
</snip>

I'm cringeing! Did you just compare C++, Java, PHP, Fortran and ...

COBOL?

attached mail follows:


[snip]
There are several
large complex projects using PHP as the language, jsut as there are
several large projects out there using C++, JAVA, Fortran, Cobol
etc.etc.etc.
</snip>

I'm cringeing! Did you just compare C++, Java, PHP, Fortran and ...

COBOL?
[/snip]

Not so much comparison as is "lumping in with other 'languages'"

attached mail follows:


From: "Cesar Cordovez" <phpgurucesamo.com>
> > I work on a project 100% made in PHP and MySQL that
> > costs a lot of money (6 figures) a copy.
>
> PD. Did I