[PHP] for help :how to detect norton client through php socket

2003-12-04 Thread lph
how can i detect whether norton antivirus client  are installed on the hosts
through php socket ?

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



[PHP] for help :how to detect norton client through php socket

2003-12-04 Thread lph
how can i detect whether norton antivirus client  are installed on the hosts
through php socket ?

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



[PHP] FreeBSD port install question

2003-12-04 Thread Dave Carrera
Hi List,

I am in need to update our version of php to the latest stable 4.3.4 and in
GD, XSLT and other goodies.

The issue I have is how do I tell a port to install but not over right the
current working version so that I can test it first.

Make will be as a module for apache.

I hope this is clearly explained but please email me if you need something
clarifying.

Thank you in advance

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
 

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



Re: [PHP] for help :how to detect norton client through php socket

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 15:39:30 +0800, you wrote:

>how can i detect whether norton antivirus client  are installed on the hosts
>through php socket ?

Why would you want to?

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



[PHP] Re: for help :how to detect norton client through php socket

2003-12-04 Thread lph
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" <[EMAIL PROTECTED]> дÈëÏûÏ¢ÐÂÎÅ:[EMAIL PROTECTED]
> how can i detect whether norton antivirus client  are installed on the
hosts
> through php socket ?

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



[PHP] SID problem

2003-12-04 Thread Binay
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


RE: [PHP] SID problem

2003-12-04 Thread Wouter van Vliet
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.

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



Re: [PHP] File - Success Warning Message

2003-12-04 Thread David Otton
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.

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



Re: [PHP] SID problem

2003-12-04 Thread Binay
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" <[EMAIL PROTECTED]>
To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
> > To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > 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 >
>  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 >
>  include('global.inc.php');
>
> (.. the rest of your code ..)
> ?>
>
>

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



[PHP] File - Success Warning Message

2003-12-04 Thread [-^-!-%-

Hello everyone!

I'm getting this weird warning message when I include a file. I was hoping
someone could point me in the right direction.

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

===

This code gives the following error:

Begin Error--
Warning: file("http://webmail.juicemarketing.net";) - Success in
/home/sites/site38/web/webbrowser.php on line 3

Warning: Bad arguments to implode() in
/home/sites/site38/web/webbrowser.php on line 3
---End Error -

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

What is causing that warning? Am I misssing something?

I am using php 4.0.6 (*don't ask...I'm trying to get the ISP to
upgrade...) with allow_url_fopen set to '1'.

OS: LInux
PHP: 4.0.6


=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

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



RE: [PHP] SID problem

2003-12-04 Thread Wouter van Vliet
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" <[EMAIL PROTECTED]>
> To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> 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 >


< any-other-file.php >


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



[PHP] Execute a linux binary that generates a registration code...

2003-12-04 Thread Karam Chand
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/

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



Re: [PHP] File - Success Warning Message

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Session Expiration Problem....

2003-12-04 Thread SLanger
Hello

Have you considered breaking down your form into several smaller ones on 
seperate pages like a wizard? In each step you can save the entered data 
preventing it from being lost. In the end show the whole form with all 
data for verification by the user. 

Regards
Stefan Langer
 

Re: [PHP] Execute a linux binary that generates a registration code...

2003-12-04 Thread Sophie Mattoug
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/
 

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


[PHP] Re: Variables scope question

2003-12-04 Thread Steve Fulleylove
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" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> 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 ] [EMAIL PROTECTED]
> [ p ] 323.606.4237

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



Re: [PHP] New line problem - but for Excel

2003-12-04 Thread Sven
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

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


[PHP] Re: preserving blank space padding when using fgetcsv

2003-12-04 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 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  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?

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



Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-04 Thread Victor Spång Arthursson
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

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


Re: [PHP] SID problem

2003-12-04 Thread Binay
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" <[EMAIL PROTECTED]>
To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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.
>
>

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



[PHP] Problem with references

2003-12-04 Thread Terry
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

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



Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-04 Thread Victor Spång Arthursson
Here is the error message, that the code produces:



And here is a copy of the code:



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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] cookies

2003-12-04 Thread Maris Kalnins
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:



...

..
http://www.cookiedomain.com/cookies/cookies.php>
..





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

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



[PHP] Re: BLOB - PHP Peformance DB vs. Web server Opinions

2003-12-04 Thread Leendert

"Ahbaid Gaffoor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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  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

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



Re: [PHP] Problem with references

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 11:16:10 -, 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?

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



Re: [PHP] File - Success Warning Message

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] open rtf in IE

2003-12-04 Thread Egil Berntsen
I generate and save a rtf file with php in my MySQL db. Is it possible to
open this file in IE?

thanks

/egil

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



Re: [PHP] BLOB - PHP Peformance DB vs. Web server Opinions

2003-12-04 Thread Sophie Mattoug
Ahbaid Gaffoor wrote:

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


Hi

For me it's obvious that storing any data (an image a fortiori) in a 
file is always (please, other list-members, tell if I'm wrong) faster 
than extracting from a database.

Hope this helps,

--
Cordialement,
---
Sophie Mattoug
Développement web dynamique
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] open rtf in IE

2003-12-04 Thread David Otton
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.

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



[PHP] Premature end of script headers: php.exe

2003-12-04 Thread Goran Ristic
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?

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



RE: [PHP] copy_file() files

2003-12-04 Thread Jay Blanchard
[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.

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



RE: [PHP] BLOB - PHP Peformance DB vs. Web server Opinions

2003-12-04 Thread Jay Blanchard
[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.

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



[PHP] [OT MySQL] Syntax for selecting within a range of time from database

2003-12-04 Thread Dave G
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
[EMAIL PROTECTED]

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



Re[2]: [PHP] related products, how to's best practices

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] related products, how to's best practices

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] related products, how to's best practices

2003-12-04 Thread Jon Bennett
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  |  [EMAIL PROTECTED]
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,
 Richardmailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] related products, how to's best practices

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Premature end of script headers: php.exe

2003-12-04 Thread Marek Kilimajer
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?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] related products, how to's best practices

2003-12-04 Thread Jon Bennett
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  |  [EMAIL PROTECTED]
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,
 Richardmailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] related products, how to's best practices

2003-12-04 Thread Jon Bennett
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  |  [EMAIL PROTECTED]
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/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] CHMOD...

2003-12-04 Thread Tristan . Pretty
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.
***



RE: [PHP] [OT MySQL] Syntax for selecting within a range of time from database

2003-12-04 Thread Jay Blanchard
[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)

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



Re: [PHP] Premature end of script headers: php.exe

2003-12-04 Thread David Otton
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.)

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



RE: [PHP] How does one run PHP scripts in 'silent mode' ???

2003-12-04 Thread Jay Blanchard
[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");

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



Re: [PHP] related products, how to's best practices

2003-12-04 Thread Justin French
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.


A product
A product
A product
A product
...
A product

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


Re: [PHP] How does one run PHP scripts in 'silent mode' ???

2003-12-04 Thread Sophie Mattoug
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)

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


RE: [PHP] CHMOD...

2003-12-04 Thread Jay Blanchard
[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.

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



Re: [PHP] CHMOD...

2003-12-04 Thread Sophie Mattoug
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.
 

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


[PHP] How to display a "waiting page" while a CGI is running ?

2003-12-04 Thread Jean-Marc Godart
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

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



RE: [PHP] How does one run PHP scripts in 'silent mode' ???

2003-12-04 Thread Jay Blanchard
[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.

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



RE: [PHP] How to display a "waiting page" while a CGI is running ?

2003-12-04 Thread Jay Blanchard
[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.

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



Re: [PHP] CHMOD...

2003-12-04 Thread Marek Kilimajer
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/*");

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


Re: [PHP] CHMOD...

2003-12-04 Thread Neil Freeman
How about:

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

[EMAIL PROTECTED] 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 ***

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


Re: [PHP] Re: for help :how to detect norton client through php socket

2003-12-04 Thread Marek Kilimajer
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" <[EMAIL PROTECTED]> дÈëÏûÏ¢ÐÂÎÅ:[EMAIL PROTECTED]

how can i detect whether norton antivirus client  are installed on the
hosts

through php socket ?


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


Re: [PHP] SID problem

2003-12-04 Thread Marek Kilimajer
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" <[EMAIL PROTECTED]>
To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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" <[EMAIL PROTECTED]>
To: "'Binay'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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 >

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

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


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


[PHP] What do you say to someone who says...

2003-12-04 Thread Daniel Pupius
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] html stripping

2003-12-04 Thread php-general
No this is not some shaddy game or strip poker knock-off.  My question has to 
do with a person project I have started.  I have a script that grabs names and 
ids from a database, puts them in an array and then based on that grabs a URL 
and parses that URL for this name, drops all the html crap, and takes the 
information/stats and insert or updates the stats table.  Problem is on 
certain names the page that it is parsing is different, and so I get loads and 
loads of extra HTML, and one name in particular doesnt return all the stats.

More detail is:


###
CODE
$start=$name;
$end='';
$start_position=strpos($myLine, $start);
$end_position=strpos($myLine, $end)+strlen($end);
$length=$end_position-$start_position; 
$myLine=substr($myLine, $start_position, $length);
$myLine=str_replace("","",$myLine);
$myLine=str_replace("","|",$myLine);
$stats=explode("|", $myLine);


I write all this to log what it is getting back and that is how I know that 
basically on some of these names its return the full page.

I'm really at a loss, anyone have any ideas?


-
This mail sent through IMP: http://horde.org/imp/

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



RE: [PHP] copy_file() files

2003-12-04 Thread Jay Blanchard
[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.

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



Re: [PHP] copy_file() files

2003-12-04 Thread Ajai Khattri
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

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



Re: [PHP] related products, how to's best practices

2003-12-04 Thread Jon Bennett
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  |  [EMAIL PROTECTED]
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  |  [EMAIL PROTECTED]
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.


A product
A product
A product
A product
...
A product

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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Changing User Agent for fopen

2003-12-04 Thread Gerard Samuel
On Thursday 04 December 2003 10:36 am, Gohaku wrote:
> Hi everybody,
> There are some pages I would like to extract links from but I can't
> access the page using the following:
>  ini_set('php.user_agent', 'Mozilla/5.0');

This should work ->
header('User-Agent: Mozilla/5.0');

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



Re[2]: [PHP] related products, how to's best practices

2003-12-04 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] What do you say to someone who says...

2003-12-04 Thread Brent Baisley
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Changing User Agent for fopen

2003-12-04 Thread jon
You might want to look at curl as an alternative -- it gives you a lot
more flexibility than fopen.

-- jon

---
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557


-Original Message-
From: Gohaku [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 8:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Changing User Agent for fopen


Hi everybody,
There are some pages I would like to extract links from but I can't 
access the page using the following:
 ini_set('php.user_agent', 'Mozilla/5.0');
$url = "http://www.google.com/search?q=php";;
 $fp = fopen($url,"r");
 $buffer = fread($fp,100);
 echo $buffer;
Also, what is the best number to use when allocating Buffer space for a 
URL?
Is 100 too much?
Thanks.
-Gohaku

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003
 

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



Re: [PHP] International Addresses and Telephones

2003-12-04 Thread Sophie Mattoug
I can tell you for France :
zip code : 5 digits (may begin by '0')
state : not relevant
phone number : 10 digits or +33 and 9 digits
Rankin, Randy wrote:

I have a form which captures US addresses ( address, city, state ) and
telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
need to expand this to capture non-US info, so I was hoping for some
guidance on forms and table structures. I have googled this to death and
still haven't come up with anything.
 

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


[PHP] How does one run PHP scripts in 'silent mode' ???

2003-12-04 Thread Keith
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

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



RE: [PHP] What do you say to someone who says...

2003-12-04 Thread Jay Blanchard
[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 bankableit is. 

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



RE: [PHP] CHMOD...

2003-12-04 Thread Jay Blanchard
[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.

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



[PHP] International Addresses and Telephones

2003-12-04 Thread Rankin, Randy
I have a form which captures US addresses ( address, city, state ) and
telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
need to expand this to capture non-US info, so I was hoping for some
guidance on forms and table structures. I have googled this to death and
still haven't come up with anything. 


Re: [PHP] related products, how to's best practices

2003-12-04 Thread Matt Matijevich
** Low Priority **



>>> Jon Bennett <[EMAIL PROTECTED]> 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 ??



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 

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



Re[2]: [PHP] International Addresses and Telephones

2003-12-04 Thread Richard Davey
SM> I can tell you for France :
SM> zip code : 5 digits (may begin by '0')
SM> state : not relevant
SM> phone number : 10 digits or +33 and 9 digits

For the UK you'll need (on average!) 8 characters for the postal (zip)
code and it must allow letters and a space: BS15 7HL for example. Some
postcodes might be longer/shorter.

To find out this info for every country will take ages.. just drop to
the lowest common denominator :)  hello VARCHAR(20) (or maybe more
depending on some countries?!)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] CHMOD...

2003-12-04 Thread Justin Patrin
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Changing User Agent for fopen

2003-12-04 Thread Gohaku
Hi everybody,
There are some pages I would like to extract links from but I can't 
access the page using the following:
ini_set('php.user_agent', 'Mozilla/5.0');
	$url = "http://www.google.com/search?q=php";;
$fp = fopen($url,"r");
$buffer = fread($fp,100);
echo $buffer;
Also, what is the best number to use when allocating Buffer space for a 
URL?
Is 100 too much?
Thanks.
-Gohaku

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


Re: [PHP] related products, how to's best practices

2003-12-04 Thread Jon Bennett
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  |  [EMAIL PROTECTED]
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.


A product
A product
A product
A product
...
A product

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


[PHP] Overload of private atributes ?

2003-12-04 Thread Eduardo R. Maciel

Do we have a way to avoid the overload of private
atribute members?

Look the example below, and you will see that as the
private member is not visible in the subclass, it is
overloaded by an atribute member of the same name. How
to avoid that??


class PrivateAccess {

private $privateVar;
//public $privateVar;
//protected $privateVar;

public function set($var)
{
$this->privateVar = $var;
}
}

class subClassPrivateAccess extends PrivateAccess
{
function test()
{
  $this->privateVar = 10;
}
}

$acesso = new subClassPrivateAccess;


$acesso->set(5);
$acesso->test();

print_r($acesso);
var_dump($acesso);

===

Results:

PUBLIC:
==
subclassprivateaccess Object
(
[privateVar] => 10
)
object(subclassprivateaccess)#1 (1) {
  ["privateVar"]=>
  int(10)
}


PROTECTED:
==
subclassprivateaccess Object
(
[privateVar:protected] => 10
)
object(subclassprivateaccess)#1 (1) {
  [""]=>
  int(10)
}


PRIVATE:
==
subclassprivateaccess Object
(
[privateVar] => 10
[privateVar:private] => 5
)
object(subclassprivateaccess)#1 (2) {
  ["privateVar"]=>
  int(10)
  [""]=>
  int(5)
}

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

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



Re: [PHP] International Addresses and Telephones

2003-12-04 Thread Ajai Khattri
On Thu, Dec 04, 2003 at 09:53:16AM -0600, Rankin, Randy wrote:

> I have a form which captures US addresses ( address, city, state ) and
> telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
> need to expand this to capture non-US info, so I was hoping for some
> guidance on forms and table structures. I have googled this to death and
> still haven't come up with anything. 

I tend to use an internationalized format for all phone numbers, such as:

+CCC (NP)AAAXXX

where:
CCC = country code (i.e. 44 for UK, 39 for Italy, etc)
NP = optional national prefix (e.g. in the US this is 1)
AAA = area code (212 for New York, 6 for Rome, etc)
XXX = actual phone number

-- 
Aj.
Sys. Admin / Developer

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



[PHP] DB / Tables Question

2003-12-04 Thread Pushpinder Singh Garcha
Hello everyone,

   I have created a PHP and MySQL powered, web-based CRM package 
for our office. It simply takes care of our telephone marketing 
strategy. I need to provide this CRM package to our other clients as 
well. The CRM package makes use of 2 tables i.e. 'Admin' and 'Contacts' 
. The table 'Admin' stores the usernames and passwords of the people 
who are allowed to use the system. The other table 'Contacts' contains 
details of the contacts like name, email,city,state, tel,zip etc.

I want to be able to create a similar CRM package for other clients. My 
question is  should I create a separate DB for each client.
or is it a better design practice to create 2 tables (Admin and 
Contacts) per client within the same DB.  I am not sure if I have been 
able to clearly express my doubts here, but I will be more that happy 
to address any questions.

Thanks in advance
Pushpinder 

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


RE: [PHP] How does one run PHP scripts in 'silent mode' ???

2003-12-04 Thread Jay Blanchard
[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

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



Re: [PHP] DB / Tables Question

2003-12-04 Thread Richard Davey
Hello Pushpinder,

Thursday, December 4, 2003, 4:38:13 PM, you wrote:

PSG> I want to be able to create a similar CRM package for other clients. My
PSG> question is  should I create a separate DB for each client.
PSG> or is it a better design practice to create 2 tables (Admin and 
PSG> Contacts) per client within the same DB.  I am not sure if I have been
PSG> able to clearly express my doubts here, but I will be more that happy
PSG> to address any questions.

It's really a numbers game. If you are likely to need to create
hundreds (or thousands) of new databases then it's not the most
efficient way to do it. If on the other hand you'll only never need to
make a few, then it's probably simpler to do this than restructure the
existing tables. That way you can back-up a clients database, or deny
them access to it, easily and without effecting the others.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] International Addresses and Telephones

2003-12-04 Thread Mike
have a look at the pear Validate class - this is what you need.

In the UK the postal code is (as a preg expression)

/[A-Za-z]{1,2}[0-9]{1,2}[A-Za-z]\s?[1-9][A-Za-z]{2}/

these are valid postcodes

B1 4RT
B56 6TY
BN5 6ER
SW1A 1AA (<- the queen @ buck palace)
SW14 5RT

ie. one or 2 letters, followed by one or 2 numbers, followed by optional
letter (only for some central london addys i think) [space] 1 number
(not 0) followed by 2 letters

our telephone system is a bit of a c0ck up and so we can have lots of
different numbers, generally though

01 or 02 - normal land lines
07 - mobile phones
08 - 'special rate numbers' either free/local or national rate
09 - the expensive 10p - 1.50 per minute

tel numbers can be from 9 to 12 numbers i spose (just to be sure)

On Thu, 2003-12-04 at 15:53, Rankin, Randy wrote:
> I have a form which captures US addresses ( address, city, state ) and
> telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
> need to expand this to capture non-US info, so I was hoping for some
> guidance on forms and table structures. I have googled this to death and
> still haven't come up with anything. 

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



RE: [PHP] DB / Tables Question

2003-12-04 Thread Robert Sossomon
Personally, as a design practice I would make the 2 tables in their own
separate database.  This would allow it to port anywhere, even a new
server you bring online and shift everything to.  I have been working on
a catalog/quote system for our salesmen to use and have given it to a
sister corporation and the only things I have had to change within the
system was the DB access and passwords, as well as the company
information.  This allows for a quick and dirty database build and is
independent on the server hosting it.

My $.02

Robert

~~~
A sucking chest wound is nature's way of telling you to slow down.

-Another Murphy's Law (of combat) 
~~~

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



Re: [PHP] CHMOD...

2003-12-04 Thread Marek Kilimajer
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.

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


Re: [PHP] What do you say to someone who says...

2003-12-04 Thread David Otton
On Thu, 4 Dec 2003 15:16:06 -, 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.)

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



RE: [PHP] What do you say to someone who says...

2003-12-04 Thread Jay Blanchard
[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. :)

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



Re: [PHP] Session Expiration Problem....

2003-12-04 Thread CF High
Hey Lowell.

H, no, not a particularly elegeant solution, but it must work for you.

I'm experimenting with >> ini_set('session.gc_maxlifetime', 4320);

Don't know if this will extend the session timeout; i.e. garbage collection
routine, I'm still testing it.

A total drag that our host limits session timeouts to just 15 minutes!

Must be a workaround for this...

--Noah



"Lowell Allen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Our hosting company sets session vars to expire every 15 minutes.
> >
> > I've setup an Admin Center for users to enter various types of
information,
> > some of which, for example entering a basketball team roster, can take
> > slower users upwards of 25 minutes or more.
> >
> > The result?  Admin user spends 25 minutes entering data; clicks the
submit
> > button; then is redirected to the login page because their session
> > expired! -- all form data is lost -- not good
> >
> > Is there a way to extend the php session timeout for particular pages?
> > Alternatively, is there a way, other than using cookies, to store user
data
> > from page-to-page?
> >
> > Thanks for any leads,
>
> Yeah, I get occasional complaints about this problem -- although I don't
> have to contend with sessions expiring every 15 minutes! I've found that
> it's usually possible to use the browser back button to return to the form
> with all values still in place (Windows 98-IE6 being an exception), then
> open a new window to log in again, then return to the form window to
submit.
> Those instructions can accompany your "not logged in" message. Admittedly
an
> inelegant solution, but it's better than losing the form data.
>
> In my situation, I've considered rewriting the PHP script that's receiving
> the form post so that if the session has expired it will re-display a
> simplified version of the form (without showing protected content) with
the
> posted data, and provide a link to open a login form in a new (small)
> window.
>
> HTH
>
> --
> Lowell Allen

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



Re: [PHP] What do you say to someone who says...

2003-12-04 Thread Cesar Cordovez
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.

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


Re: [PHP] What do you say to someone who says...

2003-12-04 Thread Ajai Khattri
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

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



Re: [PHP] Problem with references

2003-12-04 Thread Eduardo R. Maciel
> On Thu, 4 Dec 2003 11:16:10 -, 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/

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



RE: [PHP] What do you say to someone who says...

2003-12-04 Thread Chris W. Parker
Cesar Cordovez 
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/

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



Re: [PHP] related products, how to's best practices

2003-12-04 Thread Ajai Khattri
On Thu, Dec 04, 2003 at 03:43:53PM +, 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

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



RE: [PHP] related products, how to's best practices

2003-12-04 Thread Chris W. Parker
Justin French 
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 | Add Item
+++--+

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/

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



Re: [PHP] replace %rand[x]-[y]% macro in string with random string

2003-12-04 Thread daniel hahler
on Tue, 2 Dec 2003 23:46:33 +0100 I already wrote, regarding replacing
macro %rand[x]-[y] with random of random length ([x]-[y]).

Before, I had my own (slow!) procedure to find next occurence of the
macro and generated a new string, which was returned.

This took about 15 seconds for 10.000 addresses, where the macro could
appear. As this was too slow, I rewrote it to use preg_replace (what a
cool thing, to use a function as replacement) and this takes it down
to about 2,5 seconds!!

Very great - just want to lez you know that.. ;)

So this is it:

 // replaces %rand[x]-[y]% with random text with length between [x] and [y]
 function parserandstr($toparse){
  function genrandstr($minlen, $maxlen){
   echo $minlen, $maxlen, '';
   $ch = array(
'punct' => array('.', '.', '.', '..', '!', '!!', '?!'),
'sep' => array(', ', ' - '),
'vocal' => array('a', 'e', 'i', 'o', 'u'),
'cons_low' => array('x', 'y', 'z'),
'cons_norm' => array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 
'q', 'r', 's', 't', 'v', 'w')
   );
   $ch['newlineafter'] = array_merge(' ', $ch['punct'], $ch['sep']);

   $rlen = rand($minlen, $maxlen);

   // generate random string
   $randstr = ''; $inword = 0; $insentence = 0; $lastchar = ''; $lastwasvocal = false; 
$lastnewline = 0;
   $rbreak = rand(0, 100);
   for ($j = 0; $j < $rlen; $j++){
if ($inword > 3 && rand(0, 5) == 1) {  // punctuation chars
 if (rand(0,5) > 0) $char = ' ';
 else {
  $char = $ch['punct'][rand(0, count($ch['punct'])-1)] . ' ';
  $j += strlen($char)-1;
  $insentence = 0;
 }
 $inword = 0;
}
else {
 if (!$lastwasvocal && rand(0, 10) > 6) {  // vocals
  $char = $ch['vocal'][rand(0, count($ch['vocal'])-1)];
  $lastwasvocal = true;
 } else {
  do {
   if (rand(0, 30) > 0)  // normal priority consonants
$char = $ch['cons_norm'][rand(0, count($ch['cons_norm'])-1)];
   else $char = $ch['cons_low'][rand(0, count($ch['cons_low'])-1)];
  } while ($char == $lastchar);
  $lastwasvocal = false;
 }
 $inword++;
 $insentence++;
}

if ($insentence == 1 || ($inword == 1 && rand(0, 30) < 10)) $randstr .= 
strtoupper($char);
else $randstr .= $char;
$lastchar = $char;
if ($lastnewline > $rbreak && rand(0, 30) > 10 && in_array($char, 
$ch['newlineafter'])){
 $randstr .= "\n";
 $lastnewline = 0;
 $rbreak = rand(0, 100);
} else $lastnewline++;
   }
   return $randstr;
  }

  $pattern = array('/%rand(\d+)-(\d+)%/e', '/%rand%/e');
  $replace = array('genrandstr($1, $2)', 'genrandstr(5, 40)');
  return preg_replace($pattern, $replace, $toparse);
 }


-- 
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc

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



RE: [PHP] Problem with references

2003-12-04 Thread Chris W. Parker
David Otton 
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/

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



Re: [PHP] What do you say to someone who says...

2003-12-04 Thread Cesar Cordovez
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 
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/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] What do you say to someone who says...

2003-12-04 Thread Chris W. Parker
Cesar Cordovez 
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/

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



Re: [PHP] cookies

2003-12-04 Thread Chris Shiflett
--- Maris Kalnins <[EMAIL PROTECTED]> wrote:
>  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/

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



RE: [PHP] What do you say to someone who says...

2003-12-04 Thread Jay Blanchard
[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.

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



[PHP] PHP, MySQL and datetime

2003-12-04 Thread Jough Jeaux
Greetings all, I'm working on a message-board-type application that will use time 
stamps to sort part of the messages.  I was wondering what everyone's favorite way to 
transfer dates between PHP and MySQL was?
 
--Jough


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

[PHP] Showing absolute path in $_FILES

2003-12-04 Thread David Green
Quick file question.  I want to have a user locate a file, and have the
absolute path be saved as a variable.  I have a form of type "file".  In the
form tag, I have enctype="multipart/form-data".  On the target page, I call
it by using $file = $_FILES['file']['name'].  When i navigate to the file
using the form, I can see the whole path in the "file" box, but when I print
$file, it shows me only the file name without the path.   Is there any way
to show the whole path, and save that as a variable?

Thanks!

-David

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



Re: [PHP] PHP, MySQL and datetime

2003-12-04 Thread Richard Davey
Hello Jough,

Thursday, December 4, 2003, 6:39:13 PM, you wrote:

JJ> Greetings all, I'm working on a message-board-type
JJ> application that will use time stamps to sort part of the
JJ> messages.  I was wondering what everyone's favorite way to
JJ> transfer dates between PHP and MySQL was?

Seeing as MySQL will only take them in one standard format you have to
adhere to that ('-MM-DD HH:MM:SS'). All the MySQL date operations
work on this format, so keep to it. When you pass from PHP to MySQL,
make sure it's in that format (easy to do with the date() function).
If you need to convert more esoteric formats, or do date handling from
within PHP before sending to MySQL then use the strtotime function
combined with the date().

Unless you meant something else of course? :)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



  1   2   >