Re: [PHP] Re: Command line output

2003-11-18 Thread Jason Wong
On Wednesday 19 November 2003 06:54, Shawn McKenzie wrote:
> hey great thanks :(
>
> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > O.K.  I am just now experimenting with the CLI PHP and have another
> > question.  With the following code, none of the echo output is seen until
> > the script completes.  I even tried adding a flush() after the first echo
> > before the imap_open, but still the same behavior.  Any ideas?
> >
> > echo "Connecting to $server: $mbox ...\n\n";
> > $conn = imap_open("{" . $server . ":143/notls/norsh}" . $mbox, $user,
> > $pass);
> >
> > echo "Receiving messages ...\n\n";
> > for ($i = 1; $i <= imap_num_msg($conn); $i++) {
> > ...etc...
> >
> > Thanks!
> > -Shawn

Sorry to butt in and disrupt the conversation that you're having with yourself 
and evidently enjoying, try disabling "output_buffering" in php.ini.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"My father?  My father left when I was quite young.  Well actually, he
 was asked to leave.  He had trouble metabolizing alcohol."
 -- George Carlin
*/

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



Re: [PHP] How to print nice looking text on an image?

2003-11-18 Thread Jason Wong
On Wednesday 19 November 2003 06:32, Kevin Stone wrote:

> I am producing a script that writes text onto a JPEG image to create
> custom printable gift certificates for an online store.  The basics of
> the scripts are straight forward.  However I found that the
> imagestring() function produces absolutely horrible looking pixelized
> text and on these gift certificates looks are important.  I attempted to
> employ the imagepstext() family of functions but they do not appear to
> be installed on this account (it's a shared server), I'm getting "call
> to undefined function" errors.
>
> So my question is; Is there any other way to produce good looking
> anti-aliased text on an image?  I'd appreciate any information, classes
> and links to guides you can point me to.

Using imagettftext() would be the easiest. As the lastest versions of PHP are 
bundled with GD *and* have native support for TrueType fonts it really isn't 
too difficult for your host to recompile PHP to enable such support.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Lots of folks confuse bad management with destiny.
-- Frank Hubbard
*/

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



Re: [PHP] I need answers for the questions

2003-11-18 Thread RT
On Tue, 2003-11-18 at 23:55, Greg Donald wrote:
> On Tue, 18 Nov 2003, Ryan Thompson wrote:
> 
> >What you can't find at php.net/manual/en you can find on google. But I have a 
> >question for you. Correct me if I'm wrong but isn't a subnet mask of 
> >255.255.248.0 invalid??? I thought it had to be 255's and 0's.
> 
> Umm..  no.  For a given network, say 10.0.0.0, a subnet mask of 
> 255.255.248.0 yields the following range of possible node addresses: 
> 10.0.0.1 to 10.0.7.254.
> 
> >This seems like laziness..
> 
> Or homework.
> 
> 
> -- 
> Greg Donald
> http://destiney.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Thanks for that clarification. That might actually solve some problems
at work. I didn't know that. Learn something new every day :)

Homework or otherwise. Back when I was in school I had to look it up
myself. I didn't use mailing lists, newsgroups, etc. for easy answers:)
-- 
"I have a photographic memory. I just forgot the film" --Unknown
=
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net

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



Re: [PHP] Mysql question

2003-11-18 Thread Greg Donald
On Tue, 18 Nov 2003, Lists wrote:

>I have a db in sql, and I need a php/mysql query/command to copy the 
>entire db (schema and data) to a new db.  I know how to do this with a 
>table, but I can not figure out how to do this with a whole db.  I also 
>know that I could do it using mysql dump, but I don't want to have to run 
>a shell command.

Have you tried mysqlhotcopy?

http://www.mysql.com/doc/en/mysqlhotcopy.html


-- 
Greg Donald
http://destiney.com

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



Re: [PHP] Custom Session usind MySQL

2003-11-18 Thread Greg Donald
On Wed, 19 Nov 2003, Manisha Sathe wrote:

>I want the session to be accessed from different websites, so i got the
>answer in this forum only to make use of customised session with mysql.
>
>I searched the web and came to know that 'session.save_handler' of php.ini
>needs to be as 'user' but instead, on my server it is 'files'. As server is
>a shared server so i may not be able to change it, what can i do to resolve
>this ?
>

Basically you just need to override the default session handler and 
provide your own session functions that will use a MySQL table instead of 
/tmp.  Try this:

http://destiney.com/pub/php_db_sessions.tar.gz


-- 
Greg Donald
http://destiney.com

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



Re: [PHP] I need answers for the questions

2003-11-18 Thread Greg Donald
On Tue, 18 Nov 2003, Ryan Thompson wrote:

>What you can't find at php.net/manual/en you can find on google. But I have a 
>question for you. Correct me if I'm wrong but isn't a subnet mask of 
>255.255.248.0 invalid??? I thought it had to be 255's and 0's.

Umm..  no.  For a given network, say 10.0.0.0, a subnet mask of 
255.255.248.0 yields the following range of possible node addresses: 
10.0.0.1 to 10.0.7.254.

>This seems like laziness..

Or homework.


-- 
Greg Donald
http://destiney.com

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



Re: [PHP] mcrypt libraries?

2003-11-18 Thread Evan Nemerson
On Tuesday 18 November 2003 01:13 pm, Jas wrote:
> Curt Zirzow wrote:
> > * Thus wrote Jas ([EMAIL PROTECTED]):
> >>I am not sure if I should post my question here but I will anyways.
> >>
> >>Ok, I have compiled the mcrypt libraries on a Redhat 9 box running
> >>apache 2 with php4.  And I need to know the next step(s) in getting php
> >>to use the libmcrypt libraries.  If anyone has set this up in the past
> >>or has some pointers (other than reading the manual) I would appreciate
> >> it.
> >
> > Did you read the next step: Installation
> >   http://php.net/mcrypt
> >
> >
> > Curt
>
> Yes I have and I guess I was looking for a method of using the libmcrypt
> library without having to recompile php. Sorry for the confusion.

Have you tried using phpize?


-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"To think is to differ."

-Clarence Darrow

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



Re: [PHP] eregi filter

2003-11-18 Thread John Nichel
John W. Holmes wrote:
Derek Ford wrote:

Erin wrote:
 > >

> Anyone have a good eregi filter for passwords?

well, for one thing, don't use ereg. Use pcre, as it is faster.

preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah);
that will validate a password containing only upper or lowercase 
letters and numbers, between 5 and 16 characters.

So "a" is a good password?

It's an excelent password.  I think you should change your root password 
to that on all systems you have root on.  Oh, and another thingsend 
me the IP's to those machines. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Custom Session usind MySQL

2003-11-18 Thread John W. Holmes
Manisha Sathe wrote:

yes, website is on same machine, but if there is to and fro from 2 websites,
then for both ways i need to pass it ? what will happen to session time
limit ? if i go website1 then go to another website2 then after 30 mins i
come back to website1 (session timeout 30mins) then what will happen ? Any
sample code would be appreciated.
Nothing will happen as you'll be using the same session file so it will 
not be cleaned up. What don't you try reading the page for 
session_set_save_handler() and start from there...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] eregi filter

2003-11-18 Thread John W. Holmes
Derek Ford wrote:
Erin wrote:
> >
> Anyone have a good eregi filter for passwords?

well, for one thing, don't use ereg. Use pcre, as it is faster.

preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah);
that will validate a password containing only upper or lowercase letters 
and numbers, between 5 and 16 characters.

So "a" is a good password?

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] eregi filter

2003-11-18 Thread John W. Holmes
Erin wrote:

Anyone have a good eregi filter for passwords?
Yes.

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] eregi filter

2003-11-18 Thread Derek Ford
Erin wrote:

Anyone have a good eregi filter for passwords?

Regards

R

 

well, for one thing, don't use ereg. Use pcre, as it is faster.

preg_match('/^[a-zA-Z0-9]{5,16}$/',$blah);
that will validate a password containing only upper or lowercase letters 
and numbers, between 5 and 16 characters.

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


Re: [PHP] I need answers for the questions

2003-11-18 Thread Ryan Thompson
On Tuesday 18 November 2003 02:12, Arivazhagi Govindarajan wrote:
> PHP Questions
>
> 1. Explain about session management and cookies ? In PHP how we can
> maintain a session
>
> 2. What is HTTP tunneling
>
> 3. How to enable PHP in Apache server manually?
>
> 4. When we upload a file using  tag of the type FILE what are global
> variables become available for use in PHP
>
> 5. Explain SQL injections ? How we can avoid this
>
> 6. Write a small script to connect a MYSQL server in PHP
>
> 7. Given a class B network with subnet mask of 255.255.248.0 and a packet
> addressed to 130.40.32.16 whatis subnet address
>
> 8. Using single Apache server can we host multiple sites . If yes how can
> we do this if no why it is not possible
>
> 9. what is search engine optimization ? In HTML using which tag we can
> attain this?
>
> 10. Write a function in PHP script to check whether string is a valid email
> id or not?
>
> _
> Garfield on your mobile. Download now. http://server1.msn.co.in/sp03/gprs/
> How cool can life get?

What you can't find at php.net/manual/en you can find on google. But I have a 
question for you. Correct me if I'm wrong but isn't a subnet mask of 
255.255.248.0 invalid??? I thought it had to be 255's and 0's.

This seems like laziness..
-- 
"I have a photographic memory. I just forgot the film" --Unknown
=
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net

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



[PHP] eregi filter

2003-11-18 Thread Erin
Anyone have a good eregi filter for passwords?


Regards

R

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



Re: [PHP] Query Batch

2003-11-18 Thread John W. Holmes
b b wrote:

 I am translating an MS-SQL application into
mysql/php. I need to be able to send a batch of
queries all at once. For example:
 $qStr = " Insert into A(name, address)
values('$name', '$address') ; Insert into B(personID,
department ...)values (@@identity, '$department');" ;
 $result= mysql_query($qStr, $link) ;
No, you can only run one query at a time.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Custom Session usind MySQL

2003-11-18 Thread Manisha Sathe
yes, website is on same machine, but if there is to and fro from 2 websites,
then for both ways i need to pass it ? what will happen to session time
limit ? if i go website1 then go to another website2 then after 30 mins i
come back to website1 (session timeout 30mins) then what will happen ? Any
sample code would be appreciated.

if at all i decide to go for database then do i need  'session.save_handler'
as 'user' ?

manisha


> Manisha Sathe wrote:
>
> > I want the session to be accessed from different websites, so i got the
> > answer in this forum only to make use of customised session with mysql.
> >
> > I searched the web and came to know that 'session.save_handler' of
php.ini
> > needs to be as 'user' but instead, on my server it is 'files'. As server
is
> > a shared server so i may not be able to change it, what can i do to
resolve
> > this ?
>
> Are both websites on the same machine? If so, you can just use a common
> session.save_path and pass the session_id when changing servers.
>
> If the websites are on different machines, then you'll need to use a
> database for sessions and ensure the database is accessible by each site.
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Re: [PHP] Prefilled forms (solved)

2003-11-18 Thread John W. Holmes
b b wrote:

 No I am saying that if you have:


 and you click submit then if you click back to see
the form the value you set w2 will be blank. If you
reverse the order however then you will see what you
entered in w2
odd, yes, but completely client dependent, so PHP isn't going to help.

The only possible thing I can think of that might help this is playing 
with what headers you send along with the page that has the form. Maybe 
if the browser is directed to cache the page, it'll also save your 
filled in form data... or vise versa... PHP can send the headers of 
course, but you'll have to play around and there's no guarantee that 
it'll be the same with each browser...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] windows file permission

2003-11-18 Thread John W. Holmes
Chris Williams wrote:

I am using PHP on Windows NT CGI/FastCGI  and am trying to create a text
file and then write some data to it.
$some_text  = "HelloWorld";
$new_file = fopen("myfile.txt", "w");
fputs($new_file, $some_text);
fclose($new_file);
However I am getting Warning: fopen(myfile.txt): failed to open stream:
Permission denied in...
I don't usually work on Windows but I checked the file permissons on this
folder and they seem to be 777 or drwxrwxrwx
I'm guessing I have no idea how Windows permissions work.
I'm not sure what user PHP runs as when using CGI, so you'll probably 
need to give "Everyone" permission to read/write to the directory this 
script is run in.

Right click on the folder, choose the Security tab, and add Everyone as 
a user with the appropriate permissions.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Mysql question

2003-11-18 Thread John W. Holmes
Lists wrote:

I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with a 
table, but I can not figure out how to do this with a whole db.  I also 
know that I could do it using mysql dump, but I don't want to have to run 
a shell command.
You'll need to do it with PHP...

Here's one method...



//connect to database
$database = 'xxx'; //name of database to copy
$ndatabase = 'yyy'; //name of new database
mysql_query("CREATE DATABASE $ndatabase");

$rs = mysql_query("SHOW TABLES FROM $database");
while($r = mysql_fetch_row($rs))
{
  mysql_select_db($database);
  $rs2 = mysql_query("SHOW CREATE TABLE {$r[0]}");
  $ctable = myqsl_result($rs,0);
  mysql_select_db($ndatabase);
  mysql_query($ctable);
  mysql_query("INSERT INTO {$r[0]} SELECT * FROM {$database}.{$r[0]}");
}
?>
Untested... but should work (when run as a user with suitable 
permissions). :)

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] Query Batch

2003-11-18 Thread b b

 Jhon you mentioned that one may send a batch of
queries with mysql_list? maybe I understood you wrong.


 I am translating an MS-SQL application into
mysql/php. I need to be able to send a batch of
queries all at once. For example:
 $qStr = " Insert into A(name, address)
values('$name', '$address') ; Insert into B(personID,
department ...)values (@@identity, '$department');" ;

 $result= mysql_query($qStr, $link) ;


 In this case I inserted in two tables. for some
reason it doesn't allow me to have to sql statements
in $qStr. Is there a way around that.

 My other option is to have one sql statement per
query  but this would be very inefficient if I
have ti do  tens of inserts in one batch ...

 Cheers.
 

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] Mysql question

2003-11-18 Thread Raditha Dissanayake
Hi John,
ASAIK you are right. Michael, if you use the root account in php you 
will be able to do what John says.

John Nichel wrote:

Lists wrote:

I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with 
a table, but I can not figure out how to do this with a whole db.  I 
also know that I could do it using mysql dump, but I don't want to 
have to run a shell command.

Please help,
MIchael
There may be a shorter way, but the only thing I can think of at the 
moment is to do this via multiple queries ie

query to create new database
query to read tables and structure in old db
queries to create new tables in new db
queries to dump data from old tables
queries to load data to new tables
You may want to try the mysql list to see if this can be done in one 
query.



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] windows file permission

2003-11-18 Thread Chris Williams
I am using PHP on Windows NT CGI/FastCGI  and am trying to create a text
file and then write some data to it.

$some_text  = "HelloWorld";
$new_file = fopen("myfile.txt", "w");
fputs($new_file, $some_text);
fclose($new_file);

However I am getting Warning: fopen(myfile.txt): failed to open stream:
Permission denied in...

I don't usually work on Windows but I checked the file permissons on this
folder and they seem to be 777 or drwxrwxrwx

I'm guessing I have no idea how Windows permissions work.

Chris

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



Re: [PHP] Prefilled forms (solved)

2003-11-18 Thread b b

 No I am saying that if you have:



 and you click submit then if you click back to see
the form the value you set w2 will be blank. If you
reverse the order however then you will see what you
entered in w2


--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> b b wrote:
> 
> > Problem:
> >  I am running apache/php server. If I populate a
> form,
> > send it and then click back I see a blank form. 
> > 
> > Solution:
> > I had some prefilled form elements where I set the
> > value of such form element. For example I had 
> > input type = "hidden" VALUE="whatever" ... at the
> > beginning of the form.
> > 
> >  when I took that hidden variable out and had it
> at
> > the end of the form after all the other elements I
> the
> > problem was solved. Actually any element with its
> > value preset should go to the end of the form. In
> that
> > case when I hit back my form was prefilled the way
> I
> > submitted it. 
> 
> Are you saying you have something like this:
> 
> 
> 
> 
> in order to set a default value? If that's the case,
> you'll never get 
> your value of "foo" from the textbox as the hidden
> value will overwrite it.
> 
> The entire issue is up to the client's browser and
> has nothing to do 
> with PHP. It's up to each browser whether it keeps
> your values or not; 
> I've seen it happen both ways with different
> browsers.
> 
> -- 
> ---John Holmes...
> 
> Amazon Wishlist:
> www.amazon.com/o/registry/3BEXC84AB3A5E/
> 
> php|architect: The Magazine for PHP Professionals –
> www.phparch.com
> 
> 
> 
> 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] Mysql question

2003-11-18 Thread John Nichel
Lists wrote:

I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with a 
table, but I can not figure out how to do this with a whole db.  I also 
know that I could do it using mysql dump, but I don't want to have to run 
a shell command.

Please help,
MIchael
There may be a shorter way, but the only thing I can think of at the 
moment is to do this via multiple queries ie

query to create new database
query to read tables and structure in old db
queries to create new tables in new db
queries to dump data from old tables
queries to load data to new tables
You may want to try the mysql list to see if this can be done in one query.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Mysql question

2003-11-18 Thread Vail, Warren
I don't believe there is one command that does all this, so you've already
ruled out one good option, but you can use PHPMyAdmin.  Do you have
PHPMyAdmin installed on either or both sites?

Warren

-Original Message-
From: Lists [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 5:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mysql question


I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with a 
table, but I can not figure out how to do this with a whole db.  I also 
know that I could do it using mysql dump, but I don't want to have to run 
a shell command.

Please help,
MIchael

-- 
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] Mysql question

2003-11-18 Thread Lists
This is for an intranet application, I trust my users.

Michael

On Wed, 19 Nov 2003, Raditha Dissanayake wrote:

> Creating new databases is usually done with the mysql root account. Bad 
> idea to use this account in a php script.
> 
> Lists wrote:
> 
> >I have a db in sql, and I need a php/mysql query/command to copy the 
> >entire db (schema and data) to a new db.  I know how to do this with a 
> >table, but I can not figure out how to do this with a whole db.  I also 
> >know that I could do it using mysql dump, but I don't want to have to run 
> >a shell command.
> >
> >Please help,
> >MIchael
> >
> >  
> >
> 
> 
> 

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



Re: [PHP] Mysql question

2003-11-18 Thread Raditha Dissanayake
Creating new databases is usually done with the mysql root account. Bad 
idea to use this account in a php script.

Lists wrote:

I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with a 
table, but I can not figure out how to do this with a whole db.  I also 
know that I could do it using mysql dump, but I don't want to have to run 
a shell command.

Please help,
MIchael
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Mysql question

2003-11-18 Thread Lists
I have a db in sql, and I need a php/mysql query/command to copy the 
entire db (schema and data) to a new db.  I know how to do this with a 
table, but I can not figure out how to do this with a whole db.  I also 
know that I could do it using mysql dump, but I don't want to have to run 
a shell command.

Please help,
MIchael

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



Re: [PHP] Prefilled forms (solved)

2003-11-18 Thread John W. Holmes
b b wrote:

Problem:
 I am running apache/php server. If I populate a form,
send it and then click back I see a blank form. 

Solution:
I had some prefilled form elements where I set the
value of such form element. For example I had 
input type = "hidden" VALUE="whatever" ... at the
beginning of the form.

 when I took that hidden variable out and had it at
the end of the form after all the other elements I the
problem was solved. Actually any element with its
value preset should go to the end of the form. In that
case when I hit back my form was prefilled the way I
submitted it. 
Are you saying you have something like this:



in order to set a default value? If that's the case, you'll never get 
your value of "foo" from the textbox as the hidden value will overwrite it.

The entire issue is up to the client's browser and has nothing to do 
with PHP. It's up to each browser whether it keeps your values or not; 
I've seen it happen both ways with different browsers.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread John Nichel
John W. Holmes wrote:

b b wrote:

   What is not right is tell me in public about it
when he actually sent me private messges himself


Come on guys... let's get back to PHP.
Geez, leave it to you to kill what has the makings of a perfectly good 
flame war. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Custom Session usind MySQL

2003-11-18 Thread Marek Kilimajer
Manisha Sathe wrote:
I want the session to be accessed from different websites, so i got the
answer in this forum only to make use of customised session with mysql.
I searched the web and came to know that 'session.save_handler' of php.ini
needs to be as 'user' but instead, on my server it is 'files'. As server is
a shared server so i may not be able to change it, what can i do to resolve
this ?
Thanks in advance
Manisha
You have to use session_set_save_handler() to register your session 
handling functions. One thing I would point out is that you need to lock 
the session storage, in this case one row in a table. As mysql cannot 
lock a row, only whole table, I would sugest you use GET_LOCK and 
RELEASE_LOCK mysql functions (with session id as the lock name) to 
implement session locking.

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


[PHP] Prefilled forms (solved)

2003-11-18 Thread b b

 Alright lets clean the slate here. I think we all
mean well and that is what counts. I apologize if I
offended anybody. 

 Incidentally I can't quite explain the solution to my
dillemma. The following is a description of the
Problem and the Solution:

Problem:
 I am running apache/php server. If I populate a form,
send it and then click back I see a blank form. 

Solution:
I had some prefilled form elements where I set the
value of such form element. For example I had 
input type = "hidden" VALUE="whatever" ... at the
beginning of the form.

 when I took that hidden variable out and had it at
the end of the form after all the other elements I the
problem was solved. Actually any element with its
value preset should go to the end of the form. In that
case when I hit back my form was prefilled the way I
submitted it. 

 It is funny I have been doing this for a while and
this is the first time I had to investigate such a
problem. I am using mozilla 5.00 or netscape 5.0 on
linux. I presume explorer wouldn't have that problem.

 Hope you don't run into this problem and waste few
hours pulling hair like I did. 

 Cheers and thanks to everyone who tried to help me. 



__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] Custom Session usind MySQL

2003-11-18 Thread John W. Holmes
Manisha Sathe wrote:

I want the session to be accessed from different websites, so i got the
answer in this forum only to make use of customised session with mysql.
I searched the web and came to know that 'session.save_handler' of php.ini
needs to be as 'user' but instead, on my server it is 'files'. As server is
a shared server so i may not be able to change it, what can i do to resolve
this ?
Are both websites on the same machine? If so, you can just use a common 
session.save_path and pass the session_id when changing servers.

If the websites are on different machines, then you'll need to use a 
database for sessions and ensure the database is accessible by each site.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] Custom Session usind MySQL

2003-11-18 Thread Manisha Sathe
I want the session to be accessed from different websites, so i got the
answer in this forum only to make use of customised session with mysql.

I searched the web and came to know that 'session.save_handler' of php.ini
needs to be as 'user' but instead, on my server it is 'files'. As server is
a shared server so i may not be able to change it, what can i do to resolve
this ?

Thanks in advance
Manisha

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



[PHP] Re: Command line output

2003-11-18 Thread Shawn McKenzie
Guess no ones has a clue.  I didnt get a RTFM or anything.

-Shawn

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> O.K.  I am just now experimenting with the CLI PHP and have another
> question.  With the following code, none of the echo output is seen until
> the script completes.  I even tried adding a flush() after the first echo
> before the imap_open, but still the same behavior.  Any ideas?
>
> echo "Connecting to $server: $mbox ...\n\n";
> $conn = imap_open("{" . $server . ":143/notls/norsh}" . $mbox, $user,
> $pass);
>
> echo "Receiving messages ...\n\n";
> for ($i = 1; $i <= imap_num_msg($conn); $i++) {
> ...etc...
>
> Thanks!
> -Shawn

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



[PHP] Re: Assigning command line vars in script

2003-11-18 Thread Shawn McKenzie
I guess it's the greatest ever, that leaves everyone speechless ;-)

-Shawn

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does this look like a good way to retrieve command line variables and
assign
> them in a script, or am I reinventing something that is already in
place???
>
> for ($i = 1; $i < $argc; $i = $i + 2) {
> $var = str_replace("-", "", $argv[$i]);
> $$var = $argv[$i+1];
> }
>
> Thanks!
> -Shawn

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



RE: [PHP] ereg_replace help

2003-11-18 Thread Martin Towell
> * Thus wrote Martin Towell ([EMAIL PROTECTED]):
> > Hi All,
> > 
> > I have an array of strings in the following format:
> > "abcd - rst"
> > "abcd - uvw"
> > "abcd - xyz"
> > "foobar - rst"
> > "blah - rst"
> > "googol - uvw"
> > 
> > What I want to do is strip everything from the " - " bit of 
> the string to
> > the end, _but_ only for the strings that don't start with "abcd"
> > 
> > I was thinking something like the following:
> > echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
> > but obviously this doesn't work, otherwise I wouldn't be 
> emailing the
> > list...
> > 
> 
> $newarray = preg_replace('/((? 
> > Can anyone help? I need to use ereg_replace() because it's 
> part of our code
> > library and therefore can't change :(
> 
> How do you mean its part of your code library? I would strongly
> suggest using preg_* for its speed and capabilites.
> 
> Curt


thanks for everyone's help... 

> How do you mean its part of your code library?

I mean that the function I'm having to call is passed an array (coming from
a databse) and it has an option to do an ereg_replace() on the incoming
array. Due to the amount of other code relying on it, is very hard to change
without causing something strange to happen elsewhere :(

If all the code was mine, then I wouldn't have any reservations on changing
it in an instant. I'm having to improve the code gradually (good luck to me)

Martin

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



Re: [PHP] =sessions / J. Meloni Textbook=

2003-11-18 Thread John W. Holmes
Anthony Ritter wrote:

I'm using the script and no values show up in the page:
session_bb.php
after I submit the values in the  form.

If somebody would like to test both scripts (session_aa.php and
session_bb.php) and get back to me I would be grateful.
I think you're using a crappy book... :)

Main PHP part of session_aa.php:
.

$_SESSION['products'] = 
array_unique(array_merge($_SESSION['products'],$_POST['form_products']));

print "Your products have been registered!";
}
?>
Main PHP part of session_bb.php:
.

if(isset($_SESSION['products']))
{
   print "Your cart:\n";
   foreach($_SESSION['products'] as $p)
   {
   print "$p";
   }
   print "";
}
?>
Remember to have session_start() on both pages... Also notice, like I 
said, there's no need to even make a $products array...

Hope that helps.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread John W. Holmes
b b wrote:

   What is not right is tell me in public about it
when he actually sent me private messges himself
Come on guys... let's get back to PHP. The point everyone should 
realize (or have re-enforced) is that you should post your questions and 
any follow-ups to the PHP Mailing List. Choosing to also include the 
same reply directly to the individual is a personal preference.

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

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] imagettfbbox returning screwy values

2003-11-18 Thread Simon Detheridge
I'm having this really bizarre problem with imagettfbbox. The values it is 
returning seem to be way off the scale. I have gd and ttf support compiled 
into php, (running on latest stable apache 1, gentoo linux, latest stable 
php)

When I call imagettfbbox I get very very large numbers back. They don't seem 
to make any sense at all.

Here's my code:



And here's the output:

Array ( [0] => 1076630208 [1] => 137911840 [2] => -1073777096 [3] => 
1073930763 [4] => 1076630224 [5] => 1076625940 [6] => -1073777064 [7] => 
1075882071 ) 
 
Has anyone seen something like this before? Suggestions? It's not a dodgy 
font. Switching fonts makes the numbers change but only slightly.

For reference, my phpinfo is here: http://www.sympages.com/info.php

Help!

Thanks,
Simon

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



Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread b b

   What is not right is tell me in public about it
when he actually sent me private messges himself
(accidentally). I also accidentally replied to the
wrong duplicate email that he sent (so in fact it is
his fault that he got the private message from me).
Whats not right is to make it look like I am sending
out personal emails to users when I was replying to a
message sent to me. 
Again read and think before interfering. You really
aren't helping much. In other words, mind your own ...


 

--- John Nichel <[EMAIL PROTECTED]> wrote:
> b b wrote:
> >  Some people don't read carefully before
> responding. I
> > didn't say he sent me a private email!!!
> 
> You're right, you didn't say he sent you A private
> email.  You said, 
> "You ahve sent me like three private emails."
> 
> > Anyway it
> > would be appropriate not to forget to take out the
> > email addresses other than the php-general... when
> > clicking reply-all.
> 
> You mean like you forgot to do when replying to Jay
> and the list at the 
> same time?
> 
> > I just don't see how someone who
> > forgets and includes your address (so that you get
> > duplicate responses, 8 from this person so far)
> > complains that you replied to the wrong version.
> 
> He didn't complain...he asked that you not reply
> privately to him or 
> anyone else on the list unless asked to do so. 
> There's a reason for 
> this, which I explained earlier.  You reply
> privately, and it won't be 
> archived here
> 
> http://marc.theaimsgroup.com/?l=php-general&r=1&w=2
> 
> > And
> > he does it in the general list. That is not right.
> 
> What's not right?  That he replied to you and the
> list?  Or that a long 
> time helper of this community asked you not to do
> something, and you 
> took it personal?
> 
> Regardless, I'm not going to go back and forth with
> this all night.
> 
> 
> 
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



[PHP] php openssl

2003-11-18 Thread Fejes Jozsef
Hi! I'd really love to use PKCS12 functions from PHP but it's not supported.
Why?!?!?!?! Currently I have to run the 'openssl pkcs12' system command, all
the other things can be done from php. It's not in the least elegant. Anyone
knows if there's going to be support for it or there's already a patch for
the openssl module?

[EMAIL PROTECTED] [EMAIL PROTECTED]
http://www.irckecel.hu/joco/

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



Re: [PHP] problem generating PNG using image functions

2003-11-18 Thread pw
Hello again,

I just found the problem:

Fatal error:  imageellipse(): requires GD 2.0 or later in imgtest.php on
line 271Hope this helps someone else.Peter

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



RE: [PHP] sorting question

2003-11-18 Thread Ed.Lazor
The date field used from each table differs based on certain conditions that PHP is 
testing for.  It would be great to have MySQL do that, but is that possible?  Here's 
some additional info that might help.
 
The first table includes fields Status, DateAdded, DateShipped, DateCompleted.  If 
Status is Open, use DateAdded for Date.  If Status is Processing, use DateShipped.  If 
Status is Complete, use DateCompleted.
 
The other 4 tables are similar.
 
The results are being pulled from all 5 tables and collected by PHP.  The goal is to 
sort all of the entries together for a report.
 
This would be much easier if there were 5 seperate reports for each table.  In this 
case, however, it's more handy to see all of the results in a single report and sorted 
by date.
 
An example of a similiar situation would be an account register, if you store each 
type of transaction in it's own table and then end up wanting to create a bank 
reconcilliation report.
 
Make sense?
 
-Ed
 
 
 
-Original Message- 


> I used PHP to combine several MySQL queries into a single array and
> now I'm trying to sort the results by one of the named columns.

Any reason you can't turn all those queries into one and sort by date?
Is it because a query like that would be too complicated for you? (I
know I have trouble with SQL sometimes...)

That might be the best way to solve your problem. Just an idea.





Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread John Nichel
b b wrote:
 Some people don't read carefully before responding. I
didn't say he sent me a private email!!!
You're right, you didn't say he sent you A private email.  You said, 
"You ahve sent me like three private emails."

Anyway it
would be appropriate not to forget to take out the
email addresses other than the php-general... when
clicking reply-all.
You mean like you forgot to do when replying to Jay and the list at the 
same time?

I just don't see how someone who
forgets and includes your address (so that you get
duplicate responses, 8 from this person so far)
complains that you replied to the wrong version.
He didn't complain...he asked that you not reply privately to him or 
anyone else on the list unless asked to do so.  There's a reason for 
this, which I explained earlier.  You reply privately, and it won't be 
archived here

http://marc.theaimsgroup.com/?l=php-general&r=1&w=2

And
he does it in the general list. That is not right.
What's not right?  That he replied to you and the list?  Or that a long 
time helper of this community asked you not to do something, and you 
took it personal?

Regardless, I'm not going to go back and forth with this all night.



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] problem generating PNG using image functions

2003-11-18 Thread pw
Hello,

I have some php code that I moved from one serve to another.
The code in question generates some PNG images on the fly
and works nicely on the old server.
After moving the code to the new server only one
of the PNG images now draws. The other images
come back with :

 The image "http://url"; cannot be displayed, because it contains errors.

Why would php generate one image but not the others?
(keep in mind that the code is known to work fine on another server)

Peter

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



Re: [PHP] =sessions / J. Meloni Textbook=

2003-11-18 Thread Anthony Ritter
Thanks John and others.

I'm using the script and no values show up in the page:
session_bb.php

after I submit the values in the  form.

If somebody would like to test both scripts (session_aa.php and
session_bb.php) and get back to me I would be grateful.

As I said, these were from her book/CD.

Thank you.
TR
.

// this is session_aa.php script



Listing 16.4 Storing an array with a session


Product Choice Page
Your products have been registered!";
}
?>

Select some products:

Sonic Screwdriver
Hal 2000
Tardis
ORAC
Transporter bracelet





content page


..
// ...and this is session_bb.php script



Listing 16.5 Accessing session variables


 Content Page
Your cart:\n";
   foreach (unserialize($_SESSION[products]) as $p) {
   print "$p";
   }
   print "";
}
?>
Back to product choice page



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



RE: [PHP] sorting question

2003-11-18 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Tuesday, November 18, 2003 3:25 PM said:

> I used PHP to combine several MySQL queries into a single array and
> now I'm trying to sort the results by one of the named columns. 

Any reason you can't turn all those queries into one and sort by date?
Is it because a query like that would be too complicated for you? (I
know I have trouble with SQL sometimes...)

That might be the best way to solve your problem. Just an idea.



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]{OT} Prefilled forms

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 02:52:42PM -0800, b b wrote:
: 
:  Some people don't read carefully before responding. I
: didn't say he sent me a private email!!! Anyway it
: would be appropriate not to forget to take out the
: email addresses other than the php-general... when
: clicking reply-all. I just don't see how someone who
: forgets and includes your address (so that you get
: duplicate responses, 8 from this person so far)
: complains that you replied to the wrong version. And
: he does it in the general list. That is not right.

I've run into this problem myself.  It's really a matter of personal
experience, learning as you go.  Nowadays, when I respond to a public
list posting via a private email, I usually prefix the message body with
some descriptive blurb like "This is a private message."

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



[PHP] sorting question

2003-11-18 Thread Ed.Lazor
I used PHP to combine several MySQL queries into a single array and now I'm trying to 
sort the results by one of the named columns.  Is there an easy way to do this?  asort 
didn't seem to do the trick, but maybe I'm not using it correctly.
 
Here's the commands:
 
asort($T);
reset($T);
foreach($T as $key => $value)
   foreach ($value as $key2 => $value2)
  print "$key) $key2 = $value2";
 
 
Here's the output...  See how the entries aren't sorted by the date?  That's what I'm 
trying to accomplish.
 
0) Date = 2003-11-11
0) Type = Adj.
0) ID = 31
0) OrderNum = 31
0) Qty = 1
1) Date = 2003-11-04
1) Type = PO
1) ID = 34
1) OrderNum = 107
1) Status = C
1) Qty = 1008
2) Date = 2003-11-05
2) Type = DO
2) ID = 218
2) OrderNum = 178
2) Status = C
2) Qty = 6
3) Date = 2003-11-05
3) Type = DO
3) ID = 222
3) OrderNum = 180
3) Status = C
3) Qty = 6
6) Date = 2003-11-11
6) Type = DO
6) ID = 261
6) OrderNum = 261
6) Status = O
6) Qty = 4
4) Date = 2003-11-12
4) Type = DO
4) ID = 223
4) OrderNum = 223
4) Status = O
4) Qty = 6
7) Date = 2003-11-12
7) Type = DO
7) ID = 271
7) OrderNum = 271
7) Status = O
7) Qty = 5
9) Date = 2003-11-12
9) Type = DO
9) ID = 299
9) OrderNum = 299
9) Status = O
9) Qty = 12
10) Date = 2003-11-12
10) Type = DO
10) ID = 314
10) OrderNum = 314
10) Status = O
10) Qty = 3
11) Date = 2003-11-13
11) Type = DO
11) ID = 315
11) OrderNum = 315
11) Status = O
11) Qty = 12
12) Date = 2003-11-13
12) Type = DO
12) ID = 325
12) OrderNum = 325
12) Status = O
12) Qty = 12
5) Date = 2003-11-14
5) Type = DO
5) ID = 252
5) OrderNum = 252
5) Status = O
5) Qty = 18
8) Date = 2003-11-14
8) Type = DO
8) ID = 291
8) OrderNum = 291
8) Status = O
8) Qty = 12
13) Date = 2003-11-15
13) Type = DO
13) ID = 364
13) OrderNum = 364
13) Status = C
13) Qty = 18
15) Date = 2003-11-15
15) Type = DO
15) ID = 381
15) OrderNum = 381
15) Status = C
15) Qty = 12
14) Date = 2003-11-18
14) Type = DO
14) ID = 374
14) OrderNum = 374
14) Status = O
14) Qty = 6
16) Date = 2003-11-05
16) Type = DO
16) ID = 218
16) OrderNum = 178
16) Status = C
16) CrossReference = Y
16) Qty = 6
17) Date = 2003-11-05
17) Type = DO
17) ID = 222
17) OrderNum = 180
17) Status = C
17) CrossReference = Y
17) Qty = 6
18) Date = 2003-11-15
18) Type = DO
18) ID = 364
18) OrderNum = 364
18) Status = C
18) CrossReference = Y
18) Qty = 18
19) Date = 2003-11-15
19) Type = DO
19) ID = 381
19) OrderNum = 381
19) Status = C
19) CrossReference = Y
19) Qty = 12

 
Thanks in advance for any information you have to help.
 
-Ed
 
 


Re: [PHP] Arrays and performance

2003-11-18 Thread Kim Steinhaug
Thanks for your reply!

Im going to use this for a backup system for our webstore system,
where some of our customers have *alot* of products. Given the
structure of the database with categories and images 5000 unique
products quickly gives 3x = 15000 arrays. But again, how often
would the client need to revert the backup? Ive never needed to
do it for now, but I still want to do this backup system in XML
(Looks kinda up to date, :), and at the same time know that it will
eventually work -> even for the customers that infact has alot
of products in their system.

The alternative, would be that customers with >x products would only
have access to mySQL dump. Or to have a script that evaluates the
XML file and prompts the user that this file is to  large for automatic
import / revert.

a)
>From what I understand of your answer you're telling me that PHP
itself will not have any "problems" working with 1.000.000.000 arrays,
aslong as there are enough ram and processing power available, and
that the timeout is extended. Or would the PHP die a painfull death
as soon as it gets "to much" data?
Could we coclude the follwing, XMLfile > 200 MB = No PHP!

b)
I should do some benchmarking, to find the "magic" marker for how
much XML data that is "affordable" to grab when done on a webserver
with other clients to prevent angry customers or failures due to
factory timeout setting to 30 secs.

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


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I belive PHP should be able to handle it but it's a bad idea. The reason
> being your app will not scale. Because if you script consumes 2mb of
> memory on average, 100 users accesing it at the same time will be 200Mb.
> Of course if you expect only a small number of users it does not matter.
>
> The biggest XML job i have handled with PHP is parsing the ODP RDF dump
> which is around 700MB. Obviously arrays are out of the question in such
> a scenario, even though only one user will be accessing the script at a
> given moment. the ODP dump has a couple of million records
>
>
>
> Kim Steinhaug wrote:
>
> >Something Ive wondered about as I started working with XML.
> >Importing huge XML files, and converting theese to arrays works
> >indeed very well. But I am wondering if there are any limits to
> >how many arrays the PHP can handle when performance is accounted for.
> >
> >Say I create an array from a XML with lots of childs, say we are
> >talking of upto 10 childs, which would give 10 dimensional arrays.
> >Say we then have 10.000 records, or even 100.000 records.
> >
> >Will this be a problem for PHP to handle, or should I break such
> >a prosess into lesser workloads (meaning lesser depth in the array)?
> >
> >Anyone with some experience on this?
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.

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



RE: [PHP] onClick

2003-11-18 Thread Vail, Warren
onClick="this.form.submit();" will trigger a response from your form
processing routine, as specified in the form action="myprogram.php".

Warren Vail

-Original Message-
From: Dan McCullough [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 2:42 PM
To: Php-General
Subject: [PHP] onClick


I want an event to get triggered when using onClick, but the event will be
MySQL delete/update/insert so how would I go about doing that?

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



[PHP] Re: Command line output

2003-11-18 Thread Shawn McKenzie
hey great thanks :(

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> O.K.  I am just now experimenting with the CLI PHP and have another
> question.  With the following code, none of the echo output is seen until
> the script completes.  I even tried adding a flush() after the first echo
> before the imap_open, but still the same behavior.  Any ideas?
>
> echo "Connecting to $server: $mbox ...\n\n";
> $conn = imap_open("{" . $server . ":143/notls/norsh}" . $mbox, $user,
> $pass);
>
> echo "Receiving messages ...\n\n";
> for ($i = 1; $i <= imap_num_msg($conn); $i++) {
> ...etc...
>
> Thanks!
> -Shawn

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



Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread b b

 Some people don't read carefully before responding. I
didn't say he sent me a private email!!! Anyway it
would be appropriate not to forget to take out the
email addresses other than the php-general... when
clicking reply-all. I just don't see how someone who
forgets and includes your address (so that you get
duplicate responses, 8 from this person so far)
complains that you replied to the wrong version. And
he does it in the general list. That is not right.

 


--- John Nichel <[EMAIL PROTECTED]> wrote:
> b b wrote:
> >  What???
> >  You ahve sent me like three private emails. You
> did
> > reply all which sends me a private message and a
> > message from the list. I replied to the one that
> had
> > only your email address in it by mistake.  mama
> mia
> 
>  From what I've seen, Jay has had both your email
> address AND the list 
> address on his replies.  He's not being rude by
> asking this, he's asking 
> this to help someone who may have this problem in
> the future.  If you 
> reply/find a solution off list, it won't be
> archived, therefore it will 
> not be searchable by future users.
> 
> 
> Of course, this would have so much more meaning if
> people actually 
> searched the archives.
> 
> 
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



[PHP] onClick

2003-11-18 Thread Dan McCullough
I want an event to get triggered when using onClick, but the event will be
MySQL delete/update/insert so how would I go about doing that?

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

Re: [PHP]{OT} Prefilled forms

2003-11-18 Thread John Nichel
b b wrote:
 What???
 You ahve sent me like three private emails. You did
reply all which sends me a private message and a
message from the list. I replied to the one that had
only your email address in it by mistake.  mama mia
From what I've seen, Jay has had both your email address AND the list 
address on his replies.  He's not being rude by asking this, he's asking 
this to help someone who may have this problem in the future.  If you 
reply/find a solution off list, it won't be archived, therefore it will 
not be searchable by future users.


Of course, this would have so much more meaning if people actually 
searched the archives.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to print nice looking text on an image?

2003-11-18 Thread Kevin Stone
Hello,
 
I am producing a script that writes text onto a JPEG image to create
custom printable gift certificates for an online store.  The basics of
the scripts are straight forward.  However I found that the
imagestring() function produces absolutely horrible looking pixelized
text and on these gift certificates looks are important.  I attempted to
employ the imagepstext() family of functions but they do not appear to
be installed on this account (it's a shared server), I'm getting "call
to undefined function" errors.
 
So my question is; Is there any other way to produce good looking
anti-aliased text on an image?  I'd appreciate any information, classes
and links to guides you can point me to.
 
Thanks!
Kevin Stone
[EMAIL PROTECTED]
 


RE: [PHP] Anti Anti-Template Commentary :)

2003-11-18 Thread Chris W. Parker
Robert Cummings 
on Tuesday, November 18, 2003 1:05 PM said:

> You might want to take the above article with a HUGE grain of salt. It
> over generalizes and pretty much slots all template systems into the
> same category. One of it's large claims is the overhead of the
> template system itself and that PHP is a templating system itself.

[snip]

Thanks for the write up Robert.


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] Prefilled forms

2003-11-18 Thread b b

 Actually I am going back to the same URL. I am
thinking it is an apache conf setting. See after I
submit this email I can click back and will see the
text that I am writing right now. If that form was
coming from my server, it would be empty I am sure.

 Problem again: I have a form, fill it, click submit,
then immidiately click back. Usually I see the data
that I attempted to submit but on my server it shows a
blank form.

Cheers.

--- "Vail, Warren" <[EMAIL PROTECTED]> wrote:
> From my experience, Jay's explanations are correct,
> but let me try another
> tack.
> 
> It is my understanding that when you press the back
> button on a browser, the
> browser tries to present the page the same way it
> presented it the first
> time it was presented, from information it saved in
> it's history stack.
> When you came to this page the first time, it
> presented an empty form.  When
> you go back to the same URL (using the back button)
> it presents the same
> empty form.
> 
> When you press the submit button, you are probably
> telling the browser to
> post your filled in data to a different URL, and the
> back button takes you
> away from that URL to the one with the empty form. 
> It may be possible to
> fake out the browser, by having it post form data to
> the same URL as the one
> presenting the empty form, but I would be surprised
> if that worked the same
> for all browsers.  Perhaps this is the situation
> where you saw it appear to
> retain your data.
> 
> So much for the problem you are encountering, one of
> your next challenges
> will be the following;
> 
> If you enter a page with a POST as in the submission
> of a form with a method
> of post, and then click submit on that page, going
> on to a third page (again
> with a post), and then click the back button, most
> browsers will complain
> (both IE and Netscape do).  Seems that if a URL was
> entered via a "post" and
> you manage to click back to that same page, the
> browser appears to not save
> enough information to re-present the page, and will
> ask you to click the
> refresh button.  For this reason, I make it a
> practice of directing all my
> forms to one URL that will process the form data,
> and then redirect the
> browser to a new url (see the header function) for
> presenting the next page.
> This causes the browser to replace the "post" url
> with the redirection url
> (always a get), so that the back button will only
> remember the redirected or
> get pages.  I haven't found a more elegant solution,
> so if there is another
> out there, I'd appreciate hearing about it.
> 
> good luck,
> 
> Warren Vail
> 
> -Original Message-
> From: Jay Blanchard
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 18, 2003 1:09 PM
> To: b b; [EMAIL PROTECTED]
> Subject: RE: [PHP] Prefilled forms
> 
> 
> [snip]
>  I don't think you understood my question. Off
> course
> you have to store data in a database  or a session
> var
> if you want to retrieve them later on.
> 
>  My problem is not there. I hava a form, I click
> submit and right after that I hit back. Usually in
> most cases the form will be prefilled with what I
> entered. In my case I am getting a totally blank
> form.
> This is only hapenning with forms from my server. 
> [/snip]
> 
> This AFAIK is the expected behaviour. Once you have
> submitted the form
> all of the input values will be blank when you
> return to the form unless
> you do something to specifically reload the
> variables into the form.
> YMMV from OS to OS, browser to browser. There is
> only one realiable way
> to do it cross-platform and these were mentioned
> above. You never
> mentioned your server config, your browser, your OS,
> so I am only making
> a S.W.A.G. at it. There is nothing IIRC that you can
> configure in the
> php.ini, httpd.conf, or other configuration file.
> You may have a browser
> setting that affects this, but since we know not
> your browser type it
> would be hard to help you locate that.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] how to trap eval error?

2003-11-18 Thread CPT John W. Holmes
From: "david" <[EMAIL PROTECTED]>
> Cpt John W. Holmes wrote:
> > From: "david" <[EMAIL PROTECTED]>
> >
> >> i found a solution (hopefully) with:
> >>
> >> if(function_exists($function)){
> >> eval('$return = $function($input);');
> >> }else{
> >> // function does not exists
> >> }
> >>
> >> which works quit nicely for now. not sure if that's a good thing to do.
> >
> > Why not just do this:
> >
> > if(function_exists($function))
> > { $return = $function($input); }
> > else
> > { //function does not exist; }
> >
>
> because i didn't know PHP can do that. thanks for the tip! any differences
> between the 2 version in turns of performance and safety?

You're not invoking eval() for one thing and there's less of a security risk
compared to passing variables into an eval() function.

---John Holmes...

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



RE: [PHP]{OT} Prefilled forms

2003-11-18 Thread b b

 What???
 You ahve sent me like three private emails. You did
reply all which sends me a private message and a
message from the list. I replied to the one that had
only your email address in it by mistake.  mama mia

--- Jay Blanchard
<[EMAIL PROTECTED]> wrote:
> [snip]
> > Have you consulted an Apache list? Googled for
> > answers? Anything like
> > that?
> 
>  No, this sounded like a basic thing. I can't
> believe
> I having to deal with it. See even if I submit this
> email and then click back I will see exactly what I
> typed. If that form was originating from my server
> it
> would probably be blank.
> [/snip]
> 
> Please do not privately respond to list mails unless
> asked specifically
> to do so as the person you respond to may not be
> available to help.
> 
> Please google for an answer to this, do some
> research yourself. See what
> you can find.


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



RE: [PHP] Array + postgresql + braincramp

2003-11-18 Thread Giz
While you can use an array type in postgresql, in most cases I'd recommend
against it.  This is basically a repeating group, and in a relational
database the proper way to handle this type of need would be to have a
related table with a Many to 1 relationship back to the parent table.

If you are intent on using the array type, I believe your insert syntax
requires that the values be provided like so


In insert: values ('{value1, value2, .. value_n}' etc
In update: Set Columnname = '{value1, value2, .. value_n}'

-Original Message-
From: Roy Cabaniss [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 18, 2003 12:55 PM
To: List PHP General
Subject: [PHP] Array + postgresql + braincramp

The problem is most likely that I have been looking at it for too long

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



Re: [PHP] sorting an array of regexes

2003-11-18 Thread Adam i Agnieszka Gasiorowski FNORD
Curt Zirzow wrote:
 
> * Thus wrote Adam i Agnieszka Gasiorowski FNORD ([EMAIL PROTECTED]):
> > Eugene Lee wrote:
> >
> > > On Tue, Nov 18, 2003 at 01:15:32PM +0100, Adam i Agnieszka Gasiorowski FNORD 
> > > wrote:
> > > :
> > > :   There is an array of regexes, for example
> > > :
> > > :  $array = array('moon', '[wh]ood', '[^as]eed' ...
> > > :  (about 300 entries).
> > > :
> > > :   I want to sort it comparing to the
> > > :  character lenght of a regex. For example
> > > :  [wh]ood is 4 characters, moon is 4 characters.
> > > :  There are only letters of the alphabet and
> > > :  letter ranges present in those regexes. I
> > > :  want the "longest" ones first.
> > > :
> > > :   How would you write the sorting function?
> > >
> > > This might be the most functionally correct, although it's definitely
> > > not the fastest route.
> >
> >  Thank you, that will certainly work :8]. Does
> >  anyone have any thoughts how to make it faster? It is
> >  not VERY critical, because the calculation will be
> >  done only once, at initialization, but...well, you
> >  know :8].
> 
> Do these change all the time or are they rather static?  I would
> suggest using this routine to generate the list to be used in your
> program, instead of doing this on the fly.

Good idea...

-- 
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne kształty... http://www.opera.com 007

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



Re: [PHP] how to trap eval error?

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 02:03:25PM -0800, david wrote:
: 
: Cpt John W. Holmes wrote:
: 
: > From: "david" <[EMAIL PROTECTED]>
: >> 
: >> if(function_exists($function)){
: >> eval('$return = $function($input);');
: >> }else{
: >> // function does not exists
: >> }
: >> 
: >> which works quit nicely for now. not sure if that's a good thing to do.
: > 
: > Why not just do this:
: > 
: > if(function_exists($function))
: > { $return = $function($input); }
: > else
: > { //function does not exist; }
: 
: because i didn't know PHP can do that. thanks for the tip! any differences 
: between the 2 version in turns of performance and safety?

You don't have to invoke eval()), and you don't have to worry about
quoting issues in eval().

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



Re: [PHP] Prefilled forms

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 01:24:23PM -0800, b b wrote:
: 
:  The Problem again:
:  I have a form, I fill it, click submit and then hit
: back. Usually in other sites I see the data that I
: attempted to submit. Forms originating from my site
: are  coming up blank.

So what do you see if you put a print_r($_POST) in your form handler?

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



Re: [PHP] =sessions / J. Meloni Textbook=

2003-11-18 Thread CPT John W. Holmes
Anthony Ritter wrote:

> The following code is from "PHP, mySQL and Apache" (SAMS) by Julie Meloni.
[snip]
> if (isset($_POST[form_products])) {
> if (!empty($_SESSION[products])) {
> $products = array_unique(
> array_merge(unserialize($_SESSION[products]),
> $_POST[form_products]));
>}
> $_SESSION[products] = serialize($products);

I know you're working from a book, but for future reference, there's no
reason to serialize $products before storing it in the session. The whole
session array is going to be serialized at the end of the script, anyhow.
You can assign it directly to the session as an array and work with it as an
array on the following pages, too.

if (isset($_POST[form_products])) {
if (!empty($_SESSION[products])) {
$products = array_unique(
array_merge($_SESSION[products],
$_POST[form_products]));
   }
$_SESSION[products] = $products;

Then to recreate your $products array on other pages, you can either go the
easy route and just use the $_SESSION['products'] array... or use:

$products = $_SESSION['products'];

There's really no reason to have a $products variable to begin with,
actually. You can work directly with the $_SESSION['products'] variable,
adding and removing things from it and it'll always be available...

---John Holmes...

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



Re: [PHP] syntax problem, constants in quoted strings

2003-11-18 Thread Marek Kilimajer
Adam i Agnieszka Gasiorowski FNORD wrote:
How do you insert a constant into a quoted
 string, do I need to use concatenation operator
 like this

"quoted string" . CONSTANT . "quoted string",
Yes

 or there is some way to insert it inline, like
 normal variables?
No

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


Re: [PHP] how to trap eval error?

2003-11-18 Thread david
Cpt John W. Holmes wrote:

> From: "david" <[EMAIL PROTECTED]>
> 
> 
>> i found a solution (hopefully) with:
>> 
>> if(function_exists($function)){
>> eval('$return = $function($input);');
>> }else{
>> // function does not exists
>> }
>> 
>> which works quit nicely for now. not sure if that's a good thing to do.
> 
> Why not just do this:
> 
> if(function_exists($function))
> { $return = $function($input); }
> else
> { //function does not exist; }
> 

because i didn't know PHP can do that. thanks for the tip! any differences 
between the 2 version in turns of performance and safety?

david

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



RE: [PHP]{OT} Prefilled forms

2003-11-18 Thread Jay Blanchard
[snip]
> Have you consulted an Apache list? Googled for
> answers? Anything like
> that?

 No, this sounded like a basic thing. I can't believe
I having to deal with it. See even if I submit this
email and then click back I will see exactly what I
typed. If that form was originating from my server it
would probably be blank.
[/snip]

Please do not privately respond to list mails unless asked specifically
to do so as the person you respond to may not be available to help.

Please google for an answer to this, do some research yourself. See what
you can find.

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



Re: [PHP] how to trap eval error?

2003-11-18 Thread CPT John W. Holmes
From: "david" <[EMAIL PROTECTED]>


> i found a solution (hopefully) with:
> 
> if(function_exists($function)){
> eval('$return = $function($input);');
> }else{
> // function does not exists
> }
> 
> which works quit nicely for now. not sure if that's a good thing to do.

Why not just do this:

if(function_exists($function))
{ $return = $function($input); }
else
{ //function does not exist; }

---John Holmes...

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



RE: [PHP] Prefilled forms

2003-11-18 Thread Vail, Warren
>From my experience, Jay's explanations are correct, but let me try another
tack.

It is my understanding that when you press the back button on a browser, the
browser tries to present the page the same way it presented it the first
time it was presented, from information it saved in it's history stack.
When you came to this page the first time, it presented an empty form.  When
you go back to the same URL (using the back button) it presents the same
empty form.

When you press the submit button, you are probably telling the browser to
post your filled in data to a different URL, and the back button takes you
away from that URL to the one with the empty form.  It may be possible to
fake out the browser, by having it post form data to the same URL as the one
presenting the empty form, but I would be surprised if that worked the same
for all browsers.  Perhaps this is the situation where you saw it appear to
retain your data.

So much for the problem you are encountering, one of your next challenges
will be the following;

If you enter a page with a POST as in the submission of a form with a method
of post, and then click submit on that page, going on to a third page (again
with a post), and then click the back button, most browsers will complain
(both IE and Netscape do).  Seems that if a URL was entered via a "post" and
you manage to click back to that same page, the browser appears to not save
enough information to re-present the page, and will ask you to click the
refresh button.  For this reason, I make it a practice of directing all my
forms to one URL that will process the form data, and then redirect the
browser to a new url (see the header function) for presenting the next page.
This causes the browser to replace the "post" url with the redirection url
(always a get), so that the back button will only remember the redirected or
get pages.  I haven't found a more elegant solution, so if there is another
out there, I'd appreciate hearing about it.

good luck,

Warren Vail

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 1:09 PM
To: b b; [EMAIL PROTECTED]
Subject: RE: [PHP] Prefilled forms


[snip]
 I don't think you understood my question. Off course
you have to store data in a database  or a session var
if you want to retrieve them later on.

 My problem is not there. I hava a form, I click
submit and right after that I hit back. Usually in
most cases the form will be prefilled with what I
entered. In my case I am getting a totally blank form.
This is only hapenning with forms from my server. 
[/snip]

This AFAIK is the expected behaviour. Once you have submitted the form
all of the input values will be blank when you return to the form unless
you do something to specifically reload the variables into the form.
YMMV from OS to OS, browser to browser. There is only one realiable way
to do it cross-platform and these were mentioned above. You never
mentioned your server config, your browser, your OS, so I am only making
a S.W.A.G. at it. There is nothing IIRC that you can configure in the
php.ini, httpd.conf, or other configuration file. You may have a browser
setting that affects this, but since we know not your browser type it
would be hard to help you locate that.

-- 
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] Prefilled forms

2003-11-18 Thread Jay Blanchard
[snip]
 I am suspecting a php.ini setting that I have set or
set off or an apache conf detail that is causing this.
Bowser setting is a possibility but why then is it not
behaving this way with other sites?
[/snip]

PHP, being a server side language, probably has nothing to do with this.
Have you consulted an Apache list? Googled for answers? Anything like
that?

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



Re: [PHP] Prefilled forms

2003-11-18 Thread Nathan Taylor
This shouldn't have anything to do with your server config, but rather the forms 
themselves.

What method are you sending the form(s) with?

Nathan
  - Original Message - 
  From: b b 
  To: Jay Blanchard ; [EMAIL PROTECTED] 
  Sent: Tuesday, November 18, 2003 4:24 PM
  Subject: RE: [PHP] Prefilled forms




   The Problem again:
   I have a form, I fill it, click submit and then hit
  back. Usually in other sites I see the data that I
  attempted to submit. Forms originating from my site
  are  coming up blank.

  In respnonse to your reply:
   I am using mozilla 5 or netscape 7. Same result in
  both. However, this doesn't happen with other sites
  using the same borwser ... Actually this never
  happened with my last configuration. ONly now that I
  reinstalled apache/php and actually linux that I am
  getting this behaviour from my own server only.

   I am suspecting a php.ini setting that I have set or
  set off or an apache conf detail that is causing this.
  Bowser setting is a possibility but why then is it not
  behaving this way with other sites?




  --- Jay Blanchard
  <[EMAIL PROTECTED]> wrote:
  > [snip]
  >  I don't think you understood my question. Off
  > course
  > you have to store data in a database  or a session
  > var
  > if you want to retrieve them later on.
  > 
  >  My problem is not there. I hava a form, I click
  > submit and right after that I hit back. Usually in
  > most cases the form will be prefilled with what I
  > entered. In my case I am getting a totally blank
  > form.
  > This is only hapenning with forms from my server. 
  > [/snip]
  > 
  > This AFAIK is the expected behaviour. Once you have
  > submitted the form
  > all of the input values will be blank when you
  > return to the form unless
  > you do something to specifically reload the
  > variables into the form.
  > YMMV from OS to OS, browser to browser. There is
  > only one realiable way
  > to do it cross-platform and these were mentioned
  > above. You never
  > mentioned your server config, your browser, your OS,
  > so I am only making
  > a S.W.A.G. at it. There is nothing IIRC that you can
  > configure in the
  > php.ini, httpd.conf, or other configuration file.
  > You may have a browser
  > setting that affects this, but since we know not
  > your browser type it
  > would be hard to help you locate that.


  __
  Do you Yahoo!?
  Protect your identity with Yahoo! Mail AddressGuard
  http://antispam.yahoo.com/whatsnewfree

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



RE: [PHP] Prefilled forms

2003-11-18 Thread b b


 The Problem again:
 I have a form, I fill it, click submit and then hit
back. Usually in other sites I see the data that I
attempted to submit. Forms originating from my site
are  coming up blank.

In respnonse to your reply:
 I am using mozilla 5 or netscape 7. Same result in
both. However, this doesn't happen with other sites
using the same borwser ... Actually this never
happened with my last configuration. ONly now that I
reinstalled apache/php and actually linux that I am
getting this behaviour from my own server only.

 I am suspecting a php.ini setting that I have set or
set off or an apache conf detail that is causing this.
Bowser setting is a possibility but why then is it not
behaving this way with other sites?




--- Jay Blanchard
<[EMAIL PROTECTED]> wrote:
> [snip]
>  I don't think you understood my question. Off
> course
> you have to store data in a database  or a session
> var
> if you want to retrieve them later on.
> 
>  My problem is not there. I hava a form, I click
> submit and right after that I hit back. Usually in
> most cases the form will be prefilled with what I
> entered. In my case I am getting a totally blank
> form.
> This is only hapenning with forms from my server. 
> [/snip]
> 
> This AFAIK is the expected behaviour. Once you have
> submitted the form
> all of the input values will be blank when you
> return to the form unless
> you do something to specifically reload the
> variables into the form.
> YMMV from OS to OS, browser to browser. There is
> only one realiable way
> to do it cross-platform and these were mentioned
> above. You never
> mentioned your server config, your browser, your OS,
> so I am only making
> a S.W.A.G. at it. There is nothing IIRC that you can
> configure in the
> php.ini, httpd.conf, or other configuration file.
> You may have a browser
> setting that affects this, but since we know not
> your browser type it
> would be hard to help you locate that.


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



RE: [PHP] Anti Anti-Template Commentary :)

2003-11-18 Thread Jay Blanchard
[snip]
I don't want to debate this topic though... There's always going to be
those who'd rather write PHP code, and those who want to use pre-made
systems.
[/snip]

+1

It's a matter of choice, and even those that use templating systems do
not use them 100% of the time.

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



Re: [PHP] mcrypt libraries?

2003-11-18 Thread Jas
Curt Zirzow wrote:
* Thus wrote Jas ([EMAIL PROTECTED]):

I am not sure if I should post my question here but I will anyways.

Ok, I have compiled the mcrypt libraries on a Redhat 9 box running 
apache 2 with php4.  And I need to know the next step(s) in getting php 
to use the libmcrypt libraries.  If anyone has set this up in the past 
or has some pointers (other than reading the manual) I would appreciate it.


Did you read the next step: Installation
  http://php.net/mcrypt
Curt
Yes I have and I guess I was looking for a method of using the libmcrypt 
library without having to recompile php. Sorry for the confusion.

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


RE: [PHP] Anti Anti-Template Commentary :)

2003-11-18 Thread Robert Cummings
On Tue, 2003-11-18 at 16:14, Dan Joseph wrote:
> Hi,
> 
> > First off I'd like to agree that PHP "can" be used as a templating
> > system, but providing some of the functionality available in many of the
> 
>   As can any programming language if you think about it.  I don't want to
> debate this topic though.  I'll let the wolves jump in and shred you.
> hehe..  I think its kind of like debating gambling.  There's always going to
> be those who'd rather write PHP code, and those who want to use pre-made
> systems.

The wolves have blunt teeth, I'm ready with my claws :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Prefilled forms

2003-11-18 Thread Jay Blanchard
[snip]
 I don't think you understood my question. Off course
you have to store data in a database  or a session var
if you want to retrieve them later on.

 My problem is not there. I hava a form, I click
submit and right after that I hit back. Usually in
most cases the form will be prefilled with what I
entered. In my case I am getting a totally blank form.
This is only hapenning with forms from my server. 
[/snip]

This AFAIK is the expected behaviour. Once you have submitted the form
all of the input values will be blank when you return to the form unless
you do something to specifically reload the variables into the form.
YMMV from OS to OS, browser to browser. There is only one realiable way
to do it cross-platform and these were mentioned above. You never
mentioned your server config, your browser, your OS, so I am only making
a S.W.A.G. at it. There is nothing IIRC that you can configure in the
php.ini, httpd.conf, or other configuration file. You may have a browser
setting that affects this, but since we know not your browser type it
would be hard to help you locate that.

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



RE: [PHP] Anti Anti-Template Commentary :)

2003-11-18 Thread Dan Joseph
Hi,

> First off I'd like to agree that PHP "can" be used as a templating
> system, but providing some of the functionality available in many of the

As can any programming language if you think about it.  I don't want to
debate this topic though.  I'll let the wolves jump in and shred you.
hehe..  I think its kind of like debating gambling.  There's always going to
be those who'd rather write PHP code, and those who want to use pre-made
systems.

-Dan Joseph

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



[PHP] syntax problem, constants in quoted strings

2003-11-18 Thread Adam i Agnieszka Gasiorowski FNORD

How do you insert a constant into a quoted
 string, do I need to use concatenation operator
 like this

"quoted string" . CONSTANT . "quoted string",

 or there is some way to insert it inline, like
 normal variables?

-- 
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne kształty... http://www.opera.com 007

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



[PHP] Anti Anti-Template Commentary :)

2003-11-18 Thread Robert Cummings
This could end up a heated debate, so jump on in and get your feet wet.

Originating from a response to: [Q] Development Best Practices

On Tue, 2003-11-18 at 09:09, Luis Lebron wrote:
> Before considering using templates you may want to take a look at 
> 
> http://www.phppatterns.com/index.php/article/articleview/4/1/1/
> 

You might want to take the above article with a HUGE grain of salt. It
over generalizes and pretty much slots all template systems into the
same category. One of it's large claims is the overhead of the template
system itself and that PHP is a templating system itself.

First off I'd like to agree that PHP "can" be used as a templating
system, but providing some of the functionality available in many of the
dedicated template frameworks will require you to jump through hoops
(often jumped through for you by Smarty or InterJinn, or , and once again you, or your designer will be
using PHP (fine if that's ok with you).

The argument that there is performance loss from the template system
strongly depends on the the model used. For instance in my own (yes I
have my own so I am probably biased, but I make logical arguments here
that you can feel free to debate) the templates are compiled to pure PHP
which results in a performance gain since many content includes no
longer need to occur at run time. Arguably there is a bit of performance
loss in InterJinn though since it is also an application framework and
thus has a lightweight architecture to load first. But InterJinn can be
used for templates without the application portion and in those cases
would outperform templating via PHP using the below style:



Now to address the supposed "Deadly Sins of Templating" as layed out in
the following link:

http://www.phppatterns.com/index.php/article/articleview/4/1/1/

"PHP is too complicated for web designers. They just want HTML!"


Here the author attempts to prove that because Smarty offers conditional
steps that you have reverted back to rewriting PHP. To some extent you
have, but really, conditional operators are provided to allow display
logic (not to be confused with business logic which is what the author
mixes it up with). Generally speaking you should not have a lot of
display logic, but regardless, it is specific to the content, not to any
database queries, news feed parsing, etc. etc. In my own case of
interjinn I also supply very limitted conditional tags (I created a tag
system since it reflects the HTML style):


Some content for authenticated users only.


Content for non authenticated users.


This style allows any PHP expression in the test attribute, but the
framework also allows retrieval of complex data saved within InterJinn
components via the embed syntax.

"It seperates code from content!".
--

Here the author argues that the code and content are not separated. Once
again he attempts to confuse the reader by implicating the use of loops
as business logic, which once again is not true. Simple looping over the
contents of an array to format the contents is display logic, not
business logic. However if you were to iterate through a series of URLs
and retrieve the data then display it, that would be business logic.
here the author also argues that the template HAS to interact with the
code, this is not true, the content should only have to interact with
the data. I'll give credit to the author that most template system do
need to interact with code at some point, but once again InterJinn does
not. For instance in Smarty you need to load a new Smarty object,
populate the object with data, then tell the object to render a given
template. In InterJinn the approach is reversed. You include modules and
components into your template via tags, then you can access data in the
component via tags. The components know nothing about the template in
which they reside. The following example illustrates this:

---






---

The above is one style which would generally have the entire HTML output
for the news feed to be output via the render component; however, the
following micro managed style would also be available if the component
sets up the data:

---






The following news articles were retrieved today:




{jinn:getValue type="foreach" name="feeds" path="title"}


{jinn:getValue type="foreach" name="feeds" path="title"}




---

As you can see from the above, no business logic exists, only content
logic. And all data is manipulated via tags or embeds. Admittedly
though, this is possible because of the relationship between the
InterJinn framework and the TemplateJinn framework. Smarty and many
other

[PHP] Array + postgresql + braincramp

2003-11-18 Thread Roy Cabaniss
The problem is most likely that I have been looking at it for too long
and missed the obvious.  I know I can make multiple fields in the
database and work with it that way, but I'm sure an array is the proper
solution.

We have a form (and how many of our tales start off like that?  Bet it
beats "once upon a time"). which gathers data for work orders.  And we
want to assign multiple people to a particular job.


Worker0
Worker1
Worker2
Worker3


With the values being the employee/student id number.  The values for
workers[ ] are passed along with the rest of the input from the form via
a post statement.

When I get to processing page I checked to see if there was data via
some echo's and it does indeed seem as though the data made it through.

echo "$workers[0] ";
echo "$workers[1] "; 

(each returns the values expected)

In the dataset (postgresql) I defined workers as integer [ ] so it
should be able to receive the data and it should be an array of
integers.

My update statement is as follows:

$update_now="UPDATE work_orders SET 
add_info2='$add_info2',
status='$status',
workers =$workers,  
when_assigned='$now'   
where work_order_id='$work_id'
";

which gives the following error message.

UPDATE work_orders SET add_info2='fagsh', status='Working', workers
=Array, when_assigned='1069188482' where work_order_id='1'
[nativecode=ERROR: Attribute "array" not found ].

When I try imploding $workers, converting it to a string and putting
that into workers it tells me the following.

UPDATE work_orders SET add_info2='qwer', status='Working', workers =83,
when_assigned='1069188871' where work_order_id='1' [nativecode=ERROR:
column "workers" is of type integer[] but expression is of type integer
You will need to rewrite or cast the expression ]

Any and all advice/help much appreciated.
-- 
Dr. Roy F. Cabaniss
Associate Professor of Marketing
University of Arkansas Monticello
http://cabanisspc.uamont.edu


signature.asc
Description: This is a digitally signed message part


RE: [PHP] Prefilled forms

2003-11-18 Thread b b

 I don't think you understood my question. Off course
you have to store data in a database  or a session var
if you want to retrieve them later on.

 My problem is not there. I hava a form, I click
submit and right after that I hit back. Usually in
most cases the form will be prefilled with what I
entered. In my case I am getting a totally blank form.
This is only hapenning with forms from my server. 

 

Cheers,
R.
--- Jay Blanchard
<[EMAIL PROTECTED]> wrote:
> [snip]
>  I have installed linux/apache/php (again) recently
> on my machine. When
> I run an application off my server, fill out a form,
> submit it and then
> click back to edit some entries, the form comes up
> blank. This happen
> for apps running off my server only. Is it something
> with my php.ini, or
> is it an apache setting ... It is making debugging
> very hard. Anybody
> seen this problem before?
> [/snip]
> 
> Yes, several of us have seen it, many times in fact.
> Imagine that.
> Browsers, being the stateless wonders that they are,
> do not 'maintain'
> the information. You have some choices through.
> Retrieve the variables
> from the database, save them in a session variable
> and retrieve them
> from there, or do some other imaginative method of
> 'maintaining' the
> variables until you are done with this particular
> group of variables.
> 
> I invite you to STFW and STFA for the answers to
> your dilemna. Have a
> pleasant day and happy coding!!
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



Re: [PHP] what ever happened to http referrer

2003-11-18 Thread Jonathan Villa
nevermind...

doh!

On Tue, 2003-11-18 at 14:44, Jonathan Villa wrote:
> I'm running php 4.3.4 and do not see any mention of HTTP_REFERRER.  I
> tried $_SERVER['HTTP_REFERRER'] which is what I thought it was but to no
> avail.
> 
> Any comments on the location/status of this?

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



RE: [PHP] what ever happened to http referrer

2003-11-18 Thread Johnson, Kirk
> I'm running php 4.3.4 and do not see any mention of HTTP_REFERRER.  I
> tried $_SERVER['HTTP_REFERRER'] which is what I thought it 
> was but to no
> avail.
> 
> Any comments on the location/status of this?

You spell too well, try "HTTP_REFERER", without the double "R" ;)

Kirk

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



[PHP] what ever happened to http referrer

2003-11-18 Thread Jonathan Villa
I'm running php 4.3.4 and do not see any mention of HTTP_REFERRER.  I
tried $_SERVER['HTTP_REFERRER'] which is what I thought it was but to no
avail.

Any comments on the location/status of this?

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



RE: [PHP] Prefilled forms

2003-11-18 Thread Jay Blanchard
[snip]
 I have installed linux/apache/php (again) recently on my machine. When
I run an application off my server, fill out a form, submit it and then
click back to edit some entries, the form comes up blank. This happen
for apps running off my server only. Is it something with my php.ini, or
is it an apache setting ... It is making debugging very hard. Anybody
seen this problem before?
[/snip]

Yes, several of us have seen it, many times in fact. Imagine that.
Browsers, being the stateless wonders that they are, do not 'maintain'
the information. You have some choices through. Retrieve the variables
from the database, save them in a session variable and retrieve them
from there, or do some other imaginative method of 'maintaining' the
variables until you are done with this particular group of variables.

I invite you to STFW and STFA for the answers to your dilemna. Have a
pleasant day and happy coding!!

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



[PHP] PHP 4.3.1 (Suse 8.2 RPM) and LDAP problem

2003-11-18 Thread Patrique Wolfrum
Hello,

My PHP-problem is, that I can't bind to a LDAP-Server, although 
ldap_connect seems to work. The script is intended for an 
authentification of web-users (which enter their username and password) 
by sending this data to a central ldap-server.
Openldap 2.1.12+Libs (Suse RPM) and OpenSSL (Suse RPM) are installed.

On the server which acted as "authentification server" (Redhat 9.0 (php 
4.2.2)) the same script works quite fine.

The firewall we use is configured with the same settings for our main 
server which I used for the "authentification server", so the connection 
should work from that part. The ports 389 and 636 are free if the 
connection goes to one of the two ldap-servers mentioned below.

My script looks the following way:

---

$uid = $HTTP_POST_VARS['uid'];
$ldappass = $HTTP_POST_VARS['passwd'];
$basedn = 'dc=xxx, dc=de';
$ldaprdn  = 'uid='.$uid.', ou=xxx, dc=xxx, dc=de';
$ldapserver1 = 'ldaps://xxx.xxx.xxx.de';
$ldapserver2 = 'ldaps://xxx.xxx.xxx.de';

// connect to ldap server
$ldapconn = ldap_connect($ldapserver1) or die("Es konnte keine 
Verbindung mit dem LDAP-Server aufgebaut werden. Versuchen Sie es bitte 
spaeter nochmals");

if ($ldapconn) {

$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

if ($ldapbind) { 



Beyond the $ldapbind line, several attributes are requested from the 
LDAP-server and used for statistical-information.

The script works until it reaches the $ldapbind = ldap_bind line, then I 
get the following message:



Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP 
server in //authenticate.php on line 22



Tests with ldap_error show the following results:

ldap_connect: A resource ID
ldap_bind: success

(The latter is the most confusing one for me)

I looked at the PHP-documentation and searched via google, but I could 
find any clue, which could get this script going again.

How can I further determine, why the ldap_bind doesn't work properly ?

Thank you very much in advance.

With best regards.
Patrique Wolfrum

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



[PHP] Prefilled forms

2003-11-18 Thread b b

 Hi there,
 I have installed linux/apache/php (again) recently on
my machine. When I run an application off my server,
fill out a form, submit it and then click back to edit
some entries, the form comes up blank. This happen for
apps running off my server only. Is it something with
my php.ini, or is it an apache setting ... It is
making debugging very hard. Anybody seen this problem
before?

 Thankyou dearly.


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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



RE: [PHP] how to trap eval error?

2003-11-18 Thread david
Jay Blanchard wrote:

> [snip]
> eval('$return = $function($input);');
> [/snip]
> 
> The problem is the quotes...the string is not truly being eval'd. Change
> to double quotes
> 
> eval("$return = $function($input);");

thanks for the tip but i am sure you mean:

eval("\$return = \$function(\$input);");

otherwise the variables gets expanded before they get to eval and i end up 
with a syntax error. i found a solution (hopefully) with:

if(function_exists($function)){
eval('$return = $function($input);');
}else{
// function does not exists
}

which works quit nicely for now. not sure if that's a good thing to do.

thanks!
david

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



RE: [PHP] how to trap eval error?

2003-11-18 Thread Jay Blanchard
[snip]
eval('$return = $function($input);');
[/snip]

The problem is the quotes...the string is not truly being eval'd. Change
to double quotes

eval("$return = $function($input);");

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



[PHP] how to trap eval error?

2003-11-18 Thread david
Hi, 
i am new to this list as well as to PHP. i am in a situatin where i want to 
eval a string like:

eval('$return = $function($input);');

where $function is a string specify a function to call and $input is the 
input parameter for the function. $return is just whatever is returned by 
the $function. my problem is that if $function is NOT defined anywhere, i 
got a fatal error like:

Fatal error: Call to undefined function: ... 

does anyone who how to trap this error if it can be trap at all? what i have 
done so far is something similar to:

set_error_handler('myHandler');
eval('$return = $function($input);');

that doesn't seem to work at all as 'myHandler' is never called. i have 
alose tried to check $php_errormsg but that doesn't seem to be helpful as 
well. as a last resort, i tried:

error_reporting(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE);
set_error_handler('myHandler');
eval('$return = $function($input);');

that does seem to make the error stop appearing but my handler is still not 
called. any idea?

thanks!
david

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



[PHP] SUMMARY: Help with Solaris/iPlanet 4.1 Setup

2003-11-18 Thread Evans, Tim
Yesterday, I asked:

> I've followed the instructions at 
> http://www.php.net/manual/en/install.netscape-enterprise.php 
> for setting up PHP 4.3.4 with iPlanet 4.1 on Solaris 8, including:
> However, when attempting to load a simple (phpinfo()) test 
> page, all web browsers I test attempt to download the php 
> page, rather than displaying its content.

While I didn't get any substantive replies, I did resolve the problem.

Waay down the above page of instructions is a reader comment about adding a
new stanza to obj.conf:


ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
Service fn=php4_execute


This resolved the problem.
--
Tim Evans   | [EMAIL PROTECTED]
Social Security Administration  | (410) 965-4217
Office of Electronic Services   | (410) 597-1187 (FAX)
Baltimore, MD 21235 | http://www.socialsecurity.gov/

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



Re: [PHP] window.open problem

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 04:48:20PM +0200, David R wrote:
: 
: I am using php and mysql and am having difficulty using window.open () . I
: have cut the code down to the basics.
: Why does a new window not open?
: 
: 
: 
: function boo() {
:   window.open ("www.google.com");
: }
: 
: 
: 
: 
:   why does no window open?
: 
: 

1. try window.open("http://www.google.com/";)

2. try onload='window.open("http://www.google.com/";);'

3. what browser are you using?

4. have you tried the same browser on other machines?

5. have you tried different browsers?

6. have you tried different browsers on other machines?

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



Re: [PHP] sorting an array of regexes

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 01:52:39PM +0100, Wouter van Vliet wrote:
: Eugene Lee suggested:
: > On Tue, Nov 18, 2003 at 01:15:32PM +0100, Adam i Agnieszka
: > Gasiorowski FNORD wrote:
: > :
: > :   There is an array of regexes, for example
: > :
: > :  $array = array('moon', '[wh]ood', '[^as]eed' ...
: > :  (about 300 entries).
: > :
: > :   I want to sort it comparing to the
: > :  character lenght of a regex. For example
: > :  [wh]ood is 4 characters, moon is 4 characters.
: > :  There are only letters of the alphabet and
: > :  letter ranges present in those regexes. I
: > :  want the "longest" ones first.
: > :
: > :   How would you write the sorting function?
: >
: > This might be the most functionally correct, although it's definitely
: > not the fastest route.
: >
: > function re_len($pat)
: > {
: > return strlen(preg_replace('/\[[^]]+]/', '_', $pat));
: 
: I think you meant:
: 
:   /\[[^\]]+]/
: 
: as regex ;) Not sure, but I think one more block-bracked needed to be
: escaped ;)

Nope.  My pattern is legitimate.  Within a range, if the first character
is a closing-square-bracket ']', it is treated as the literal character
and not as the end of range.  If the range starts with a negation '^',
then the same rule applies to the second character.

This is also a sad indication that I really know my regular expressions,
or I need a vacation.  :-)

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



Re: [PHP] easy and simple way to read xml into array

2003-11-18 Thread Burhan Khalid
Victor Spång Arthursson wrote:

2003-11-17 kl. 17.06 skrev Chris Hayes:

Need to read a xml-file into an array, but searching around I havent 
found a way that's easy and simple… Arent there an easy way in PHP to 
accomplish this?


have you been at http://se.php.net/xml ?


Well, I've, and I also have to say that the XML-support in PHP lacks any 
usability…
Care to justify your statement? Because it doesn't work for you, it 
lacks usability? You are a usability expert?

2 pages code later I still cannot get it to work, and the manual is 
pretty thin on this chapter...

For example, I've the following XML:


1234
3,4
kg

Here I thought that the startelementfunction should be called upon every 
start tag, the character_data_handler on every text string and the 
endelement function on every endelement.

But what seems to happen is that the character data handler is called to 
randomly number of times, and if I output the current element every time 
it gets called I get the following output for the xml above:

ingrediens
ingrediens
ingrediens
ingrediensnummer
ingrediensnummer
ingrediensnummer
ingrediensnummer
maengde
maengde
maengde
maengde
enhed
enhed
enhed
enhed
enhed
enhed
What I expected to get was:

ingrediensnummer
maengde
enhed
So, couldnt anyone please bring some clarity into this matter?
1. Post some code.

2. Read a tutorial
   http://www.meidomus.com/node/view/21 (that's one I wrote)
   http://www.google.com/search?q=parsing+xml+php (some that I didn't)
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] duvida com value

2003-11-18 Thread Cesar Cordovez
Mi portugues is very rusty, but I think the solution is:

$url = "";

and then print $url where ever you want.  Notice the quotes and single 
quotes around the url.

You can learn more about this on php.net/urlencode

Cesar

Carlos Eduardo wrote:

alguem poderia me ajudar na seguinte duvida..
em uma pagina php tenho esse campo nela.
nome>
para ele jogar o conteudo da linha nome para a proxima pagina
alterar.php..
mas ele joga apenas por ex:
se o nome é carlos eduardo
vai apenas
carlos , tudo que tem depois do espacamento nao vai para a pagina
alterar.php.
alguem poderia me ajudar com isso ?
Agradeço desde já
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000

2003-11-18 Thread Jay Blanchard
[snip]
In my case, I've created a function called mkdirs that recursively
checks and does a mkdir on a given path.  So, if any of the folders in a
given path don't exist, then they will get created.  I include this at
the top via "include('func/mkdirs.php');".  I've used this mkdirs
function in other scripts, and I know it's working fine. 
[/snip]
 
Then try doing it outside of the function (directly) to see if you spot
any problems


[PHP] Command line output

2003-11-18 Thread Shawn McKenzie
O.K.  I am just now experimenting with the CLI PHP and have another
question.  With the following code, none of the echo output is seen until
the script completes.  I even tried adding a flush() after the first echo
before the imap_open, but still the same behavior.  Any ideas?

echo "Connecting to $server: $mbox ...\n\n";
$conn = imap_open("{" . $server . ":143/notls/norsh}" . $mbox, $user,
$pass);

echo "Receiving messages ...\n\n";
for ($i = 1; $i <= imap_num_msg($conn); $i++) {
...etc...

Thanks!
-Shawn

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



RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000

2003-11-18 Thread Dang Nguyen
In my case, I've created a function called mkdirs that recursively checks
and does a mkdir on a given path.  So, if any of the folders in a given path
don't exist, then they will get created.  I include this at the top via
"include('func/mkdirs.php');".  I've used this mkdirs function in other
scripts, and I know it's working fine.

mkdirs.php contains:
 1) {
  $pStrPath = dirname($strPath);
  if (!mkdirs($pStrPath, $mode)) return false;
  }

  return mkdir($strPath,$mode);
}
?>

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 11:38 AM
To: Dang Nguyen; [EMAIL PROTECTED]
Subject: RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000


[snip]
mkdirs($directory,0755);
[/snip]

should be 
mkdir($directory,0755);

make sure the script has permission to make a directory, most scripts
run as 'nobody' and 'nobody' does not have permission to create a
directory

http://us3.php.net/mkdir


  1   2   >