php-general Digest 18 Jul 2002 09:48:10 -0000 Issue 1471

Topics (messages 108172 through 108232):

Re: Classes Constructor syntax
        108172 by: Rad0s-³aw Gajewski

Running a PHP Script from UNIX Command Line?
        108173 by: Zach Curtis
        108174 by: B i g D o g
        108195 by: Michael Sims

Re: win32 mail()
        108175 by: Manuel Lemos

Re: Classes vs. Functions
        108176 by: Christopher J. Crane

Re: how many requests can php serve?
        108177 by: Miguel Cruz

Binary Files :: They Keep Adding Blocks
        108178 by: vins
        108198 by: Jason Wong
        108205 by: vins
        108216 by: Jason Wong
        108221 by: vins
        108224 by: Danny Shepherd

ldap_add() - null values in fields produce an "value #0 invalid per syntax" error on 
ldap server
        108179 by: Ian_Ball

Re: ErrorDocument 404 & Form
        108180 by: Fabien Penso
        108185 by: David Robley
        108190 by: Fabien Penso
        108193 by: Michael Sims
        108225 by: Fabien Penso

Installing 4.0.6 to 4.1.1 patch
        108181 by: John Wulff
        108182 by: Miguel Cruz

Re: Of Jobs and Certs
        108183 by: Michael Hall

Re: Someone Help please
        108184 by: David Robley

missing function? array_change_key_case()
        108186 by: Jimmy  Brake
        108187 by: John Holmes
        108188 by: Jimmy  Brake

Re: how to access javascipt variables in PHP
        108189 by: Chris Garaffa
        108217 by: Police Trainee

Unexpected module init/shutdown behaviour
        108191 by: Jong-won Choi

Format 24 hr time to 12 hr time
        108192 by: Ryan
        108199 by: Jason Wong

Re: Includes vs. Functions
        108194 by: Michael Sims
        108196 by: Martin Towell

Creating Dynamic Variables
        108197 by: Anup
        108200 by: Martin Towell
        108201 by: Pushkar Pradhan
        108202 by: Michael Sims

Re: Regular expression for correcting proper nouns
        108203 by: CC Zona

Re: preg_replace_callback
        108204 by: CC Zona

Re: Require some help about the date comparison
        108206 by: Manisha

Importing CSV File : 100000 Rows!
        108207 by: Thomas Edison Jr.
        108208 by: Jason Reid
        108209 by: Thomas Edison Jr.
        108211 by: Analysis & Solutions

Re: querying for one specific row number
        108210 by: Justin French

why my php can not get values from Form?
        108212 by: ram friend
        108213 by: Jadiel Flores
        108214 by: Balaji Ankem
        108220 by: Thomas Edison Jr.

Re: Sessions / logins / cookies / security
        108215 by: Peter James

PHP & HASP
        108218 by: Christine & Philip
        108232 by: joakim.andersson.cybercom.se

Re: imap_mail_move and imap_mail_copy
        108219 by: val petruchek

Re: Good instruction for installing webserver using RPM and tar.gz files???
        108222 by: Alberto Serra

Upload File Problem
        108223 by: Mark Colvin
        108227 by: joakim.andersson.cybercom.se

Sessions: watertight?
        108226 by: PHPCoder
        108231 by: joakim.andersson.cybercom.se

draw statistics
        108228 by: Jose Morales
        108229 by: joakim.andersson.cybercom.se
        108230 by: Jason Wong

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
++>PHP does not support multiple constructors.
        but you can easily evade this obstacle:
class A {
        function A($parm1,$parm2=false) {
                if (!$parm2) {
                        $this->OneArgConstructor($parm1);
                } else {
                        $this->TwoArgConstructor($parm2);
                }
        }
        function OneArgContructior($parm) {
                //...
        }
        function TwoArgConstructior($parm1,$parm2) {
                //...
        }
}

                                        Rados
++>
++>Michael
++>
++>On Wed, 17 Jul 2002, David Russell wrote:
++>
++>> Hi all,
++>>
++>> I am finally spending some time converting a million and one functions
++>> into a class - this is for a software issue tracking system.
++>>
++>> I have:
++>>
++>> class issue {
++>>    var
++>>    var
++>>    ...
++>>
++>>    function issue() { //default constructor
++>>      //initialise all variables to defaults, and start getting the stuff
++>> from forms
++>>    }
++>>
++>>    function issue($number) { //1 variable constructor
++>>      // Query database and populate variables accordingly
++>>    }
++>> }
++>>
++>> My question is: will this work? does PHP OOP support more than one
++>> constructor? If my syntax is wrong, please let me know the correct syntax.
++>>
++>> Thanks
++>>
++>> David R
++>>
++>>
++>>
++>
++>

-- 
--
                                     pozdr
                                        Rad0s

        Radek Gajewski [EMAIL PROTECTED] GG:694459 ICQ:110153822
        --------------------------------------------------------

--- End Message ---
--- Begin Message ---
UNIX gurus:

How can I get a PHP script to run or execute from a UNIX command line and
echo the stdout back to the terminal window?

For example,

> execute/run??? file.php

What I really want to do is create a cron job (which I do know how to
create) for the script. The script doesn't really echo any results back, but
logs its results. The script it too time consuming to be run by having
someone running the script through a web browser and waiting for it to
complete.

Thank you very much.

_________________
Zach Curtis
Programmer Analyst
POPULUS
www.populus.com
_________________

Confidentiality Statement:

This e-mail message and any attachment(s) are confidential and may contain
proprietary information that may not be disclosed without express
permission.  If you have received this message in error or are not the
intended recipient, please immediately notify the sender by replying to this
message and then please delete this message and any attachment(s).  Any use,
dissemination, distribution, or reproduction by unintended recipients is not
authorized. Thank you.

--- End Message ---
--- Begin Message ---
Check the archives on this...

But you need the executable php

And on top of the file:

example.php

#!/usr/bin/php -q
<?php

...stuff here
?>


Then chmod the script to be executable and you can run from commandline.
For cron jobs just put it in the cron file and put the path to the file...


.: B i g D o g :.


----- Original Message -----
From: "Zach Curtis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 4:17 PM
Subject: [PHP] Running a PHP Script from UNIX Command Line?


> UNIX gurus:
>
> How can I get a PHP script to run or execute from a UNIX command line and
> echo the stdout back to the terminal window?
>
> For example,
>
> > execute/run??? file.php
>
> What I really want to do is create a cron job (which I do know how to
> create) for the script. The script doesn't really echo any results back,
but
> logs its results. The script it too time consuming to be run by having
> someone running the script through a web browser and waiting for it to
> complete.
>
> Thank you very much.
>
> _________________
> Zach Curtis
> Programmer Analyst
> POPULUS
> www.populus.com
> _________________
>
> Confidentiality Statement:
>
> This e-mail message and any attachment(s) are confidential and may contain
> proprietary information that may not be disclosed without express
> permission.  If you have received this message in error or are not the
> intended recipient, please immediately notify the sender by replying to
this
> message and then please delete this message and any attachment(s).  Any
use,
> dissemination, distribution, or reproduction by unintended recipients is
not
> authorized. Thank you.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002 16:25:10 -0600, you wrote:

>Check the archives on this...
>
>But you need the executable php

Also in the archives are discussions on how to do this using lynx,
which does not require an executable PHP, but does require that the
script reside somewhere in the document root of your web server...
--- End Message ---
--- Begin Message ---
Hello,

On 07/17/2002 10:18 AM, Val Petruchek wrote:
> i mean mail() on win32 server
> 
> my question is - how to set up SMTP
> authorization in php ini
> (if smtp server requires pop auth)
> 
> is it possible or should i use direct smtp
> connection?

No you need to authenticate via POP3 protocol. You may want to try this 
PHP class for that purpose:

http://www.phpclasses.org/pop3class


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
Thank you for your 2 cents I am just learning and appreciate your comments.
----- Original Message -----
From: "Michael Hall" <[EMAIL PROTECTED]>
To: "Chris Crane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 11:13 PM
Subject: Re: [PHP] Classes vs. Functions


>
> There is no simple answer here. I have started using classes where I find
> I am writing a lot of related functions that share similar
> parameters. Database connection and queries are a good
> example. Authentication is another.
>
> I have another class that builds forms, because I just hate the tedium of
> coding HTML forms by hand. It is really just a collection of functions,
> though, and could work fine as such.
>
> I'm still learning/exploring ... I am always guided by the principle that
> whatever makes less work for me (but achieves the same result) is probably
> a good thing.
>
> IMHO classes are best for more universal code that really can be used in
> many different places. My functions tend to be more application specific.
>
> My 2 cents
>
> Michael
>
> On Tue, 16 Jul 2002, Chris Crane wrote:
>
> > Could someone please explain the difference between classes and
functions
> > and how to use a class. I write alot of PHP, but I never understood this
at
> > all. I use an include statement in many of my pages and include a file
with
> > a bunch of functions. For instance, I might have a function called
stock();
> > In the page I am using I include the file that has this function and I
call
> > it like this:
> >
> > stock($Sym);
> >
> > I am wondering if I am doing it the wrong way. So I need to better
> > understand classes. What is one, and why would you use it?
> >
> > Thanks.
> >
> >
> >
> >
>
> --
> --------------------------------
> n   i   n   t   i  .   c   o   m
> php-python-perl-mysql-postgresql
> --------------------------------
> Michael Hall     [EMAIL PROTECTED]
> --------------------------------
>
>
>



--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002, Chris Hewitt wrote:
> Apache comes with ab for load testing. Maybe that will provide you with 
> a means of making meaningful comparisons. There will be a "php" aspect 
> to it, php opposed to say 3-tier java, but also things like is php a 
> cgi, apache module or actually compiled into apache.
> 
> When I hear of sites "going down" I perhaps incorrectly start saying 
> there is something wrong. They should get slower but with connection 
> throttling etc they should never actually crash. Or am I in WonderWorld?

Some resources are easily renewable and others aren't. If your log entries
take up all your drive space (and you share a partition with other more
valuable things), or you have a resource leak (memory, database
connections, etc.), you can quickly grind your server to a halt.

miguel

--- End Message ---
--- Begin Message ---
Hi....
I've just made this script to update a binary file for my BIND 9 DNS server.

=======================
 $WorkFile = "domains/db.nom.za";
 $buffer   = file($WorkFile);

 $DBfile = implode($buffer, "");
 $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
"$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
 $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
"$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
 $DBfile = trim($DBfile)."\n";

 $fp = fopen($WorkFile, 'w');
 fwrite($fp, $DBfile);
 fclose($fp);

=======================

Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
maintain the format of the file...

My script keeps adding and extra line to every line even when I told it to
trim.

Any  please help

Kindest Regards
Vins
:D


--- End Message ---
--- Begin Message ---
On Thursday 18 July 2002 06:57, vins wrote:
> Hi....
> I've just made this script to update a binary file for my BIND 9 DNS
> server.
>
> =======================
>  $WorkFile = "domains/db.nom.za";
>  $buffer   = file($WorkFile);
>
>  $DBfile = implode($buffer, "");
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
> "$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
> "$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
>  $DBfile = trim($DBfile)."\n";
>
>  $fp = fopen($WorkFile, 'w');
>  fwrite($fp, $DBfile);
>  fclose($fp);
>
> =======================
>
> Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
> it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
> maintain the format of the file...
>
> My script keeps adding and extra line to every line even when I told it to
> trim.

Did you even _try_ to do your own debugging before asking the list? You know 
what the problem is -- extra lines -- so where in your code are you adding 
extra lines (hint "\n").

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"We are on the verge: Today our program proved Fermat's next-to-last theorem."
                -- Epigrams in Programming, ACM SIGPLAN Sept. 1982
*/

--- End Message ---
--- Begin Message ---
How do i debug.
Thats why i asked

"Vins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi....
> I've just made this script to update a binary file for my BIND 9 DNS
server.
>
> =======================
>  $WorkFile = "domains/db.nom.za";
>  $buffer   = file($WorkFile);
>
>  $DBfile = implode($buffer, "");
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].",
> "$domain.nom.za. IN NS $fqdnnew[0].", $DBfile);
>  $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].",
> "$domain.nom.za. IN NS $fqdnnew[1].", $DBfile);
>  $DBfile = trim($DBfile)."\n";
>
>  $fp = fopen($WorkFile, 'w');
>  fwrite($fp, $DBfile);
>  fclose($fp);
>
> =======================
>
> Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace
> it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still
> maintain the format of the file...
>
> My script keeps adding and extra line to every line even when I told it to
> trim.
>
> Any  please help
>
> Kindest Regards
> Vins
> :D
>
>


--- End Message ---
--- Begin Message ---
On Thursday 18 July 2002 13:14, vins wrote:
> How do i debug.
> Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that they 
contain what you expect them to contain.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:      Heard about the <ethnic> who couldn't spell?
A:      He spent the night in a warehouse.
*/

--- End Message ---
--- Begin Message ---
yeah but your check i get this funny little square in note pad.
it's a line carier... but if i take it out then everything is one line which
i don't want.
and if i take it out and then put it in again i'm back to sqaure one.

----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 18, 2002 8:56 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


On Thursday 18 July 2002 13:14, vins wrote:
> How do i debug.
> Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that
they
contain what you expect them to contain.

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q: Heard about the <ethnic> who couldn't spell?
A: He spent the night in a warehouse.
*/


--- End Message ---
--- Begin Message ---
Try using just '\n' not '\r\n' as notepad doesn't understand carriage
returns, hence the funny little square.

----- Original Message -----
From: "Vincent Kruger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 18, 2002 9:11 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


> yeah but your check i get this funny little square in note pad.
> it's a line carier... but if i take it out then everything is one line
which
> i don't want.
> and if i take it out and then put it in again i'm back to sqaure one.
>


--- End Message ---
--- Begin Message ---
Hi,

New to the list and hoping someone might be able to help me.

I have been using PHP scripts that are to maintain a company address book
with a lot of data about contacts, both inside and outside the company.  The
scripts, which are generating html pages and reading input values back in,
have been working fine with PHP 4.2.1 as a library module for apache 1.3.26
and openldap 1.2.13.  However, openldap 2.0.23 and 25 have been generating
errors with these same PHP scripts, specifically in the ldap_add() and 
ldap_modify() functions.

The problem comes when fields in the html pages are left empty, which is
normal for this application.  For those familiar with the ldap_add/modify
functions in PHP, the array that is passed in has some values, say for
example title, fax, mobile, ... left empty, and therefore NULL (I have
checked, they really are NULL's stored in the array).  When the values make
it to the ldap server however, they appear to be no longer NULL's, but a
"#0", and through debugging output on the ldap server, I have seen it is
generating an "invalid per syntax" error.

The ldap servers have been complied from source and installed on a SuSE linux
professional 7.3 system.  Hardware resources are no problem (640Mb RAM, 2Gb
swap, 800Mhz processor, 130Gb HDD space with 6Gb free on the working
partition with this stuff)

Does anyone have any suggestions as to how I can address this problem.  It
is important that null values can make it into the ldap server as putting in
other values to try to work around the problem will mess up other
applications that use the ldap server, as will not inserting the fields into
the ldap server.

Ian

The following code segment demonstrates the problem:

<?php
$ds=ldap_connect("localhost");  // The LDAP server is on this host

if ($ds) {
    // bind with appropriate dn to give update access
    $r=ldap_bind($ds,"cn=ShnetAdmin, o=shnetdemo", "thepassword");

    // prepare data
    $info["cn"]="John Jones";
    $info["sn"]="Jones";
    $info["mail"]="";  // <----- NULL VALUE HERE
    // The following lines also produce the same result.......
    //$info["mail"]=NULL;  // <------- NULL value here
    //$info["mail"]="\0";  // <------- NULL value here
    //$info["mail"];       // <------- NULL value here
    $info["objectclass"]="person";

    // add data to directory
    $r=ldap_add($ds, "cn=ShnetAdmin, o=shnetdemo", $info);

    ldap_close($ds);
} else {
    echo "Unable to connect to LDAP server";
}
?>


Which produces the following segment of debugging output on the ldap server,
started with "slapd -d 255".


dn2entry_r: dn: "CN=SHNETADMIN,O=SHNETDEMO"
=> dn2id( "CN=SHNETADMIN,O=SHNETDEMO" )
====> cache_find_entry_dn2id("CN=SHNETADMIN,O=SHNETDEMO"): 3 (1 tries)
<= dn2id 3 (in cache)
=> id2entry_r( 3 )
====> cache_find_entry_id( 3 ) "cn=ShnetAdmin,o=shnetdemo" (found) (1 tries)
<= id2entry_r( 3 ) 0x80e72a8 (cache)
====> cache_return_entry_r( 3 ): returned (0)
send_ldap_result: conn=12 op=1 p=2
send_ldap_result: 21::mail: value #0 invalid per syntax
send_ldap_response: msgid=2 tag=105 err=21
ber_flush: 47 bytes to sd 9
  0000:  30 2d 02 01 02 69 28 0a  01 15 04 00 04 21 6d 61   0-...i(......!ma
  0010:  69 6c 3a 20 76 61 6c 75  65 20 23 30 20 69 6e 76   il: value #0 inv
  0020:  61 6c 69 64 20 70 65 72  20 73 79 6e 74 61 78      alid per syntax
ldap_write: want=47, written=47
  0000:  30 2d 02 01 02 69 28 0a  01 15 04 00 04 21 6d 61   0-...i(......!ma
  0010:  69 6c 3a 20 76 61 6c 75  65 20 23 30 20 69 6e 76   il: value #0 inv
  0020:  61 6c 69 64 20 70 65 72  20 73 79 6e 74 61 78      alid per syntax
daemon: select: listen=6 active_threads=1 tvp=NULL
daemon: activity on 1 descriptors
daemon: activity on: 9r
daemon: read activity on 9
connection_get(9)
connection_get(9): got connid=12
connection_read(9): checking for input on id=12
ber_get_next
ldap_read: want=1, got=1
  0000:  30                                                 0
ldap_read: want=1, got=1
  0000:  05                                                 .
ldap_read: want=5, got=5
  0000:  02 01 03 42 00                                     ...B.
ber_get_next: tag 0x30 len 5 contents:
ber_dump: buf=0x080e5fe0 ptr=0x080e5fe0 end=0x080e5fe5 len=5
  0000:  02 01 03 42 00                                     ...B.
ber_get_next
ldap_read: want=1, got=0

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

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

Tom a écrit : 

 > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
 > httpd.conf or an .htaccess file) follows absolute paths, so you are calling
 > your engine.php out of the root directory of the machine. So the question
 > is, do you have engine.php in the / folder? If not you can put it there or
 > just adjust your ErrorDocument command to point to the path of the file.

No, you didn't understand. I'll make a simpler example. Let's say I did
use :

ErrorDocument 404 /phpinfo.php

/phpinfo.php exists, it just does phpinfo();

If I call http://localhost/dontexist?plop=foobar I will see the phpinfo,
and I will see variables like :

REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist 
REDIRECT_QUERY_STRING: plop=foobar 
REDIRECT_REQUEST_METHOD: GET 
REDIRECT_STATUS: 404 
etc

but $plop won't be set, and there is no way to get the variables
back. In POST method I won't even see the REDIRECT_QUERY_STRING at
all. So should this work, if not why, and is there a way to fix it ?

Thanks :)

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> Tom a écrit : 
> 
>  > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
>  > httpd.conf or an .htaccess file) follows absolute paths, so you are calling
>  > your engine.php out of the root directory of the machine. So the question
>  > is, do you have engine.php in the / folder? If not you can put it there or
>  > just adjust your ErrorDocument command to point to the path of the file.
> 
> No, you didn't understand. I'll make a simpler example. Let's say I did
> use :
> 
> ErrorDocument 404 /phpinfo.php
> 
> /phpinfo.php exists, it just does phpinfo();
> 
> If I call http://localhost/dontexist?plop=foobar I will see the phpinfo,
> and I will see variables like :
> 
> REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist 
> REDIRECT_QUERY_STRING: plop=foobar 
> REDIRECT_REQUEST_METHOD: GET 
> REDIRECT_STATUS: 404 
> etc
> 
> but $plop won't be set, and there is no way to get the variables
> back. In POST method I won't even see the REDIRECT_QUERY_STRING at
> all. So should this work, if not why, and is there a way to fix it ?

I seem to remember some discussion about this ages ago - there was some 
difference between how ErrorDocument works in httpd.conf and .htaccess - 
you might try the latter and see if there is a different result.

Then again, I might not be remembering correctly, so ...

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---

David a écrit : 

 > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...

[...]

 >> but $plop won't be set, and there is no way to get the variables
 >> back. In POST method I won't even see the REDIRECT_QUERY_STRING at
 >> all. So should this work, if not why, and is there a way to fix it ?

 > I seem to remember some discussion about this ages ago - there was some 
 > difference between how ErrorDocument works in httpd.conf and .htaccess - 
 > you might try the latter and see if there is a different result.

 > Then again, I might not be remembering correctly, so ...

Well it could have been it, but it doesn't work neither trying to set
the ErrorDocument into a .htaccess file.

The problem is I am not even sure where is the trouble, and if it should
work or not (I guess it should), so I don't know exactly where to ask,
the dev list maybe ?

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
--- End Message ---
--- Begin Message ---
On Thu, 18 Jul 2002 03:21:48 +0200, you wrote:

> > Then again, I might not be remembering correctly, so ...
>
>Well it could have been it, but it doesn't work neither trying to set
>the ErrorDocument into a .htaccess file.
>
>The problem is I am not even sure where is the trouble, and if it should
>work or not (I guess it should), so I don't know exactly where to ask,
>the dev list maybe ?

I seem to remember from when I was toying around with this that
$_SERVER["REQUEST_URI"] was still available.  Even if $_GET isn't
populated you could manually parse the REQUEST_URI.  Of course I may
be misremembering...  If it's not available on your install let me
know and I'll setup a test case on my server...
--- End Message ---
--- Begin Message ---

Michael a écrit : 

 >> Well it could have been it, but it doesn't work neither trying to set
 >> the ErrorDocument into a .htaccess file.
 >> 
 >> The problem is I am not even sure where is the trouble, and if it should
 >> work or not (I guess it should), so I don't know exactly where to ask,
 >> the dev list maybe ?

 > I seem to remember from when I was toying around with this that
 > $_SERVER["REQUEST_URI"] was still available.  Even if $_GET isn't
 > populated you could manually parse the REQUEST_URI.  Of course I may
 > be misremembering...  If it's not available on your install let me
 > know and I'll setup a test case on my server...

Well it still is in GET method because the url does still exist with the
?plop=foobar but in case I want to use POST method (which I will as my
form has huge textarea) everything disappear.
Also this is a turn around I don't like, I would first understand why it
doesn't work, and if I can fix it.

-- 
Fabien Penso <[EMAIL PROTECTED]> | LinuxFr a toujours besoin de :
http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
--- End Message ---
--- Begin Message ---
I've downloaded the 4.0.6 to 4.1.1 patch but how do i install it?


--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002, John Wulff wrote:
> I've downloaded the 4.0.6 to 4.1.1 patch but how do i install it?

Wouldn't you want to use a current version instead?

miguel

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

In my opinion, certification doesn't count for much. The Microsoft certs
are proof enough of this, but even many of the Linux certs are pretty
shallow when you look at what they cover and how they're tested.
Most employers know that you can either do it or you can't.

Anecdote: I once asked a networking/hardware professional whether a RedHat
certificate would make me more employable in his eyes. No way was his
answer, he was more interested in what I could demonstrably do (and had
already done) than in the paper.

I don't have any advice about how to get into the industry. I have only
just joined it after working 10 years as a teacher. I started building
sites for community groups, built web apps for schools, got a few paid
commercial jobs, built up a portfolio, and finally got a fulltime web
development job at a tertiary institution.

The ease/difficulty of getting into the industry probably depends greatly
on economic circumstances. But I know that in my case, knowing Linux,
Apache and PHP/MySQL (plus demonstrable experience, not necessarily
commercial) was what clinched it for me. Where I live (NT, Australia),
Linux really is making inroads into the mainstream.

One thing that might look good on a CV is involvement in an open source
project, at whatever level.

Michael 


On Wed, 17 Jul 2002, Martin Clifford wrote:

> Howdy everyone,
> 
> I'd like to get everyone's input on Jobs and Certs.  I know there are a couple 
>Certifications for web developers out there, such as the CIW and CWP certifications.
> 
> Here are my questions:
> 
> 1.  What is the best method to go about becoming certified?
> 2.  What is the best way to go about getting into the web development industry?
> 3.  If you have ever taken online courses relating to web development, what is your 
>opinion on them?  Good, bad, ugly?
> 4.  Which certification is most beneficial?  I know that CWP requires work 
>experience before becoming certified past certain points, and CIW does not require 
>this.
> 5.  Why can't I remember what question five was? Doh.
> 
> At any rate, I'm current a data entry clerk, but have quite a bit of web experience 
>(none at a job, though), and I know that I have TONS more to learn, but I am very 
>passionate about it and want to be able to do it as a career.  I just don't know 
>where the hell to start, and I know that some of you might be able to offer some 
>advice in this area.
> 
> Thanks in advance!  This is very important to me, so I thought I'd ask the people 
>that would know best :o)
> 
> Martin Clifford
> Homepage: http://www.completesource.net
> Developer's Forums: http://www.completesource.net/forums/
> 
> 
> 
> 

-- 
--------------------------------
n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql
--------------------------------
Michael Hall     [EMAIL PROTECTED]
--------------------------------

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Chris:
> 
> Geez, this is your third thread on this today...  Lame.
> 
> --Dan
> 
> 

There is none deafer than (s)he who won't listen :-)

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hi!

When I run this command ...

$foo = array_change_key_case($foo, CASE_UPPER);

I get this error ......

Call to undefined function:  array_change_key_case() in /index.php on
line 181

Yet the function (should) exist:

http://www.php.net/manual/en/function.array-change-key-case.php

I am running 4.x any ideas?

Jimmy

--- End Message ---
--- Begin Message ---
Works fine for me on 4.2.1

You have to have at least 4.2.0, do you?

---John Holmes...

> -----Original Message-----
> From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 17, 2002 8:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] missing function? array_change_key_case()
> 
> Hi!
> 
> When I run this command ...
> 
> $foo = array_change_key_case($foo, CASE_UPPER);
> 
> I get this error ......
> 
> Call to undefined function:  array_change_key_case() in /index.php on
> line 181
> 
> Yet the function (should) exist:
> 
> http://www.php.net/manual/en/function.array-change-key-case.php
> 
> I am running 4.x any ideas?
> 
> Jimmy
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
yep thats it ... 

On Wed, 2002-07-17 at 18:02, John Holmes wrote:
> Works fine for me on 4.2.1
> 
> You have to have at least 4.2.0, do you?
> 
> ---John Holmes...
> 
> > -----Original Message-----
> > From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 17, 2002 8:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] missing function? array_change_key_case()
> > 
> > Hi!
> > 
> > When I run this command ...
> > 
> > $foo = array_change_key_case($foo, CASE_UPPER);
> > 
> > I get this error ......
> > 
> > Call to undefined function:  array_change_key_case() in /index.php on
> > line 181
> > 
> > Yet the function (should) exist:
> > 
> > http://www.php.net/manual/en/function.array-change-key-case.php
> > 
> > I am running 4.x any ideas?
> > 
> > Jimmy
> > 
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


--- End Message ---
--- Begin Message ---
I can't think of a way to do it in the page itself... Unfortunately (there
could be a way, I just can't think of it - frazzled after a day of work),
but if you're using forms on your page, then set the values of some hidden
form elements to the JS variables you want to use, and pass them along. You
could have the page refresh itself to give you the variables, too.
I'm sure there's a better way, though.
Good luck,
-- 
Chris Garaffa
#!/usr/local/lib/php
$contact_info["Name"]   = "Chris Garaffa";
$contact_info["Email"]  = "[EMAIL PROTECTED]";
$contact_info["Work"]   = "[EMAIL PROTECTED]";
$contact_info["cell"]   = "203.803.9066";


"Seppo Laukkanen" (from <[EMAIL PROTECTED]>) wrote on 7/17/02 3:06
PM:

> Can anybody help?
> 
> I have javascript code to find out browsers width and height, but they
> are stored in javascript variables. How can I access them from PHP? Or
> is there a method to do same in PHP straightly?
> 
> Thanks,
> Seppo
> 
> 

--- End Message ---
--- Begin Message ---
one method that i have found works for me (albeit not
so pretty, neat, or concise) is to pass js variables
through a url request. Ok follow me for a little if
you will (it's bulky, but it works!)

1) user loads a page (e.g.
your-domain.com/index.phtml)
that page contains the javascript which determines the
user's browser width and height. 
2) the page automatically refreshes immediately to
another page along with the variables (e.g.
/index2.phtml?h=xyz&w=abc).
3) on the new page, php can use the variables passed
via the URL as if it were posted with the GET method
from a form.

ok, i admit it's messy, not ideal, and lame, but it
works.

Since I don't know a fraction of what the php gurus
here know, the programming on my site may be messy,
bulky, and more complicated than it needs to be- but
at least it gets the job done : )

hope it helps




I can't think of a way to do it in the page itself...
Unfortunately 
(there
could be a way, I just can't think of it - frazzled
after a day of 
work),
but if you're using forms on your page, then set the
values of some 
hidden
form elements to the JS variables you want to use, and
pass them along. 
You
could have the page refresh itself to give you the
variables, too.
I'm sure there's a better way, though.
Good luck,
-- 
Chris Garaffa
#!/usr/local/lib/php
$contact_info["Name"]   = "Chris Garaffa";
$contact_info["Email"]  = "[EMAIL PROTECTED]";
$contact_info["Work"]   = "[EMAIL PROTECTED]";
$contact_info["cell"]   = "203.803.9066";


"Seppo Laukkanen" (from <[EMAIL PROTECTED]>)
wrote on 7/17/02 
3:06
PM:

> Can anybody help?
> > I have javascript code to find out browsers width
and height, but 
they
> are stored in javascript variables. How can I access
them from PHP? 
Or
> is there a method to do same in PHP straightly?
> > Thanks,
> Seppo
> > -- 



__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--- End Message ---
--- Begin Message ---
Hello,

I'm trying to understand module init/shutdown of PHP and Apache httpd
configuration.

        Server version: Apache/1.3.20 (Unix)  (Red-Hat/Linux)
                  httpd.conf: StartServers 8
        PHP 4.2.1

I just added log messages to init/shutdown function of XML module:

        PHP_MINIT_FUNCTION(xml)
        {

                char msg[1024];
                sprintf(msg,"%d - XML: MINIT CALLED!", getpid());
                zend_error(E_WARNING, msg);
        ...
        }


        PHP_MSHUTDOWN_FUNCTION(xml)
        {
                char msg[1024];
                sprintf(msg,"%d - XML: MSHUTDOWN CALLED!", getpid());
                zend_error(E_WARNING, msg);
        ...
        }

Then when httpd is started, following messages appears:
        
        [18-Jul-2002 10:12:03] PHP Warning:  5607 - XML: MINIT CALLED!
in
Unknown on line 0
        [18-Jul-2002 10:12:03] PHP Warning:  5610 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:12:09] PHP Warning:  5610 - XML: MINIT CALLED!
in
Unknown on line 0
        ...

Now, shutdown httpd (there are 9 calls):

        ...
        [18-Jul-2002 10:13:54] PHP Warning:  5619 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:54] PHP Warning:  5618 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:54] PHP Warning:  5617 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:54] PHP Warning:  5616 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:54] PHP Warning:  5615 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:54] PHP Warning:  5614 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:55] PHP Warning:  5613 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:55] PHP Warning:  5612 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0
        [18-Jul-2002 10:13:55] PHP Warning:  5610 - XML: MSHUTDOWN
CALLED! in
Unknown on line 0


Is above right behaviour? I think that should be something like:

MINIT is called once with process id P1, for example when httpd is
started.
MSHUTDOWN is called once with same pid P1, when httpd is shutdown.
I also checked global init/shutdown functions but it seems like not used
at the moment.

How can I make Apache and PHP work just like I want?

Cheers,

- Jong-won Choi

--- End Message ---
--- Begin Message ---
How do you format this for example: 13:58:00 into 1:58 PM

Thanks


--- End Message ---
--- Begin Message ---
On Thursday 18 July 2002 05:31, Ryan wrote:
> How do you format this for example: 13:58:00 into 1:58 PM

Manual > Date and Time functions

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You attempt things that you do not even plan because of your extreme 
stupidity.
*/

--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002 17:46:25 -0400, you wrote:

>Chris, thanks for describing your method. The reason I really dislike
>Functions in PHP is because you have to pass every variable needed by a
>function, even if that variable is global in the main script, which is a
>pain in the ass when a function needs a long string of variables. It makes
>it easier to forget a variable in the list and can make the code look messy.
>
>So, that's why I prefer includes, because the code is operating on the same
>level as the main script and can easily use variables set locally without
>making them global.
>
>I'll use a function if it only needs one or two variables passed to it, but,
>I find myself using more Includes than Functions because of the variable
>passing necessary. 

Maybe I'm misunderstanding what you guys are talking about here, but
it seems to me that you believe that including a block of code and
calling it as a function are just two different approaches to the same
thing, and nothing more.  It's true that they can be very similar, but
I think you are overlooking one of the major benefits of functions.

You speak of passing variables and making them global as if it were
simply a necessary evil.  Have you stopped to consider that there are
times that variable scope works in your favor?  There are times when
you do NOT want variable $a inside a function to be the same as
variable $a outside of it.

Functions (and classes) are all about code modularization.  Let us say
that you have a particular set of code that you know you are going to
need to execute several times.  So you decide to put it in an external
file and include() that code whenever you need it.  In this case, all
of the variables you use inside that code are global.  But, this is
not a problem because you are aware of which variables are in use, so
there are no conflicts.

But let us say that later on you, or some other programmer entirely,
want to use your code again in a completely different program.  Now,
because all of your variables are global, you (or they) have to stop
and think...."now lets see, this code references $var_a and
$var_b...am I using those variables already for other purposes?"  If
the new program is already using those variables, for some other
purpose altogether, then suddenly your included code has clobbered
those variables, and now you have bugs.  You have introduced a
namespace conflict, and this is an example of poorly seperated
functionality.

The whole idea behind modularization is that you are creating a "black
box" so to speak, a chunk of code that performs one function, and one
function only.  It should present a *minimal* interface to the outside
world.  This means that if I have a black box that say, gives me the
current local time in a particular timezone, I should be able to feed
it the name of the timezone, and it should give me back the current
time.  I should NOT have to know how it works inside, or care.  I feed
it one value, and it returns another value.  Now, if I have
implemented this code as a simple block that is include()'ed, now I
suddenly have to concern myself with how it works...i.e. I have to
know, if nothing else, what variable names it is expecting, and I have
to make sure that I am not clobbering any of those variables inside my
main script.

As far as I know, every non-trivial programming language (or scripting
language) has the concept of variable scope.  It behaves differently,
but the concept is still there.  For example, in Perl, a variable that
is referenced in a function (or subroutine) is global by default,
unless you use the "my" keyword, which makes it only visible inside
the subroutine.  PHP is backwards from this...it defaults to assuming
you want a local copy of the variable, and only makes it global if you
tell it to.  But imagine if there was no such concept as variable
scope, and all variables were global.  We'd end up with variables
names like $a3t463tew34 just to make sure we're not conflicting with
another named variable...

If you're saying that you have a group of variables, let us say 10 or
15 or so, that you want to be global EVERYWHERE, then there are easy
ways to accomplish that, and still retain the clean seperation of
functionality that a function or a class would give you.  I would put
the names of the variables inside an array and then globalize them by
iterating through the array.  Example:

$superglobals = array("var1", "var2", "var3", "var4", "var5", "...");

Now inside the function you can do this:

function somefunction ($somevar) {

  global $superglobals;
  foreach($superglobals as $varname) {
    global $$varname; //resolves to $var1, $var2, $var3, etc.
  }

  //Other stuff here

}

If I have completely misunderstood the thread here, please forgive my
rambling post. :-)
--- End Message ---
--- Begin Message ---
> >Chris, thanks for describing your method. The reason I really dislike
> >Functions in PHP is because you have to pass every variable needed by a
> >function, even if that variable is global in the main script, which is a
> >pain in the ass when a function needs a long string of variables. It
makes
> >it easier to forget a variable in the list and can make the code look
messy.

[snip]

> The whole idea behind modularization is that you are creating a "black
> box" so to speak, a chunk of code that performs one function, and one
> function only.  It should present a *minimal* interface to the outside
> world.  This means that if I have a black box that say, gives me the
> current local time in a particular timezone, I should be able to feed
> it the name of the timezone, and it should give me back the current
> time.  I should NOT have to know how it works inside, or care.  I feed
> it one value, and it returns another value.

[snip]

To add to this. If you're passing too many values to a function, then maybe
that function isn't broken down enough. I remember hearing/reading that if
you need to pass more than, I think, 5 or 6 values to a function, then
you're passing too many.

Martin
--- End Message ---
--- Begin Message ---
Hello, I have captured variables from any HTML that is POSTed to me from a
'foreach' clause. Now, possibly in this foreach clause I want to register
these name/value pairs into a session var. I have tried :
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$name=$value;
session_register(name); //without the $
}
and get nothing.



--- End Message ---
--- Begin Message ---
I think you're more after this

session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$$name=$value;
session_register($name); //with the $
}

HTH
Martin

-----Original Message-----
From: Anup [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 12:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Creating Dynamic Variables


Hello, I have captured variables from any HTML that is POSTed to me from a
'foreach' clause. Now, possibly in this foreach clause I want to register
these name/value pairs into a session var. I have tried :
session_start();
foreach ($HTTP_POST_VARS as $name=>$value) {
$name=$value;
session_register(name); //without the $
}
and get nothing.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Try putting "" around name in session_register?
> Hello, I have captured variables from any HTML that is POSTed to me from a
> 'foreach' clause. Now, possibly in this foreach clause I want to register
> these name/value pairs into a session var. I have tried :
> session_start();
> foreach ($HTTP_POST_VARS as $name=>$value) {
> $name=$value;
> session_register(name); //without the $
> }
> and get nothing.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan

--- End Message ---
--- Begin Message ---
On Wed, 17 Jul 2002 22:39:10 -0400, you wrote:

>Hello, I have captured variables from any HTML that is POSTed to me from a
>'foreach' clause. Now, possibly in this foreach clause I want to register
>these name/value pairs into a session var. I have tried :
>session_start();
>foreach ($HTTP_POST_VARS as $name=>$value) {
>$name=$value;
>session_register(name); //without the $
>}
>and get nothing.

Assuming register_globals is off:

session_start();
foreach ($HTTP_POST_VARS as $name => $value) {
  $$name = $value;
  session_register($name);
}

Remember, $name only contains the name of the variable, not a
reference to the variable itself.  To create a new global variable
with the name "$name", you have to use a variable variable, hence
$$name.

Session_register, however, only requires a string which contains the
name of the variable you want to register.  $name will provide that by
itself.  In your example, by leaving off the dollar sign, you are
referencing an undefined constant called "name"...
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Henry) wrote:

> I'm looking for a simple was to correct a list of proper nouns given all in
> lower case!
> 
> For example
> 
> given $string="london paris rome";
> 
> I would like "London Paris Rome".
> 
> However there is one cavet; if the word already has a captital anywhere in
> it, it should be left alone!!!
> 
> Is there a soultion using regular expressions?

Yes.  The topics you'll want to look at (in the PCRE chapter of the manual) 
are: case-sensitivity, character classes, capturing subpatterns, and the 
documentation for preg_replace_callback().  One of the things you'll need 
to do is define for yourself what constitutes a "word" for your purposes.  
Does a single letter word get counted as a "word" (i.e. "i")?  Is there any 
non-alphabet character that can validly appear within the thing you call a 
word (i.e. "hi-fi", "mst3k")?  This is why there's no single ready-made 
solution.

> Also is there one for removing multiple spaces?
> 
> i..e given "A   B C D E" it would give "A B C D E".

Yes.  Again, character classes will be your friend, as will preg_replace().  
Just decide which of the whitespace characters you mean to include in that 
definition of "multiple spaces"...

-- 
CC
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Rafael Fernandes) wrote:

> First, sorry for my elementary english...
> I need a function made for PHP3 that works like preg_replace_callback...

Before preg_replace_callback() was introduced, preg_replace() used to have 
another an "f" modifier which had similar functionality.  I'm not sure 
whether that modifier was available back in PHP3, but here's the relevant 
quote about "f" from an old set of PCRE Syntax docs:

> F
> If this modifier is set, preg_replace() treats the replacement parameter as a 
> function name that should be called to provide the replacement string. The 
> function is passed an array of matched elements in the subject string. NOTE: 
> this modifier cannot be used along with /e modifier; and only preg_replace() 
> recognizes this modifier.

If I recall correctly (which I may not), an example would look something 
like this:

$output=preg_replace("/(\w+)/f","'***' . strtolower($1) . '***'",$input);

-- 
CC
--- End Message ---
--- Begin Message ---
Thanks to all who responded me. Actually I got confused after seeing so 
many commands but finally got it correct from u guys.

Thanks once again.

Manisha

--- End Message ---
--- Begin Message ---
Hi,

I have generated a .csv file from a .dat file using a
VB program. Now this .csv file needs to be imported
into my mySQL Database Table on the internet, using
phpMyAdmin.

The problem i'm facing is that the file, while
uploading, stops somewhere in the middle. The upload
just gets stuck. 

Possible reasons :

1. Number of rows is too large. About 100000. Does
mySQL Support these many rows? Is yes, is it possible
to upload these many rows from a client to a table on
the internet using phpMyadmin?

2. Internet connection. Due to the mere size of the
file in terms of no. or rows, maybe my internet is not
able to send all the data. I dont' know.

Now can anyone suggest a possibly solution? Can i
break up the file automatically and send or something?

Please help..

T. Edison Jr.



__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--- End Message ---
--- Begin Message ---
First off, does your mysql DB allow you to connect remotly (not including
phpmyadmin). If so, I'd suggest www.anse.de/mysqlfront, and use that to
connect to the database, and import the .csv through that. I can see the
file maybe not fully uploading, due to possibly the max file size in php, as
100,000 rows of data must be approaching at least 1mb (might be wrong there
too, depends on the data).

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

----- Original Message -----
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 11:20 PM
Subject: [PHP] Importing CSV File : 100000 Rows!


> Hi,
>
> I have generated a .csv file from a .dat file using a
> VB program. Now this .csv file needs to be imported
> into my mySQL Database Table on the internet, using
> phpMyAdmin.
>
> The problem i'm facing is that the file, while
> uploading, stops somewhere in the middle. The upload
> just gets stuck.
>
> Possible reasons :
>
> 1. Number of rows is too large. About 100000. Does
> mySQL Support these many rows? Is yes, is it possible
> to upload these many rows from a client to a table on
> the internet using phpMyadmin?
>
> 2. Internet connection. Due to the mere size of the
> file in terms of no. or rows, maybe my internet is not
> able to send all the data. I dont' know.
>
> Now can anyone suggest a possibly solution? Can i
> break up the file automatically and send or something?
>
> Please help..
>
> T. Edison Jr.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes
> http://autos.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Hi,

Basically the problem is that i have to connect from
my localhost to my MySQL database on the
server/internet. I don't have command prompt access to
the internet database...


--- Pradeep Dsouza <[EMAIL PROTECTED]> wrote:
> 
> there is a way to do it from the prompt 
> 
> I use Windows but the command on Linux is close 
> 
> if the file is called mydata.sql
> 
> mysql > \. C:\mydata.sql
> 
> 
> Hope this works 
> 
> Pradeep 
> 
> 
> ----- Original Message ----- 
> From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 18, 2002 10:50 AM
> Subject: [PHP] Importing CSV File : 100000 Rows!
> 
> 
> > Hi,
> > 
> > I have generated a .csv file from a .dat file
> using a
> > VB program. Now this .csv file needs to be
> imported
> > into my mySQL Database Table on the internet,
> using
> > phpMyAdmin.
> > 
> > The problem i'm facing is that the file, while
> > uploading, stops somewhere in the middle. The
> upload
> > just gets stuck. 
> > 
> > Possible reasons :
> > 
> > 1. Number of rows is too large. About 100000. Does
> > mySQL Support these many rows? Is yes, is it
> possible
> > to upload these many rows from a client to a table
> on
> > the internet using phpMyadmin?
> > 
> > 2. Internet connection. Due to the mere size of
> the
> > file in terms of no. or rows, maybe my internet is
> not
> > able to send all the data. I dont' know.
> > 
> > Now can anyone suggest a possibly solution? Can i
> > break up the file automatically and send or
> something?
> > 
> > Please help..
> > 
> > T. Edison Jr.
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Autos - Get free new car price quotes
> > http://autos.yahoo.com
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> > 
> 


=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--- End Message ---
--- Begin Message ---
On Wed, Jul 17, 2002 at 10:33:50PM -0700, Thomas Edison Jr. wrote:
> 
> Basically the problem is that i have to connect from
> my localhost to my MySQL database on the
> server/internet. I don't have command prompt access to
> the internet database...

But, if you have the mysql terminal software installed on your localhost,
and your host/user combo is permitted to log in to the database, you can
log in to the database from your machine.  Something like:

mysqlimport -h remote.host.com -u username -p databasename file.txt

http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#mysqlimport

Otherwise, break up the file into smaller pieces and see how that works.

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
For starters, this is a PHP list, not MySQL.

Check out the LIMIT statement in the MySQL manual.

Or, if you have a primary key field like id and you KNOW that id#2 will be
there, then it's a simple

SELECT * FROM mytable WHERE id='2'


But in the case where id#2 has been deleted, you really want to pull out
id#3, the new second rown in the table... in which case you'd use limit

make sense?


Justin French


on 18/07/02 12:21 AM, Phil Schwarzmann ([EMAIL PROTECTED]) wrote:

> I want query my mysql table and get one particular row.
> 
> So let's say my table had 5 rows (entries) in it, and I want to pull
> just row #2, how would I do this??
> 
> THANKS!!
> 

--- End Message ---
--- Begin Message ---
hello,
I have just installed apache+php4, but my php can not get values from form?
what's wrong?
following is the code in php named file "welcome.php"
<?php
echo( "Welcome to our Web site, $usernm $passwd!" );
?>

I called it with
http://localhost/welcome?username=hhhh&passwd=bbb
i get nothing, what's wrong?




--- End Message ---
--- Begin Message ---
Probably you don't have the Register Global turned on in your php.ini, try 
using $_GET['usernm'] and $_GET['passwd'] or change your php.ini

At 01:41 p.m. 07/18/2002 +0800, you wrote:
>hello,
>I have just installed apache+php4, but my php can not get values from form?
>what's wrong?
>following is the code in php named file "welcome.php"
><?php
>echo( "Welcome to our Web site, $usernm $passwd!" );
>?>
>
>I called it with
>http://localhost/welcome?username=hhhh&passwd=bbb
>i get nothing, what's wrong?
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Enable Rigister_globals to On in php.ini file and then try.

Best Regards
Balaji

-----Original Message-----
From: ram friend [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 18, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] why my php can not get values from Form?


hello,
I have just installed apache+php4, but my php can not get values from
form? what's wrong? following is the code in php named file
"welcome.php" <?php echo( "Welcome to our Web site, $usernm $passwd!" );
?>

I called it with http://localhost/welcome?username=hhhh&passwd=bbb
i get nothing, what's wrong?





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

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************
--- End Message ---
--- Begin Message ---
Simple.. just edit your php.ini file in your windows
directory. Search for "register_globals" .. it will
have "Off" in front of it.. switch it to "On"

T. Edison jr.


--- ram friend <[EMAIL PROTECTED]> wrote:
> hello,
> I have just installed apache+php4, but my php can
> not get values from form?
> what's wrong?
> following is the code in php named file
> "welcome.php"
> <?php
> echo( "Welcome to our Web site, $usernm $passwd!" );
> ?>
> 
> I called it with
> http://localhost/welcome?username=hhhh&passwd=bbb
> i get nothing, what's wrong?
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--- End Message ---
--- Begin Message ---
There's a good article on authentication at phpbuilder.com

http://www.phpbuilder.com/columns/tim20000505.php3

that may provide an idea or two.

----- Original Message -----
From: "Chad Day" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 16, 2002 10:30 AM
Subject: Sessions / logins / cookies / security


> I asked something similar a little while ago, but didn't do a good job
> clarifying.
>
> What I'm looking to do is when a user logs in, I start up the session.. I
> then have the registered session var to verify they are authenticated as
> they move throughout the site.
>
> Now, when they close the browser and come back, I want them to still be
> authenticated.  Obviously, I have to set a cookie.  But what do I set?  Do
I
> set just their user ID?  The MD5 of their password?  What's the most
secure
> way, that's not easily spoofed?  I don't know that much about cookies, but
> if I just use a user ID, couldn't someone just change that ID value and
> 'become' another user?
>
> Thanks for any advice,
> Chad
>


--- End Message ---
--- Begin Message ---
I am planning to setup a web server of using RedHat Linux. The purpose
of the web server is to provide product information for only registered
customers.
I plan to send the HASP parallel port keylock to the registered
customers.
Can I use PHP to monitor the status HASP parallel port keylock in the
client side?
Is there any idea for ensuring the website piracy?
Thanks!

Christine

--- End Message ---
--- Begin Message ---
[Snip]
> Can I use PHP to monitor the status HASP parallel port keylock in the
> client side?
[/Snip]

No you can't. PHP is server-side and has no access to client machines. You
could _maybe_ do it with JavaScript and then pass on the info to PHP with a
redirect or something like that.

Regards
Joakim Andersson
--- End Message ---
--- Begin Message ---
> Has anyone had experience with imap_mail_move or imap_mail_copy?
>
> Can they copy or move a message from one mail server to another or only
> into a subfolder on the same server?

Same server - it has parameter $imapcon which can be assumed as
connection to one server only.

Imap functions is just interface for IMAP protocol.

--
Sincerely, val petruchek


--- End Message ---
--- Begin Message ---
ðÒÉ×ÅÔ!

Scott Fletcher wrote:
> I'm pretty used to installing OpenSSL, Mod_SSL, Mcrypt, cURL, PHP and Apache
> with all of them in tar.gz files.  Now I'm experiementing it on the Linux
> and mySQL.  Never tried it on both Linux and mySQL before.

In my very limited Linux experience I found out that if you just ignore 
the RPMs and install the tarballs in instead everything works great. 
It's what I usually do.

If you cannot avoid using RPMs you might want to check for the --force 
option. But IMHO it's stupid to waste the solid experience you already have.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......

--- End Message ---
--- Begin Message ---
I have a simple script that attempts to upload a file and save it on the
server. When I click send file I get this error message 'Warning: Unable to
open '' for reading: No such file or directory in /var/www/html/upload.php
on line 5
Couldn't copy the file!'. The file is being uploaded from a Win 2000 machine
and the php script live on an apache web server on a linux box. I have chmod
777 the 'image' directory. Any ideas?
Here's the code -

                                -- upload.html --
<html>
<head>
<title>Upload a File</title>
</head>

<body>

<h1>Upload a File</h1>

<form enctype="multipart/form-data" method="post" action="upload.php">

<p><strong>File to Upload:</strong><br>
<input type="file" name="img1" size="30"></p>

<P><input type="submit" name="submit" value="Upload File"></p>

</form>
</body>

</html>

                                -- upload.php --
<?php

if ('img1' != "") {

        copy($img1_tmp_name, "images/".$img1_name)
                or die("Couldn't copy the file!");

} else {

        die("No input file specified");
}

?>



****************************************************
This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.
****************************************************
--- End Message ---
--- Begin Message ---
> From: Mark Colvin [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 18, 2002 10:09 AM
>
>                               -- upload.php --
> <?php
> 
> if ('img1' != "") {
This will allways be true! 'img1' is a string and will never be empty.
You probably mean if($img1 != "")
However, I'm not sure this will work in this case.

Try this instead. (Taken straight from the PHP-manual. A real good
resource!)

<?php
if (is_uploaded_file($_FILES['img1']['tmp_name']))
{
        $filename = $_FILES['img1']['tmp_name'];
        print "$filename was uploaded successfuly";
        $realname = $_FILES['img1']['name'];
        print "realname is $realname";
        print "copying file to uploads dir";
        copy($_FILES['img1']['tmp_name'], "/place/to/put/" . $realname);
}
else
{
        echo "Possible file upload attack: filename" .
$_FILES['img1']['name'] . ".";
}
?>

If you use PHP < 4.1.0 you must exchange $_FILES to $HTTP_POST_FILES

Regards
Joakim Andersson
--- End Message ---
--- Begin Message ---
Hi
I'm doing some reading on sessions and how it works etc, and have a 
concern (which is probably fed by my ignorance on the topic).
The couple of "simple session examples" I have found in the PHP/MySQL 
book by Luke Welling & Laura Thompson gives a simple 3 page session 
example where the session is started on the first page, a variable is 
registered as a session var and then has a link to the next page where 
the session_start() is called and the session_var is echoed to 
illustrate the workings of a session.
My understanding is that PHP will either use cookies to store the 
session ID on the client's pc, or send it via URL, so, assuming that 
cookies is a no-go, can I now assume that PHP will attach it's session 
ID to each and every URL located on my .php page?
The reason I'm asking is as follow:
I did the little excersise, and then deliberately rejected my browsers 
call to process the cookie, and then the script didn't return the 
variable as it did previously...
And now, assuming that I can assume that PHP will attach the SID to all 
URL's , how does it know to which URL's to attach, or am I supposed to 
manually attach them, leaving me with another question, If I have to 
manually code the SID into the URL, then the whole session "coockies if 
possible" approach doesn't seem to work???

Can someone explain it in more detail for me plz?
Thanks


--- End Message ---
--- Begin Message ---
Taken straigh from the manual:
(http://www.php.net/manual/en/ref.session.php)

[quote]
There are two methods to propagate a session id: 

- Cookies 

- URL parameter 

The session module supports both methods. Cookies are optimal, but since
they are not reliable (clients are not bound to accept them), we cannot rely
on them. The second method embeds the session id directly into URLs. 

PHP is capable of doing this transparently when compiled with
--enable-trans-sid. If you enable this option, relative URIs will be changed
to contain the session id automatically. Alternatively, you can use the
constant SID which is defined, if the client did not send the appropriate
cookie. SID is either of the form session_name=session_id or is an empty
string. 
[/quote]

Regards
Joakim Andersson


> -----Original Message-----
> From: PHPCoder [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 18, 2002 11:17 AM
> To: php-general
> Subject: [PHP] Sessions: watertight?
> 
> 
> Hi
> I'm doing some reading on sessions and how it works etc, and have a 
> concern (which is probably fed by my ignorance on the topic).
> The couple of "simple session examples" I have found in the PHP/MySQL 
> book by Luke Welling & Laura Thompson gives a simple 3 page session 
> example where the session is started on the first page, a variable is 
> registered as a session var and then has a link to the next 
> page where 
> the session_start() is called and the session_var is echoed to 
> illustrate the workings of a session.
> My understanding is that PHP will either use cookies to store the 
> session ID on the client's pc, or send it via URL, so, assuming that 
> cookies is a no-go, can I now assume that PHP will attach 
> it's session 
> ID to each and every URL located on my .php page?
> The reason I'm asking is as follow:
> I did the little excersise, and then deliberately rejected my 
> browsers 
> call to process the cookie, and then the script didn't return the 
> variable as it did previously...
> And now, assuming that I can assume that PHP will attach the 
> SID to all 
> URL's , how does it know to which URL's to attach, or am I 
> supposed to 
> manually attach them, leaving me with another question, If I have to 
> manually code the SID into the URL, then the whole session 
> "coockies if 
> possible" approach doesn't seem to work???
> 
> Can someone explain it in more detail for me plz?
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Hi!

Im looking for some class that alow me to draw an histogram, or a piechar, for display 
statistics. 

thx!
--- End Message ---
--- Begin Message ---
> From: Jose Morales [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 18, 2002 11:34 AM
> 
> Hi!
> 
> Im looking for some class that alow me to draw an histogram, 
> or a piechar, for display statistics. 
> 
> thx!

http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/

Regards
Joakim Andersson
--- End Message ---
--- Begin Message ---
On Thursday 18 July 2002 17:33, Jose Morales wrote:
> Hi!
>
> Im looking for some class that alow me to draw an histogram, or a piechar,
> for display statistics.

www.phpclasses.org

also jpgraph

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You're not an alcoholic unless you go to the meetings.
*/

--- End Message ---

Reply via email to