php-general Digest 15 Jan 2002 09:11:04 -0000 Issue 1112

Topics (messages 80493 through 80525):

Re: strtok bug
        80493 by: Manuel Lemos

Re: override [EMAIL PROTECTED]
        80494 by: Vlasyuk Valera

Re: Setting up an XML platform/website
        80495 by: Geoff Caplan
        80496 by: Vlasyuk Valera

Compile problems php 4.1.1
        80497 by: Jay Paulson
        80498 by: Rasmus Lerdorf

Re: Finding PHP Developers for Remote Project
        80499 by: Richard Spangenberg
        80501 by: Boaz Yahav

checkboxes vs text filed array and hidden variables
        80500 by: m. ali
        80519 by: Jason Wong

Wrong result ("345php.tmp")  instead a filepath from <input file type=file...
        80502 by: helmut ott
        80503 by: CC Zona

Padding with mcrypt_generic
        80504 by: Ben Sinclair
        80512 by: Joe Conway (wwc)

unable to copy and chmod
        80505 by: Edgard Berendsen
        80515 by: Jimmy
        80525 by: bvr.xs4all.nl

An idea...
        80506 by: Gerard Samuel
        80507 by: Gerard Samuel
        80511 by: Gerard Samuel

Mysql
        80508 by: -=LukA=-
        80510 by: Mehmet Kamil ERISEN
        80513 by: Miles Thompson

Re:[PHP] Mysql
        80509 by: Sam Masiello

Re: apache authentication
        80514 by: Miles Thompson
        80517 by: Fred

SMS
        80516 by: Yogesh Mahadnac
        80518 by: Manuel Lemos

Pb Apache 2 + PHP 4.1.1 + Win32
        80520 by: guillaume.nocent.bnpparibas.com

Re: PHP4.1.1 + RH7.2 + UCD-Snmp
        80521 by: Richard Ellerbrock

PHP array or SQL problem
        80522 by: Dean Householder

An important, urgent question about classes?
        80523 by: Sait Karalar

Re: I18n problems: Working with double-byte languages
        80524 by: Yasuo Ohgaki

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

Robert Mena wrote:
> 
> Hi Manuel and all developers.
> 
> I understand that the implementation of strtok was
> "broken" (non POSIX compliant) but since it has been
> like this for ages would be better to give a chance to
> developers worldwide (that has been using and relied
> on this broken implementation) to control the
> behaviour of such feature much the same way
> REGISTER_GLOBALS (or something) in recently 4.1.0.
> 
> Imagine recoding 100+ distributed scripts to change
> this!
> 
> The decision of having this "fixed" is great but not
> paying attention (like you always did in the past)
> with backwards compatibility is (IMHO) a mistake.

My opinion precisely.

The problem is that PHP developers that decided to break strtok did not
seem to have thought of that so they did not ask any users if they were
relying on the original behaviour. They would not need to poll anybody.
Common sense can lead to the conclusion that if a function has a certain
behaviour for 4 years, chances are that there must be enough people
relying on it that changing the behaviour would break their code. It
seems that the person that broke strtok came to PHP much earlier than
that and did not cross his mind about existing users relying on the
original behaviour.

If making it POSIX compliance was a good idea, it would have been better
to add a function to the POSIX extension named posix_strtok and whoever
thinks that POSIX compliance was a good idea could use that and it would
not require breaking the existing strtok function. The same goes for
dirname function that was broken before PHP 4.0.3pl1 .

Anyway, do not count on PHP developers to ever reconsider and provide
any means to restore the original. Despite the change was only made 2
months ago, they are too proud and already state that they will not
admit it was a mistake. Usually they don't like somebody from outside to
tell them that there are better solutions, especially after the mistake
is already made.

So, I advise you to not expect anything from the PHP developers
regarding fixing the mistakes. To solve your problem it is either more
realistic to not upgrade to PHP 4.1 now (if ever) unless you have the
time to replace the calls to strtok and dirname with something else that
provides the original behaviour like those replacement functions that I
wrote and made available here:

http://phpclasses.UpperDesign.com/browse.html/package/404

Regards,
Manuel Lemos

> --- Manuel Lemos <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > Robert Mena wrote:
> > >
> > > Hi, does anybody know when the strtok bug
> > introduced
> >
> > After 4.0.6 .
> >
> > > in 4.1.1 will be fixed ?
> > > Will we have a 4.1.2 or should I try to grab a cvs
> > > tree (assuming that it is already solved) ?
> >
> > You may want to ask that in php-dev mailing list
> > because last time that
> > I reported it I was told that it would not be fixed
> > because it was just
> > me complaining.
> >
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
i perefer to use such mail code:

$pipe=popen("/usr/sbin/sendmail -f [EMAIL PROTECTED] -i
[EMAIL PROTECTED]","w");
    $email_body="Customer name: $customer_name
  email: $email
  features: $features";
    if ($pipe) {
 fputs($pipe,"To: [EMAIL PROTECTED]\n");
 fputs($pipe,"From: $email\n");
 fputs($pipe,"Subject: New order\n");
 fwrite($pipe,$email_body);
 pclose($pipe);}
    }else{
        print "Error, can't open pipe";
     }

_________________________________
Valery Vlasyuk
http://www.cgi-network.net - free php scripts


----- Original Message -----
From: "toni baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 11:00 PM
Subject: [PHP] override [EMAIL PROTECTED]


> When using the mail () function to send an email to a
> linux server the header information shows two from
> addresses. (1)e-mail address that was defined in $from
> variable in the header.  (2) [EMAIL PROTECTED]
>
> Can someone explain this?  I only want the $from
> variable to show up in the header.  Can I do this
> with the simple mail () function?  Thanks
>
> Header info is below:
>
> >From [EMAIL PROTECTED]  Mon Jan 14 08:33:19 2002
> Return-Path: <[EMAIL PROTECTED]>
> Received: from localhost.localdomain
> ([EMAIL PROTECTED] [204.65.32.5])
>         by [EMAIL PROTECTED] (8.9.3/8.9.3) with ESMTP
> id IAA12868
>         for <[EMAIL PROTECTED]>; Mon, 14 Jan 2002
> 08:33:19 -0600
> Received: from [EMAIL PROTECTED]
> (IDENT:root@[EMAIL PROTECTED] [204.65
> .32.11])
>         by localhost.localdomain (8.12.1/8.11.2) with
> ESMTP id g0EEXpOn001442
>         for <[EMAIL PROTECTED]>; Mon, 14 Jan 2002
> 08:33:51 -0600
> Received: (from nobody@localhost)
>         by [EMAIL PROTECTED] (8.9.3/8.9.3) id IAA09861;
>         Mon, 14 Jan 2002 08:35:08 -0600
> Date: Mon, 14 Jan 2002 08:35:08 -0600
> Message-Id: <200201141435.IAA09861@[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: TESTING
> From: [EMAIL PROTECTED]
> Reply-To: [EMAIL PROTECTED]
>
> Mail () function below:
>
> $to = "[EMAIL PROTECTED]";
>       $subj = "TESTING";
>       $body="Begin101Test" .
>             "\n" . $N .
>             "\n" . $C .
>             "\n" . $r .
>             "\nEnd101";
> $header="From: " . $email .
>              "\r\nReply-To: [EMAIL PROTECTED]";
> mail ($to, $subj, $body, $header);
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

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

> Is anyone interested in setting up an XML platform for PHP, where the use
of
> XML is explained,

Why not offer to edit a section on this on one of the popular PHP community
sites, such as PHPBuilder.com?

I agree that this is an important subject, but I am not sure that we need
yet more sites. The material will get a bigger audience on an existing site,
I suspect.

Anyway, I hope you get this off the ground one way or another

Geoff Caplan
Advantae Ltd

--- End Message ---
--- Begin Message ---
Hi,
i webmaster of  http://www.cgi-network.net site and  Im  interested in
setting up an XML platform for PHP. Lets discuss that.


Valery Vlasyuk

----- Original Message -----
From: "Geoff Caplan" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>; "Emile Bosch"
<[EMAIL PROTECTED]>
Sent: Monday, January 14, 2002 9:58 PM
Subject: Re: [PHP] Setting up an XML platform/website


> Emile
>
> > Is anyone interested in setting up an XML platform for PHP, where the
use
> of
> > XML is explained,
>
> Why not offer to edit a section on this on one of the popular PHP
community
> sites, such as PHPBuilder.com?
>
> I agree that this is an important subject, but I am not sure that we need
> yet more sites. The material will get a bigger audience on an existing
site,
> I suspect.
>
> Anyway, I hope you get this off the ground one way or another
>
> Geoff Caplan
> Advantae Ltd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

--- End Message ---
--- Begin Message ---
I'm trying to compile php 4.1.1 and when it gets to the --with-apxs option it errors 
out with the following:

Sorry, I was not able to successfully run APXS.  Possible reasons:

1.  Perl is not installed;
2.  Apache was not compiled with DSO support (--enable-module=so);
3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs
The output of apxs follows
./configure: apxs: command not found

I've run the httpd -l command and I have the mod_so.c configured into apache as you 
can see below

Compiled-in modules:
  http_core.c
  mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec

I then tried to find the "apxs" file on my machine and well it returns nothing.  Does 
anyone have any ideas on what I can do?

Thanks..


--- End Message ---
--- Begin Message ---
You don't mention which OS you are on, but usually apxs is found in the
apache-devel package.  You probably didn't install that.

-Rasmus

On Mon, 14 Jan 2002, Jay Paulson wrote:

> I'm trying to compile php 4.1.1 and when it gets to the --with-apxs option it errors 
>out with the following:
>
> Sorry, I was not able to successfully run APXS.  Possible reasons:
>
> 1.  Perl is not installed;
> 2.  Apache was not compiled with DSO support (--enable-module=so);
> 3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs
> The output of apxs follows
> ./configure: apxs: command not found
>
> I've run the httpd -l command and I have the mod_so.c configured into apache as you 
>can see below
>
> Compiled-in modules:
>   http_core.c
>   mod_so.c
> suexec: enabled; valid wrapper /usr/sbin/suexec
>
> I then tried to find the "apxs" file on my machine and well it returns nothing.  
>Does anyone have any ideas on what I can do?
>
> Thanks..
>
>
>

--- End Message ---
--- Begin Message ---
thanks,.. guru.com is great.

And, thank all of you for your great help.

Terrific, etc.
Rick


"Laserjetter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You could try guru.com
>
> LJ
>
>
> "Richard Spangenberg" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I may need some help on a project I am working on.
> > Does anyone know of a good source of PHP developers where I can
advertise
> my
> > needs?
> >
> > Rick
> >
> >
>
>


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

A good place to put this would be either in the projects area 
of weberdev
(http://www.weberdev.com/index.php3?GoTo=jobmatching/about.php3) 
or the jobs area (http://www.weberjob.com).

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.
 



-----Original Message-----
From: Richard Spangenberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 15, 2002 12:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Finding PHP Developers for Remote Project


thanks,.. guru.com is great.

And, thank all of you for your great help.

Terrific, etc.
Rick


"Laserjetter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You could try guru.com
>
> LJ
>
>
> "Richard Spangenberg" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I may need some help on a project I am working on.
> > Does anyone know of a good source of PHP developers where I can
advertise
> my
> > needs?
> >
> > Rick
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

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

my problem :
i have to pass the price, and part number which i get from the database to
the shopping cart so when i select some
of the items by checking the checkboxes and submit the form i get only the
last item in the list

i use hidden variables to pass these values to shopping cart.

my code look like this:

echo "<TD><input type=\"checkbox\" name=\"product[]\"
value=\"$product_id\"></TD>";
echo "<TD><input type=\"text\" size=\"2\" name=\"quantity[$part_number]\"
value=\"1\"  >";
echo"</TD>";
echo "<input type=\"hidden\" value=\"$part_number\" name=\"part_number\"/>";
echo "<input type=\"hidden\" value=\"$discount_price\"
name=\"discount_price\"/>";



--- End Message ---
--- Begin Message ---
On Monday 14 January 2002 06:03, m. ali wrote:
> Hi
>
> my problem :
> i have to pass the price, and part number which i get from the database to
> the shopping cart so when i select some
> of the items by checking the checkboxes and submit the form i get only the
> last item in the list
>
> i use hidden variables to pass these values to shopping cart.
>
> my code look like this:
>
> echo "<TD><input type=\"checkbox\" name=\"product[]\"
> value=\"$product_id\"></TD>";
> echo "<TD><input type=\"text\" size=\"2\" name=\"quantity[$part_number]\"
> value=\"1\"  >";
> echo"</TD>";
> echo "<input type=\"hidden\" value=\"$part_number\"
> name=\"part_number\"/>"; echo "<input type=\"hidden\"
> value=\"$discount_price\"
> name=\"discount_price\"/>";


But what is your question? Does the above code work? If not does it give any 
error messages? Help us to help you by giving us some details :)


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

/*
The probability of someone watching you is proportional to the
stupidity of your action.
*/
--- End Message ---
--- Begin Message ---
I have a page with a html-form headed with 
...ENCTYPE="multipart/form-data" ...

and multiple inputs,e.g.:
"<input type=file name=formname1>..."
If I select a file,e.g. "abc.jpg" with the path "c:\abc.jpg"
I get a value like "345php.tmp" instead of "c:\abc.jpg".

Any idea what is wrong?
--- End Message ---
--- Begin Message ---
In article <005501c19d41$28521e70$fe78a8c0@laptop>,
 [EMAIL PROTECTED] (Helmut Ott) wrote:

> I have a page with a html-form headed with 
> ...ENCTYPE="multipart/form-data" ...
> 
> and multiple inputs,e.g.:
> "<input type=file name=formname1>..."
> If I select a file,e.g. "abc.jpg" with the path "c:\abc.jpg"
> I get a value like "345php.tmp" instead of "c:\abc.jpg".

That's the temporary filename. 
<http://www.php.net/manual/en/features.file-upload.php> gives an overview 
of how file uploads are handled by PHP.

-- 
CC
--- End Message ---
--- Begin Message ---
I'm trying to use mcrypt_generic and it works fine except it pads the data
with ^@'s when, according to the manual page, the length of the data is not
n * blocksize.

I've been trying to remove the padding from my decrypted data using
something like "$string = str_replace("^@","",$string);", but it doesn't
seem to work right (^@ is a single character, not just "^" . "@").

Has anyone had to do this before and found a solution?

--
Ben Sinclair
[EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
Ben Sinclair wrote:

> I'm trying to use mcrypt_generic and it works fine except it pads the data
> with ^@'s when, according to the manual page, the length of the data is not
> n * blocksize.
> 
> I've been trying to remove the padding from my decrypted data using
> something like "$string = str_replace("^@","",$string);", but it doesn't
> seem to work right (^@ is a single character, not just "^" . "@").
> 
> Has anyone had to do this before and found a solution?
> 
> --
> Ben Sinclair
> [EMAIL PROTECTED]

I worked around this by padding the plaintext myself. Basically, add NUL 
(character 0) bytes so that your plaintext becomes an exact multiple of 
blocksize. Then change the very last byte to the number of padding bytes 
used. If the plaintext is already an exact multiple of blocksize, then 
pad with an entire block.

On decryption, reverse the process, and you'll have your original string 
back exactly the way you started.

Here are two functions that I use for this:
(note: I modified these slightly from the originals without testing)

function pad_plaintext($data, $blocksize)
{
         $buffer = "";
         $numpad = $blocksize - (strlen($data) % $blocksize);

         $nul_str = chr(0);
         $buffer = $data . str_repeat($nul_str, $numpad);
         $buffer[strlen($buffer) - 1] = chr($numpad);

         return($buffer);
}

function depad_plaintext($data)
{
         $buffer = "";
         $numpad = ord($data[strlen($data) - 1]);

         $buffer = substr($data, 0, -1 * $numpad);

         return($buffer);
}

HTH,

--Joe

--- End Message ---
--- Begin Message ---
unable to copy and chmod

I'm trying to copy a file and chmod it to make it writable, but after I copy
it using PHP I can't even chmod in ftp !
I can't change the file owner too.


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

> I'm trying to copy a file and chmod it to make it writable, but after I copy
> it using PHP I can't even chmod in ftp !

since you upload it using PHP, most likely the owner of the file is
nobody.nobody, that's why you can't chmod thru ftp. (unless you login
to ftp as nobody ;))

> I can't change the file owner too.

only root can chown

You need root access to fix your problem...or re-upload your file using
ftp, not php.

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A diplomat is man who always remembers a woman's birthday but never her age.

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

Any file copied with PHP will stay writable from PHP, as the owner is set to whatever 
PHP is running under.

Explain how the file got there and how you'd like to change it (through PHP, FTP etc.)

bvr.


>Hi Edgard,
>
>> I'm trying to copy a file and chmod it to make it writable, but after I copy
>> it using PHP I can't even chmod in ftp !
>
>since you upload it using PHP, most likely the owner of the file is
>nobody.nobody, that's why you can't chmod thru ftp. (unless you login
>to ftp as nobody ;))
>
>> I can't change the file owner too.
>
>only root can chown
>
>You need root access to fix your problem...or re-upload your file using
>ftp, not php.



--- End Message ---
--- Begin Message ---
Just want to bounce this idea off you guys/gals.
Im looking to improve the security of my scripts.  Now lets say, I 
initialise the script with a constant in the main config file that all 
the pages access.  Then when Im accepting data from a form or maybe even 
  a link I could do

if (isset($HTTP_POST_VARS['foo']) && defined("CONSTANT")) {
   process data
}

Just an idea, what do you think..
Thanks

--- End Message ---
--- Begin Message ---
Quote from the php manual.
"Once a constant is defined, it can never be changed or undefined."

I figure, since the constant is initialised in the script, it cannot be 
changed or undefined, then I can put my trust in it that it comes from 
the server and no where else....

Martin Towell wrote:

> how is that going to increase security?
> 
> -----Original Message-----
> From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 11:21 AM
> To: php
> Subject: [PHP] An idea...
> 
> 
> Just want to bounce this idea off you guys/gals.
> Im looking to improve the security of my scripts.  Now lets say, I
> initialise the script with a constant in the main config file that all
> the pages access.  Then when Im accepting data from a form or maybe even
>   a link I could do
> 
> if (isset($HTTP_POST_VARS['foo']) && defined("CONSTANT")) {
>    process data
> }
> 
> Just an idea, what do you think..
> Thanks
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


--- End Message ---
--- Begin Message ---
Martin Towell wrote:

> 1. so you're trying to stop people from link straight to your page?
> 2. or are you trying to stop them from using your code without 
> permission (on the same server)?
>   a. will others be able to see the source code?
>     i. if so, then what's to stop them from defining the constant 
> themselves?
>     ii. if not, this looks like a good way of doing it
> 


I could see how links in the url bar could get spoofed, but I have no 
idea how a form can.  I presented a question maybe last week about 
$HTTP_POST_VARS security or lack of, and one the replies, got me thinking.
I guess what I had in mind is along the lines of #2.  What I had in mind 
was that each install would have a different value for the constant.  So 
will others be able to see the source code, no not unless the webserver 
becomes compromised...


> -----Original Message-----
> From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 11:31 AM
> To: Martin Towell
> Cc: PHP
> Subject: Re: [PHP] An idea...
> 
> 
> Quote from the php manual.
> "Once a constant is defined, it can never be changed or undefined."
> 
> I figure, since the constant is initialised in the script, it cannot be
> changed or undefined, then I can put my trust in it that it comes from
> the server and no where else....
> 
> Martin Towell wrote:
> 
>  > how is that going to increase security?
>  >
>  > -----Original Message-----
>  > From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
>  > Sent: Tuesday, January 15, 2002 11:21 AM
>  > To: php
>  > Subject: [PHP] An idea...
>  >
>  >
>  > Just want to bounce this idea off you guys/gals.
>  > Im looking to improve the security of my scripts.  Now lets say, I
>  > initialise the script with a constant in the main config file that all
>  > the pages access.  Then when Im accepting data from a form or maybe even
>  >   a link I could do
>  >
>  > if (isset($HTTP_POST_VARS['foo']) && defined("CONSTANT")) {
>  >    process data
>  > }
>  >
>  > Just an idea, what do you think..
>  > Thanks
>  >
>  >
>  > --
>  > PHP General Mailing List (http://www.php.net/)
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>  >
> 


--- End Message ---
--- Begin Message ---
Hello php-general,

  Hi everybody
  Please help me.
  If i want to create a table in some database what should I do.
  The database is on server.

-- 
Best regards,
 -=LukA=-                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Hi,
Sorry if I am being a rude, but you need to read the
document on how to create a table:
www.mysql.com
and 
www.php.net (assuming that you will use php)

thx.

--- -=LukA=- <[EMAIL PROTECTED]> wrote:
> Hello php-general,
> 
>   Hi everybody
>   Please help me.
>   If i want to create a table in some database what
> should I do.
>   The database is on server.
> 
> -- 
> Best regards,
>  -=LukA=-                          mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


=====
Mehmet Erisen
http://www.erisen.com

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---

You need some tutorials on using MySQL and PHP.
There are some good ones at thickbook  http://www.thickbook.com,
you can also search, using Google, for "tutorial MySQL PHP". You will find 
good ones at
WebMonkey, DevShed and Zend.

Good luck and welcome - Miles Thompson


At 03:46 AM 1/15/2002 +0300, -=LukA=- wrote:
>Hello php-general,
>
>   Hi everybody
>   Please help me.
>   If i want to create a table in some database what should I do.
>   The database is on server.
>
>--
>Best regards,
>  -=LukA=-                          mailto:[EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

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

Even though this is OT as it is not a PHP question it is an easy one :)  

Please see the following URL:
http://www.mysql.com/documentation/mysql/bychapter/

It is the MySQL manual broken out by chapter.  

You will find the next URL particularly useful as it is the syntax for the "create 
table" command:
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#CREATE_TABLE

HTH

--Sam



On Tue, 15 Jan 2002 03:46:47 +0300 -=LukA=- <[EMAIL PROTECTED]> wrote:
>Hello php-general,
>
>  Hi everybody
>  Please help me.
>  If i want to create a table in some database what should I do.
>  The database is on server.
>
>-- 
>Best regards,
> -=LukA=-                          mailto:[EMAIL PROTECTED]
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


--- End Message ---
--- Begin Message ---
I'm trying to do a similar thing, although I'm running PHP as an Apache 
module. There's a directory I want to protect, containing PDf files, access 
to which will be constrained by .htaccess.

Our users have already logged in through a custom login script. I could 
modify this script so that when the users are authenticated, I can assign a 
username/password combination which would be acceptable to .htpasswd.

Alternately I could add mod_auth_mysql and use it to authenticate.

In either case, a user name and password have to be passed to Apache. Is 
this done by assignment to $PHP_AUTH_USER  and $PHP_AUTH_PW?

If so would mod_auth_mysql pick those up automatically, thus the popup 
wouldn't appear?

My other alternative is to move the PDF's outside the web tree and deliver 
them using the header() function. Although it's been tested and works, many 
subscribers have IE 5.5 and work in an environment where the company 
directs what browser will be used.

This has become a sticky issue, and all suggestions will be welcome. 
(Including that I RTFM, if I've missed a particular section.)

Regards - Miles Thompson

At 11:35 AM 1/14/2002 -0800, [EMAIL PROTECTED] wrote:
>Apparently i have been unclear, allow me to rephrase:
>
>I want to send user:pass to an apache authentication header for a apache
>protected user directory.  Unfortunately, I have php installed as CGI so
>native php authentication will not function.  I would like
>to either send the user:pass via GET in a url encoded sting (if possible
>as CGI) OR send user:pass
>directly to the header using a different method. Due to restrictions
>imposed on me, i am not able
>to make use of a single unified logon using LDAP or NTLM. In my case,
>since there are several user
>directories spanning severl realms, I must first authenticate users
>against a mysql auth db and fetch
>the the realm user:pass based on that users permissions.
>
>Is it possible to send the user:pass in any of the methods described
>above? If so, how can i implement
>this?
>
>Aaron Lake
>Programmer/Analyst
>Kvaerner Chemetics
>A Division of Kvaerner Canada Inc
>(604) 730 4206
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
If, for example, the protected page you are attempting to access is at:
http://www.mydomain.com/protected/index.php
you can use the following url to bypass the pop up password dialog box:
http://username:[EMAIL PROTECTED]/protected/index.php

Please note that this is a rather insecure method of securing your pages,
but no more insecure than using apache authentication in the first place.

Fred

Aaron Lake <[EMAIL PROTECTED]> wrote in message
H00002b900fde0f4.1011030069.cscche.che.jb.traf.com@MHS">news:H00002b900fde0f4.1011030069.cscche.che.jb.traf.com@MHS...
Hi,

I am using the Nusphere application server with apache user directories.
I have several protected user
directories that are of different realms. When a user logs into the
'secure area'  i would like to send them
to pages contained in a secure directory but pass the encoded user:pass
in the URL as to avoid the pop-up
apache authentication dialogue. Is this possible and how do i achieve
this?

TIA,

Aaron Lake
Programmer/Analyst
Kvaerner Chemetics
A Division of Kvaerner Canada Inc
(604) 730 4206





--- End Message ---
--- Begin Message ---
    Hi everyone! I'd be grateful if someone could please tell me a link where I can 
find a good tutorial on how to develop a SMS tool with PHP, or if somebody has already 
developed something like it, or if there are any experts around, please give me some 
information about it.

Thanks and regards,
Yogesh Mahadnac.
--- End Message ---
--- Begin Message ---
Hello,

Yogesh Mahadnac wrote:
> 
>     Hi everyone! I'd be grateful if someone could please tell me a link where I can 
>find a good tutorial on how to develop a SMS tool with PHP, or if somebody has 
>already developed something like it, or if there are any experts around, please give 
>me some information about it.

You may want to look into this.

http://phpclasses.upperdesign.com/browse.html/package/396

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---

Hi !

I just installed Apache 2.0.28 + PHP 4.11 on my Win2K server.

Apache fails to start when I include :
LoadModule php4_module "C:/Program Files/php/sapi/php4apache.dll"
in my httpd.conf ...

All worked perfectly before (Apache 1.3.xx + PHP 4.0.x) ...

I heared of a special SAPI module for Apache 2 ...
Somebody could help me and tell me where I can find it ?

Thanx.

ZeuG.

Please make a copy of you reply to :
zeug @ multimania . com
(remove the spaces in the adress)



This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

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

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.

--- End Message ---
--- Begin Message ---
A couple of days ago I posted the solution. See 
http://groups.google.com/groups?q=ipplan&hl=en&lr=lang_en|lang_de&newwindow=1&selm=sc3eaf22.018%40eskom.co.za&rnum=4

Antonio S. Martins Jr. wrote:

> Hi Everybody,
> 
>    Has anyone doing it sucefuly? I can compile it. The phpinfo(); call
> returns ok! (UCD-Snmp enable) but when I call the snmp functions I got a
> SegFault (on PHP-CGI). I already tried with an without
> --enable-ucd-snmp-hack, and recompiling the UCD-Snmp packages as told on
> the PHP manual pages (http://www.php.net/snmp).


--- End Message ---
--- Begin Message ---
I've got a database with lname (lastname), fname (firstname), and nickname.

What I want to do is search by either first name or last name.  Either way, I display 
the nickname instead of the firstname if it exists.  I have no problems on the last 
name, but when I sort by firstname, the people with nicknames that are very different 
come up at the place where their first name (not the displayed name) is.

For example:

Adam Smith
Joe Schmoe
Bill Somebody

When Bill Somebody is really William Somebody in the database, his nickname is bill 
and that's what's displayed but he 'bill' shows up in 'williams' spot.  Here is my SQL 
query:

select * from employees order by fname;

Should I create an array and sort it there or can I somehow query MySQL to sort by 
nickname only if it exists and then by fname?

Dean
--- End Message ---
--- Begin Message ---
Hi all,
 
I need to learn something about classes in PHP, that I could not understand what's going on really!?
 
For the following sample, what kind of class i need to create? how can i use?
 
For example,
I have X students X: from 1 to infinity...
With respect to student ID of them,
 
And for each students, I have  name,surname,addr,phone,email .... etc.. informations of them....
 
I want to create a class, such that, i can input info of students, for each student.
And for example, when I did this for 10 students,
 
I want to register with "session_register" and add/remove/change registered informarmations.
 
I tried to do,
 
but I could not understand the uses of classes clearly, so I could not do...
 
Thus soem body write me small code which includes a sample class and
 
adding/changing/deleting records for one student inside.
 
Can I register a valuable which is a class?  $mydata = new Students();   session_register("mydata"); ? is possible?
 
Do we have any restriction about registering a variable with respect to its type?
 
thanx... best regards...
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here
--- End Message ---
--- Begin Message ---
Ricardo Junior wrote:
> Hi people !
> 
> I have a query regarding double-byte languages on PHP. 
> I need to sort a index localized from English to Korean.
> 
> My idea is:
> *     get the Korean strings from file;
> *     convert them to UTF8;
> *     insert them in a Oracle database set to work with UTF8;
> *     set "NLS_LANG" with "Alter session" SQL command to this variable
> match with Korean language;
> *     get the strings sorted by Oracle with a "SELECT * FROM table SORT BY
> field ASC" SQL command;
> 
> I've tried to convert the Korean string to UTF8 with utf8_encode function,
> but this function converted each byte from double-byte string to its
> relative in UTF8 chars.
> Reverting this string encoded to UTF8 with utf8_decode function, the browser
> can display successfully the Korean chars (because the individual bytes of
> the double-byte string will be as them were before), but Oracle can't sort
> the strings properly because that UTF8 chars converted by utf8_encode
> function were not relative to a double-byte char, but relative to a 2 single
> bytes chars!
> 
> How can I convert a double-byte string to UTF8 properly???
> 
> 
> Really thanks !!!!

UTF-8 works but EUC-KR may be better.
Anyway, take a look at mbstring, iconv, gettext modules.

-- 
Yasuo Ohgaki

--- End Message ---

Reply via email to