php-general Digest 16 Jun 2003 07:07:44 -0000 Issue 2120

Topics (messages 151601 through 151641):

Re: Capturing the input of dynamic form fields (part II)
        151601 by: Frank Keessen
        151602 by: esctoday.com | Wouter van Vliet
        151603 by: Frank Keessen

Re: Mail() "problem"
        151604 by: Don Read

Test message
        151605 by: jb
        151622 by: Lars Torben Wilson

Re: Upgrading PHP 4.1.2 to Current
        151606 by: Catalin Trifu
        151638 by: Jaap van Ganswijk

Re: [Newman] When i send an email it ...
        151607 by: Catalin Trifu

Re: slow mail()
        151608 by: Don Read

List Files in Directory to Array
        151609 by: Bix
        151610 by: Bix

asymmetric encryption with PHP
        151611 by: Logan McKinley

parse_str and NULL entry problem
        151612 by: Adrian Bolzan

rows by day
        151613 by: Sebastian
        151619 by: John W. Holmes
        151621 by: Sebastian
        151628 by: Sebastian

Re: / [Newman] When i send an email it ...
        151614 by: Philip J. Newman
        151617 by: Michael Geier
        151625 by: Philip J. Newman
        151630 by: jb

Re: [PEAR] Trying to install Log
        151615 by: Stan Lemon

Re: is my server working
        151616 by: Khoo Merry
        151623 by: Lars Torben Wilson

Re: need help on coding
        151618 by: Khoo Merry

session question
        151620 by: Matt Palermo
        151631 by: Don Read

Re: PHPFI? How to build on Win32?
        151624 by: Lars Torben Wilson

Re: Why SID changes each time I refresh the page??
        151626 by: Justin French

ACL howto
        151627 by: Sn!per

Re: interact with .htaccess
        151629 by: Justin French

Re: php editor?
        151632 by: M-Ali Mahmoodi
        151633 by: M-Ali Mahmoodi

Call to undefined function: mysql_connect()
        151634 by: Daniel R. Hansen
        151636 by: Jason Wong

Please I need help it's very Urgent (Prevent un-authorized users to download document)
        151635 by: Mishari
        151637 by: Leif K-Brooks
        151639 by: Sebastian

Object pooling with PHP
        151640 by: Sephiroth

Session Problems
        151641 by: Joseph Ross Lee

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

Looks like the value's are not coming to the database.. Can you please all
have a close look at my code because it's driving me NUTS!

THANKS FOR YOUR HELP!

<?
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to
connect!");

// select database
mysql_select_db($db) or die ("Unable to select database!");

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$nArraySize = count($_POST['test1']);
$test1=$_POST['test1[]'];
$test2=$_POST['test2[]'];

echo $nArraySize;
for($i=0;$i<$nArraySize;$i++) {
$query="INSERT INTO test (test1, test2) VALUES ('$test1[$i]',
'$test2[$i]')";
$result = mysql_query($query);
echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
}

}
?>
<form name="form1" method=post id=form1 enctype=multipart/form-data
action=<?=$_SERVER['PHP_SELF']?>>
<?
 for ($i=1; $i<=2; $i++)
    {
        echo "# $i<input type=\"text\" name=\"test1[$i]\"><br>";
  echo "# $i<input type=\"text\" name=\"test2[$i]\"><br>";

    }

?>
<input type=submit name=submit value=submit>
</form>

Regards,

Frank


----- Original Message ----- 
From: "Frank Keessen" <[EMAIL PROTECTED]>
To: "James Hicks" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 8:59 PM
Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)


> Hi James,
>
> Sorry to say; I've put your code in it but there are no error message's
> displaying and there is no value inserted in the database... Any clue???
>
> Regards,
>
> Frank
> ----- Original Message ----- 
> From: "James Hicks" <[EMAIL PROTECTED]>
> To: "Frank Keessen" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 15, 2003 4:14 PM
> Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
>
>
> > Whenever I am having problems with SQL queries I always display the
query
> on
> > the page with all the replaced variables so I can make sure that the
query
> > makes sense. If it passes the MySQL parser in my brain and still doesn't
> > work, I will copy the displayed query into the command line mysql
monitor
> (or
> > phpmyadmin) and try the command manually to see what happens.
> >
> > I also found it easier to solve my SQL problems by not using "or die "
and
> > just displaying some information about the problem query. This way I
know
> > something is wrong if the third line of the echo is not at least 1.
> >
> > $query="INSERT INTO test (test1, test2) VALUES
> >                     ('$_POST['test1']','$_POST['test2']')";
> > $result = mysql_query($query);
> > echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
> >
> >
> > James
> >
> > On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > > Dear all,
> > >
> > > Refering to my first e-mail with the same subject; I've reworked the
> code
> > > to this:
> > >
> > > But the only problem is; Nothing is written into the mysql database!
And
> > > there are no error displayed..
> > >
> > > Can someone have a look at my code?
> > >
> > > <?
> > > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > > if($_REQUEST['submit']!="")
> > > {
> > > for($i=0;$i<count($_POST['test1[]']);$i++) {
> > > $query="INSERT INTO test (test1, test2) VALUES
> > > ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query)
or
> > > die ("Error in query: $query. " . mysql_error()); }
> > > }
> > > ?>
> > > <form name="form1" method=post id=form1 enctype=multipart/form-data
> > > action="<? $_SERVER['PHP_SELF']?>"> <?
> > >  for ($i=1; $i<=2; $i++)
> > >     {
> > >         echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
> > >   echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
> > >
> > >     }
> > >
> > > ?>
> > > <input type=submit name=submit value=submit>
> > > </form>
> > >
> > > Thanks very much,
> > >
> > > Frank
> >
> >
> > -- 
> > 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 ---
First thing I notice as being at least a bit odd is this part:

$nArraySize = count($_POST['test1']);
$test1=$_POST['test1[]'];
$test2=$_POST['test2[]'];

what are you trying to do with that? .. What I'd expect it to look like is
smth like:

$nArraySize = count($_POST['test1']);
$test1 = $_POST['test1'];
$test2 = $_POST['test1'];

but probably this:

foreach($_POST['test1'] as $i => $Value) {
        $query = "INSERT INTO test (test1, test2) VALUES
('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."')";
        $result = mysql_query($query);

        # and what else you'd want to do ...
};

would just make even a little more sense .. some discussion could be about
using $_POST['test1'][$i] to get the value again, or just using the $Value
variable created by the foreach calls...

-----Oorspronkelijk bericht-----
Van: Frank Keessen [mailto:[EMAIL PROTECTED]
Verzonden: zondag 15 juni 2003 21:44
Aan: Frank Keessen; James Hicks
CC: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Capturing the input of dynamic form fields (part
II)


Hi,

Looks like the value's are not coming to the database.. Can you please all
have a close look at my code because it's driving me NUTS!

THANKS FOR YOUR HELP!

<?
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to
connect!");

// select database
mysql_select_db($db) or die ("Unable to select database!");

$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
if($_REQUEST['submit']!="")
{
$nArraySize = count($_POST['test1']);
$test1=$_POST['test1[]'];
$test2=$_POST['test2[]'];

echo $nArraySize;
for($i=0;$i<$nArraySize;$i++) {
$query="INSERT INTO test (test1, test2) VALUES ('$test1[$i]',
'$test2[$i]')";
$result = mysql_query($query);
echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
}

}
?>
<form name="form1" method=post id=form1 enctype=multipart/form-data
action=<?=$_SERVER['PHP_SELF']?>>
<?
 for ($i=1; $i<=2; $i++)
    {
        echo "# $i<input type=\"text\" name=\"test1[$i]\"><br>";
  echo "# $i<input type=\"text\" name=\"test2[$i]\"><br>";

    }

?>
<input type=submit name=submit value=submit>
</form>

Regards,

Frank


----- Original Message -----
From: "Frank Keessen" <[EMAIL PROTECTED]>
To: "James Hicks" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 8:59 PM
Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)


> Hi James,
>
> Sorry to say; I've put your code in it but there are no error message's
> displaying and there is no value inserted in the database... Any clue???
>
> Regards,
>
> Frank
> ----- Original Message -----
> From: "James Hicks" <[EMAIL PROTECTED]>
> To: "Frank Keessen" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 15, 2003 4:14 PM
> Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
>
>
> > Whenever I am having problems with SQL queries I always display the
query
> on
> > the page with all the replaced variables so I can make sure that the
query
> > makes sense. If it passes the MySQL parser in my brain and still doesn't
> > work, I will copy the displayed query into the command line mysql
monitor
> (or
> > phpmyadmin) and try the command manually to see what happens.
> >
> > I also found it easier to solve my SQL problems by not using "or die "
and
> > just displaying some information about the problem query. This way I
know
> > something is wrong if the third line of the echo is not at least 1.
> >
> > $query="INSERT INTO test (test1, test2) VALUES
> >                     ('$_POST['test1']','$_POST['test2']')";
> > $result = mysql_query($query);
> > echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
> >
> >
> > James
> >
> > On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > > Dear all,
> > >
> > > Refering to my first e-mail with the same subject; I've reworked the
> code
> > > to this:
> > >
> > > But the only problem is; Nothing is written into the mysql database!
And
> > > there are no error displayed..
> > >
> > > Can someone have a look at my code?
> > >
> > > <?
> > > $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > > if($_REQUEST['submit']!="")
> > > {
> > > for($i=0;$i<count($_POST['test1[]']);$i++) {
> > > $query="INSERT INTO test (test1, test2) VALUES
> > > ('$_POST['test1']','$_POST['test2']')"; $result = mysql_query($query)
or
> > > die ("Error in query: $query. " . mysql_error()); }
> > > }
> > > ?>
> > > <form name="form1" method=post id=form1 enctype=multipart/form-data
> > > action="<? $_SERVER['PHP_SELF']?>"> <?
> > >  for ($i=1; $i<=2; $i++)
> > >     {
> > >         echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
> > >   echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
> > >
> > >     }
> > >
> > > ?>
> > > <input type=submit name=submit value=submit>
> > > </form>
> > >
> > > Thanks very much,
> > >
> > > Frank
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



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

Wow! Live = beautiful (or is it PHP??)..

Any way:

foreach($_POST['test1'] as $i => $Value) {
> $query = "INSERT INTO test (test1, test2) VALUES
> ('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."')";
> $result = mysql_query($query);

That one did the trick!

Thanks James and Wouter for helping me out!

Frank
----- Original Message ----- 
From: "esctoday.com | Wouter van Vliet" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; "James Hicks"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 10:08 PM
Subject: RE: [PHP] Capturing the input of dynamic form fields (part II)


> First thing I notice as being at least a bit odd is this part:
>
> $nArraySize = count($_POST['test1']);
> $test1=$_POST['test1[]'];
> $test2=$_POST['test2[]'];
>
> what are you trying to do with that? .. What I'd expect it to look like is
> smth like:
>
> $nArraySize = count($_POST['test1']);
> $test1 = $_POST['test1'];
> $test2 = $_POST['test1'];
>
> but probably this:
>
> foreach($_POST['test1'] as $i => $Value) {
> $query = "INSERT INTO test (test1, test2) VALUES
> ('".$_POST['test1'][$i]."', '".$_POST['test2'][$i]."')";
> $result = mysql_query($query);
>
> # and what else you'd want to do ...
> };
>
> would just make even a little more sense .. some discussion could be about
> using $_POST['test1'][$i] to get the value again, or just using the $Value
> variable created by the foreach calls...
>
> -----Oorspronkelijk bericht-----
> Van: Frank Keessen [mailto:[EMAIL PROTECTED]
> Verzonden: zondag 15 juni 2003 21:44
> Aan: Frank Keessen; James Hicks
> CC: [EMAIL PROTECTED]
> Onderwerp: Re: [PHP] Capturing the input of dynamic form fields (part
> II)
>
>
> Hi,
>
> Looks like the value's are not coming to the database.. Can you please all
> have a close look at my code because it's driving me NUTS!
>
> THANKS FOR YOUR HELP!
>
> <?
> // open database connection
> $connection = mysql_connect($host, $user, $pass) or die ("Unable to
> connect!");
>
> // select database
> mysql_select_db($db) or die ("Unable to select database!");
>
> $_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> if($_REQUEST['submit']!="")
> {
> $nArraySize = count($_POST['test1']);
> $test1=$_POST['test1[]'];
> $test2=$_POST['test2[]'];
>
> echo $nArraySize;
> for($i=0;$i<$nArraySize;$i++) {
> $query="INSERT INTO test (test1, test2) VALUES ('$test1[$i]',
> '$test2[$i]')";
> $result = mysql_query($query);
> echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
> }
>
> }
> ?>
> <form name="form1" method=post id=form1 enctype=multipart/form-data
> action=<?=$_SERVER['PHP_SELF']?>>
> <?
>  for ($i=1; $i<=2; $i++)
>     {
>         echo "# $i<input type=\"text\" name=\"test1[$i]\"><br>";
>   echo "# $i<input type=\"text\" name=\"test2[$i]\"><br>";
>
>     }
>
> ?>
> <input type=submit name=submit value=submit>
> </form>
>
> Regards,
>
> Frank
>
>
> ----- Original Message -----
> From: "Frank Keessen" <[EMAIL PROTECTED]>
> To: "James Hicks" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, June 15, 2003 8:59 PM
> Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
>
>
> > Hi James,
> >
> > Sorry to say; I've put your code in it but there are no error message's
> > displaying and there is no value inserted in the database... Any clue???
> >
> > Regards,
> >
> > Frank
> > ----- Original Message -----
> > From: "James Hicks" <[EMAIL PROTECTED]>
> > To: "Frank Keessen" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Sunday, June 15, 2003 4:14 PM
> > Subject: Re: [PHP] Capturing the input of dynamic form fields (part II)
> >
> >
> > > Whenever I am having problems with SQL queries I always display the
> query
> > on
> > > the page with all the replaced variables so I can make sure that the
> query
> > > makes sense. If it passes the MySQL parser in my brain and still
doesn't
> > > work, I will copy the displayed query into the command line mysql
> monitor
> > (or
> > > phpmyadmin) and try the command manually to see what happens.
> > >
> > > I also found it easier to solve my SQL problems by not using "or die "
> and
> > > just displaying some information about the problem query. This way I
> know
> > > something is wrong if the third line of the echo is not at least 1.
> > >
> > > $query="INSERT INTO test (test1, test2) VALUES
> > >                     ('$_POST['test1']','$_POST['test2']')";
> > > $result = mysql_query($query);
> > > echo(mysql_error()."<BR>$query<BR>".mysql_affected_rows($result));
> > >
> > >
> > > James
> > >
> > > On Sunday 15 June 2003 09:39 am, Frank Keessen wrote:
> > > > Dear all,
> > > >
> > > > Refering to my first e-mail with the same subject; I've reworked the
> > code
> > > > to this:
> > > >
> > > > But the only problem is; Nothing is written into the mysql database!
> And
> > > > there are no error displayed..
> > > >
> > > > Can someone have a look at my code?
> > > >
> > > > <?
> > > >
$_REQUEST["submit"]=isset($_REQUEST["submit"])?$_REQUEST["submit"]:"";
> > > > if($_REQUEST['submit']!="")
> > > > {
> > > > for($i=0;$i<count($_POST['test1[]']);$i++) {
> > > > $query="INSERT INTO test (test1, test2) VALUES
> > > > ('$_POST['test1']','$_POST['test2']')"; $result =
mysql_query($query)
> or
> > > > die ("Error in query: $query. " . mysql_error()); }
> > > > }
> > > > ?>
> > > > <form name="form1" method=post id=form1 enctype=multipart/form-data
> > > > action="<? $_SERVER['PHP_SELF']?>"> <?
> > > >  for ($i=1; $i<=2; $i++)
> > > >     {
> > > >         echo "# $i<input type=\"text\" name=\"test1[]\"><br>";
> > > >   echo "# $i<input type=\"text\" name=\"test2[]\"><br>";
> > > >
> > > >     }
> > > >
> > > > ?>
> > > > <input type=submit name=submit value=submit>
> > > > </form>
> > > >
> > > > Thanks very much,
> > > >
> > > > Frank
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
On 10-Jun-2003 Maikel Verheijen wrote:

<snip>

> 
> Unfortunately php does NOT pass on these environment variabeles to the
> program that gets called as the mail-program (In my case my
> mini-sendmail).
> This renders this little "spamfinder" trick unusable, which is too bad :(
> 
> If someone has a clue/trick for me on how to enable this, I would be
> really
> gratefull!
> 

<?php

$cmd='/bin/sh -c "set"';

passthru($cmd);
echo '<P>';
putenv("REMOTE_ADDR=$REMOTE_ADDR");
passthru($cmd);
echo '<P>';

?>

 ------- output wrapped:

HOME=/ PS1='$ ' OPTIND=1 PS2='> ' PPID=2612
PATH=/sbin:/bin:/usr/sbin:/usr/bin IFS=' '

REMOTE_ADDR=127.0.0.2 HOME=/ PS1='$ ' OPTIND=1 PS2='> ' PPID=2614
PATH=/sbin:/bin:/usr/sbin:/usr/bin IFS=' ' 


Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

--- End Message ---
--- Begin Message --- Testing news reader


--- End Message ---
--- Begin Message ---
On Sun, 2003-06-15 at 13:28, jb wrote:
> Testing news reader

Please use a test group for your testing. misc.test is a good bet.


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




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

    As I understand, you are using prepackaged PHP and Apache,
the ones that come with a Linux distribution.
    If you want to continue using this style of RPMs you should
consider looking for an upgrade on the web site for u'r Linux
distro (like redhat's or mandrake's).
    Otherwise, and this is the methos recommended by most
Apache, PHP admins is to download and compile Apache and
PHP.
    The PHP INSTALL file which comes with the sources tarball
and the PHP manual http://www.php.net/manual/en/installation.php
will give you extensive info on how to do it.

cheers,
Catalin


"Davy Campano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am pretty new to Linux and I was wondering if someone can point me in
the right direction on upgrading packages.  Right now, I am looking to
upgrade PHP but actually I would just like to understand how to do any
upgrades.  Do I have to recompile???  If so, how do I do this?  Thanks for
any help!
>



--- End Message ---
--- Begin Message ---
At 2003-06-15 23:57 +0200, Catalin Trifu wrote:
>   As I understand, you are using prepackaged PHP and Apache,
>the ones that come with a Linux distribution.
>    If you want to continue using this style of RPMs you should
>consider looking for an upgrade on the web site for u'r Linux
>distro (like redhat's or mandrake's).
>    Otherwise, and this is the methos recommended by most
>Apache, PHP admins is to download and compile Apache and
>PHP.
>    The PHP INSTALL file which comes with the sources tarball
>and the PHP manual http://www.php.net/manual/en/installation.php
>will give you extensive info on how to do it.
>
>"Davy Campano" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> I am pretty new to Linux and I was wondering if someone can point me in
>the right direction on upgrading packages.  Right now, I am looking to
>upgrade PHP but actually I would just like to understand how to do any
>upgrades.  Do I have to recompile???  If so, how do I do this?  Thanks for
>any help!

I also used to prefer precompiled distributions, but
recently I managed (again) to compile the latest PHP
on a Mandrake 9.0 installation. The problem however
is that it's still quite a lot of work and especially
getting all the right versions of the library files
is frustrating because their interdependency can
be very intricate.

If you are also using Mandrake, you may want to buy
the June issue of www.linuxformat.co.uk which includes
the download version of Mandrake 9.1 on two CD's.
(And a third CD with extra stuff, like the latest
GIMP.) It costs 5.99 pounds. Here in the Netherlands
I bought it for 14 euro. When you order a similar
distribution from Mandrake itself it costs about
twice as much (and you don't get the magazine)
and it will probably at least take some days
to arrive.

The CD's contain PHP version 4.3.1. There is also
a version of the magazine with a double-sided DVD,
but I didn't see it in the shop. I installed
Mandrake 9.0 from the DVD that came with the
magazine PC Pro of May 2003, but in that case
I had to burn three CD-R's from it first. That
doesn't seem to be necessary anymore, which
has the big advantage that you don't have to
stick around during the installation to replace
the CD-ROM's from time to time.

Success,
Jaap


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

    This a SMTP server error.
    It looks like you did not add the header
    FROM: "yourname" [EMAIL PROTECTED]; looks like u'r SMTP
does not allow for messages without FROM header
    as the PHP function:
    mail ( string to, string subject, string message [, string
additional_headers [, string additional_parameters]])
    shows, you can add extra headers to the mail message, so this
is what you need to do.

Cheers,
Catalin

"Jason Marks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
When i send an email i get the following error.


 Warning: mail() [function.mail]: SMTP server response: 550 , Sender unknown
in D:\Hosting\Crushme\includes\inc_register.php on line 138

Is this a server or a PHP error?

/ Philip



--- End Message ---
--- Begin Message ---
On 13-Jun-2003 Marko wrote:
> Hi all,
> 
> Sending multiple emails using PHP - as BCC or multiple mail() commands -
> takes quite long; usually over 50 seconds for 10 addresses.
> While sending these messages the browser won't show anything else but a
> blank page, which is not a very exciting internetexperience for people
> using
> my mailing-application.
> 
> I've been using exactly the same code on some other boxes without any
> extreme delays.
> 
> The box is running Sendmail 8.12.9, PHP 4.3.1 on FreeBSD 4.8.
> 
> Any help greatly appreciated!

It's likely the other boxes are set to queue only or queue at lower loads.
Delivery is done later in the background.

try one of the option string:

'-O DeliveryMode=b'
 -- or, if you can wait for a queue run --
'-O DeliveryMode=q'

mail($to, $subj, $msg, $hdrs, '-O DeliveryMode=q');

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

--- End Message ---
--- Begin Message ---
Hi all...

Is there any way of reading the contents of a directory into an array so I
can generate a listing from it?

I can't see a filesystem function for this, how about with ftp functions? Am
looking around at the moment but would appreciate some help.

I am looking to read each file in the directory into an array ie:

$array_files[1] = "foo.jpg"
$array_files[2] = "bar.jpg"
etc...

So I can then do a foreach and put them all in a drop down box to choose the
image.

Thanks in advance ;o)

Bix



--- End Message ---
--- Begin Message ---
I have found ftp_nlist()

Should suit me perfectly, sorry to trouble!

Bix. ;o)

"Bix" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all...
>
> Is there any way of reading the contents of a directory into an array so I
> can generate a listing from it?
>
> I can't see a filesystem function for this, how about with ftp functions?
Am
> looking around at the moment but would appreciate some help.
>
> I am looking to read each file in the directory into an array ie:
>
> $array_files[1] = "foo.jpg"
> $array_files[2] = "bar.jpg"
> etc...
>
> So I can then do a foreach and put them all in a drop down box to choose
the
> image.
>
> Thanks in advance ;o)
>
> Bix
>
>



--- End Message ---
--- Begin Message ---
I am new to PHP and was wondering if there was a way to do asymmetric
(public/private key) encryption with PHP?  I don't have administrative
(ability to install programs) on either the web server or the client
machines so it seems that neither pgp nor gnupg  will not work.
Thanks in advance,
~Logan



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

Greetings,

We use debian package: php4    4.1.2-6.

We use a GET request to initiate a "status request" 
process on 
another server and want to split the output into fields.

My php code is:

--------------------------
$send  = "GET \ 
/servlet/gateway?Client=TEST&Q=CacheRefreshReque
stStatus \ 
HTTP/1.1\r\n\r\n";
fputs ($conn, $send);
while (!feof ($conn)) {
 $res = fgets ($conn, 1024);
 // Skip the headers.
 if (ereg ("^\r\n$", $res))
  $flag = true;
 if (!$flag)
  continue;
 $refresh_status .= $res;
}

fclose ($conn);

print $refresh_status;

parse_str($refresh_status);
echo $RefreshID1;
echo $PartialRefresh1;
echo $RefreshID2;
echo $PartialRefresh2;

var_dump($RefreshID1);
var_dump($RefreshID2);
-----------------------

The print statement returns:

RefreshID1=3&PartialRefresh1=Y&State1=Running&Re
freshID2=3&P
artialRefresh2=N&State2=Queued&

Now:

echo $RefreshID1;     <---- returns empty 
echo $PartialRefresh1;  <------ returns "Y"
echo $RefreshID2;     <---- returns empty 
echo $PartialRefresh2;  <------ returns "N"

var_dump($RefreshID1);   <----------- returns NULL
var_dump($RefreshID2);   <----------- returns NULL


is this normal behaviour?  
Why would these fields return "NULL", instead of "3" 
and "4"?

What I need to do is split the string into fields separated 
by the "&"
symbol, and then split the subsequent fields into 
subfields separated by
the "=" character.   I then need the values, such as  "3", 
"4", "Y", "N",
"Running", "Queued", etc.

Any help would be appreciated.

Adrian




--- End Message ---
--- Begin Message ---
Hello.
I posted this at several other discussion forums, and i haven't received any
real way of doing this.

i am about 3/4 done with a article management i am working on and came
across a problem i can't seem to figure out.
On to the question ..

I currently have this query:

$result = $db->sql("SELECT * FROM $news GROUP BY time DESC LIMIT
$_GET[page], $pagelimit");
 while($row = mysql_fetch_row($result)) {

echo "$row[title] <br/> Written by $row[author] <br/> $row[text]";

}

I'd like to sort the results by day, example:

Monday's Articles:
all rows that are posted on Monday.....

Tuesday's Articles:
all rows that are posted on Tuesday ...

Etc, etc.. How would I group them like that. I want to echo the actual day
with all the rows of that day falling under it.
can i do this with one query? Or would i have to create multiple queries?
any examples?

Thanx for any help.

cheers,
- Sebastian



--- End Message ---
--- Begin Message --- Sebastian wrote:
I posted this at several other discussion forums, and i haven't received any
real way of doing this.

i am about 3/4 done with a article management i am working on and came
across a problem i can't seem to figure out.
On to the question ..

I currently have this query:

$result = $db->sql("SELECT * FROM $news GROUP BY time DESC LIMIT
$_GET[page], $pagelimit");
 while($row = mysql_fetch_row($result)) {

echo "$row[title] <br/> Written by $row[author] <br/> $row[text]";

Probably a typo, but fetch_row() will not give you $row['title'], $row['text'], etc... fetch_array() and fetch_assoc() will, though. More below...


}

I'd like to sort the results by day, example:

Monday's Articles:
all rows that are posted on Monday.....

Tuesday's Articles:
all rows that are posted on Tuesday ...

Etc, etc.. How would I group them like that. I want to echo the actual day
with all the rows of that day falling under it.
can i do this with one query? Or would i have to create multiple queries?
any examples?

You only need one query. One of your columns should be what you want to "change" on, like DAYOFWEEK(date_column). As you loop through your rows, you echo out your "heading" whenever this column changes...


while($row = mysql_fetch_assoc($result))
{
  if($row['dayofweek_column'] != $old_dayofweek)
  {
    echo "<tr><th>{$row['dayofweek_column']}'s Columns</th></tr>";
    $old_dayofweek = $row['dayofweek_column'];
  }
  echo "$row[title] <br/> Written by $row[author] <br/> $row[text]";
}

Untested, but something like that. :)

---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
the database has the timestamp in unix format, so this is what i use for
'dayofweek_column' ?
what should $old_dayofweek hold?

thankyou.
cheers,
- Sebastian


----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>


| John W. Holmes:
|
| You only need one query. One of your columns should be what you want to
| "change" on, like DAYOFWEEK(date_column). As you loop through your rows,
| you echo out your "heading" whenever this column changes...
|
| while($row = mysql_fetch_assoc($result))
| {
|    if($row['dayofweek_column'] != $old_dayofweek)
|    {
|      echo "<tr><th>{$row['dayofweek_column']}'s Columns</th></tr>";
|      $old_dayofweek = $row['dayofweek_column'];
|    }
|    echo "$row[title] <br/> Written by $row[author] <br/> $row[text]";
| }
|
| Untested, but something like that. :)
|
| ---John Holmes...
|


--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "John W. Holmes"


| John W. Holmes wrote:
|
| You only need one query. One of your columns should be what you want to
| "change" on, like DAYOFWEEK(date_column). As you loop through your rows,
| you echo out your "heading" whenever this column changes...
|
| while($row = mysql_fetch_assoc($result))
| {
|    if($row['dayofweek_column'] != $old_dayofweek)
|    {
|      echo "<tr><th>{$row['dayofweek_column']}'s Columns</th></tr>";
|      $old_dayofweek = $row['dayofweek_column'];
|    }
|    echo "$row[title] <br/> Written by $row[author] <br/> $row[text]";
| }
|
| Untested, but something like that. :)

--

John W. Holmes, Thank you greatly!
With some modifications I got it to work, thanks for pointing me in the
right direction!
.. and yes you were right about the fetch_row, it was a typo.

$result = $db->sql("SELECT * FROM $news GROUP BY time DESC LIMIT
$_GET[page], $pagelimit");
 while($row = mysql_fetch_array($result)) {

$content[timedate] = date("l",$row['time']);

   $newsfor = "";
   if($content[timedate] != $old_dayofweek)
   {
     $newsfor = "<span class=\"newsdate\">News for
$content['datefor']</span> <br/>";
     $old_dayofweek = $content[timedate];
   }

echo "$newsfor $row[title] <br/> Written by $row[author] <br/> $row[text]";

}


cheers,
- Sebastian





--- End Message ---
--- Begin Message ---
My code is this ...

<?php

// MAIL HEADERS.

             $headers = "X-Priority: 1\n";
             $headers .= "Return-path: <[EMAIL PROTECTED]>\n";
             $headers .= "From: \"Philip Newman\"  <[EMAIL PROTECTED]>\n";
             $headers .= "Reply-To: \"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>\n";
 
             $msg = "Dear $mUserName,\n\n";
             $msg .= "You have requested a user account on  Untouched. To activate 
this account\n";
             $msg .= "click on the link below.  Please save this email so you dont 
forget your user\n";
             $msg .= "name and password.\n\n"; 
             $msg .= "$siteDomain/b.php?ID=$timestamp.\n\n";
             $msg .= "If you have received this email in error please disregard it and 
delete it...\n\n";
             $msg .= "Username: $mUserName.\n";
             $msg .= "Password: $mPassword\n\n";
             $msg .= "Thanks.\n";
             $msg .= "Philip Newman\n";

                      mail("$mEmail", "The Crush Me Account Info.", $msg, $headers);


?>
             
Warning: mail() [function.mail]: SMTP server response: 550 , Sender unknown in 
D:\Hosting\Undercover\includes\inc_signup.php on line 138


Thats my error ... will the server only relay the message to A local account?


----- Original Message ----- 
From: "Catalin Trifu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 10:08 AM
Subject: [PHP] Re: [Newman] When i send an email it ...


>         Hi,
> 
>     This a SMTP server error.
>     It looks like you did not add the header
>     FROM: "yourname" [EMAIL PROTECTED]; looks like u'r SMTP
> does not allow for messages without FROM header
>     as the PHP function:
>     mail ( string to, string subject, string message [, string
> additional_headers [, string additional_parameters]])
>     shows, you can add extra headers to the mail message, so this
> is what you need to do.
> 
> Cheers,
> Catalin
> 
> "Jason Marks" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> When i send an email i get the following error.
> 
> 
>  Warning: mail() [function.mail]: SMTP server response: 550 , Sender unknown
> in D:\Hosting\Crushme\includes\inc_register.php on line 138
> 
> Is this a server or a PHP error?
> 
> / Philip
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
The error is your answer.  The server is setup to relay mail for specific 
domains/users.  Evidently, the user "[EMAIL PROTECTED]" is not one of those 
users/domains.

If you are the administrator for this box, check your documentation for your 
specific SMTP server for setting relay for that domain.  
If you are not the admin, contact that person.

Quoting "Philip J. Newman" <[EMAIL PROTECTED]>:

> My code is this ...
> 
> <?php
> 
> // MAIL HEADERS.
> 
>              $headers = "X-Priority: 1\n";
>              $headers .= "Return-path: <[EMAIL PROTECTED]>\n";
>              $headers .= "From: \"Philip Newman\" 
> <[EMAIL PROTECTED]>\n";
>              $headers .= "Reply-To: \"[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]>\n";
>  
>              $msg = "Dear $mUserName,\n\n";
>              $msg .= "You have requested a user account on  Untouched. To
> activate this account\n";
>              $msg .= "click on the link below.  Please save this email so you
> dont forget your user\n";
>              $msg .= "name and password.\n\n"; 
>              $msg .= "$siteDomain/b.php?ID=$timestamp.\n\n";
>              $msg .= "If you have received this email in error please
> disregard it and delete it...\n\n";
>              $msg .= "Username: $mUserName.\n";
>              $msg .= "Password: $mPassword\n\n";
>              $msg .= "Thanks.\n";
>              $msg .= "Philip Newman\n";
> 
>                       mail("$mEmail", "The Crush Me Account Info.", $msg,
> $headers);
> 
> 
> ?>
>              
> Warning: mail() [function.mail]: SMTP server response: 550 , Sender unknown
> in D:\Hosting\Undercover\includes\inc_signup.php on line 138
> 
> 
> Thats my error ... will the server only relay the message to A local
> account?
> 
> 
> ----- Original Message ----- 
> From: "Catalin Trifu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 16, 2003 10:08 AM
> Subject: [PHP] Re: [Newman] When i send an email it ...
> 
> 
> >         Hi,
> > 
> >     This a SMTP server error.
> >     It looks like you did not add the header
> >     FROM: "yourname" [EMAIL PROTECTED]; looks like u'r SMTP
> > does not allow for messages without FROM header
> >     as the PHP function:
> >     mail ( string to, string subject, string message [, string
> > additional_headers [, string additional_parameters]])
> >     shows, you can add extra headers to the mail message, so this
> > is what you need to do.
> > 
> > Cheers,
> > Catalin
> > 
> > "Jason Marks" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > When i send an email i get the following error.
> > 
> > 
> >  Warning: mail() [function.mail]: SMTP server response: 550 , Sender
> unknown
> > in D:\Hosting\Crushme\includes\inc_register.php on line 138
> > 
> > Is this a server or a PHP error?
> > 
> > / Philip
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 


=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

-----------------------------------------------
 This email sent using CDM Sports Webmail v3.1
              [ http://webmail.cdmsports.com ]

--- End Message ---
--- Begin Message ---
Ahh yess .. I found the issue.

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

The sendmail_from was not a valid email it was set to an email that was
deleted from the system a week ago.

Sweet as

----- Original Message -----
From: "Michael Geier" <[EMAIL PROTECTED]>
To: "Philip J. Newman" <[EMAIL PROTECTED]>
Cc: "PHP" <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 2:56 PM
Subject: Re: [PHP] / [Newman] When i send an email it ...


> The error is your answer.  The server is setup to relay mail for specific
> domains/users.  Evidently, the user "[EMAIL PROTECTED]" is not one of
those
> users/domains.
>
> If you are the administrator for this box, check your documentation for
your
> specific SMTP server for setting relay for that domain.
> If you are not the admin, contact that person.
>
> Quoting "Philip J. Newman" <[EMAIL PROTECTED]>:
>
> > My code is this ...
> >
> > <?php
> >
> > // MAIL HEADERS.
> >
> >              $headers = "X-Priority: 1\n";
> >              $headers .= "Return-path: <[EMAIL PROTECTED]>\n";
> >              $headers .= "From: \"Philip Newman\"
> > <[EMAIL PROTECTED]>\n";
> >              $headers .= "Reply-To: \"[EMAIL PROTECTED]"
> > <[EMAIL PROTECTED]>\n";
> >
> >              $msg = "Dear $mUserName,\n\n";
> >              $msg .= "You have requested a user account on  Untouched.
To
> > activate this account\n";
> >              $msg .= "click on the link below.  Please save this email
so you
> > dont forget your user\n";
> >              $msg .= "name and password.\n\n";
> >              $msg .= "$siteDomain/b.php?ID=$timestamp.\n\n";
> >              $msg .= "If you have received this email in error please
> > disregard it and delete it...\n\n";
> >              $msg .= "Username: $mUserName.\n";
> >              $msg .= "Password: $mPassword\n\n";
> >              $msg .= "Thanks.\n";
> >              $msg .= "Philip Newman\n";
> >
> >                       mail("$mEmail", "The Crush Me Account Info.",
$msg,
> > $headers);
> >
> >
> > ?>
> >
> > Warning: mail() [function.mail]: SMTP server response: 550 , Sender
unknown
> > in D:\Hosting\Undercover\includes\inc_signup.php on line 138
> >
> >
> > Thats my error ... will the server only relay the message to A local
> > account?
> >
> >
> > ----- Original Message -----
> > From: "Catalin Trifu" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 16, 2003 10:08 AM
> > Subject: [PHP] Re: [Newman] When i send an email it ...
> >
> >
> > >         Hi,
> > >
> > >     This a SMTP server error.
> > >     It looks like you did not add the header
> > >     FROM: "yourname" [EMAIL PROTECTED]; looks like u'r SMTP
> > > does not allow for messages without FROM header
> > >     as the PHP function:
> > >     mail ( string to, string subject, string message [, string
> > > additional_headers [, string additional_parameters]])
> > >     shows, you can add extra headers to the mail message, so this
> > > is what you need to do.
> > >
> > > Cheers,
> > > Catalin
> > >
> > > "Jason Marks" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > When i send an email i get the following error.
> > >
> > >
> > >  Warning: mail() [function.mail]: SMTP server response: 550 , Sender
> > unknown
> > > in D:\Hosting\Crushme\includes\inc_register.php on line 138
> > >
> > > Is this a server or a PHP error?
> > >
> > > / Philip
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
>
>
> =======================================
> Michael Geier
> CDM Sports, Inc. Systems Administration
>    email: [EMAIL PROTECTED]
>    phone: 314.692.3540
>
> -----------------------------------------------
>  This email sent using CDM Sports Webmail v3.1
>               [ http://webmail.cdmsports.com ]
>
>


--- End Message ---
--- Begin Message --- I think you need a \r\n between the headers,



Philip J. Newman wrote:
My code is this ...

<?php

// MAIL HEADERS.

$headers = "X-Priority: 1\n";
$headers .= "Return-path: <[EMAIL PROTECTED]>\n";
$headers .= "From: \"Philip Newman\" <[EMAIL PROTECTED]>\n";
$headers .= "Reply-To: \"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>\n";


--- End Message ---
--- Begin Message --- I'm using the mysql driver, so $server = "mysql"; I am also very confident that mysql support is provided correctly through php because up until recently I've used mysql_....() functions and never experienced a problem.

I have no problem connecting, it's just the query() function doesn't want to go, it keeps telling me that no function exists.

I tried the code you wrote and it didn't produce any errors.

The following code is available at: http://beta.insyderhomielc.com/dbtest.php

<.?php

// Set the include path for when I'm working with PEAR
ini_set("include_path","/usr/share/pear/");
// Grab DB for me
include("/usr/share/pear/DB.php");

// My connection info that I use everywhere is in here
include("functions/connect.mn.php");

// Now connect me
$db = DB::connect("$server://$user:[EMAIL PROTECTED]/$database");

// Query to the db
$query = "SELECT * FROM ps_config WHERE site=1";
$result = $db->query($query) or die("I could not connect to the PageSite configuration table in the SQL database.");


// Store the results in an associative array
$config = $result->fetchRow(DB_FETCHMODE_ASSOC);

?.>

If you need to see my php configuration go to: http://beta.insyderhomielc.com/php.php

I'll be honest, I am clueless. I don't have a single problem on my harddrive.

This is consistent though, I had the same problem on another CPanel based server.

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

Hei, everyone
My configuration is working now. Thank's for everybody helps.
My apache is able to parse the .php4 extension.
I found that i shouldn't save my .php4 in document format. I have to use notepad instead of world pad. I dun know why it works in notepad but not in world pad. Can anyone tell me why?

Note: forwarded message attached.


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
--- Begin Message ---
oh, I see. My bad, my mistake...

I also have had problems with apache/php in the past. The apache couldn't
parse the php files. All the php tags were interpreted as normal text and
displayed to the browser.

So, try :
>>>>>>
phpinfo();
>>>>>>
into one of your php files.

it should work if your apache/php server is configured properly.


Good luck!

------------------------
Alex Ciurea Greets You
www.netonwave.com
----- Original Message -----
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Alex Ciurea" <[EMAIL PROTECTED]>
Cc: "php mailinlist" <[EMAIL PROTECTED]>; "Khoo Merry"
<[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 11:18 AM
Subject: Re: [PHP] is my server working


> On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> > try to use echo instead of print()   :
> >
> > >>>>>>
> > echo $myString;
> > >>>>>>
> >
> > or, if u realy want to use the print function, try this:
> >
> > >>>>>>
> > print("$myString", %s);
> > >>>>>>
> >
> > maybe will work
> >
> > ------------------------
> > Alex Ciurea Greets You
> > www.netonwave.com
>
>
> I think you might be getting confused with printf(). In that case, the
> above would be:
>
>   printf("%s", $myString);
>
> In any event, the choice will have no impact here. It simply appears
> that the original poster has not got PHP installed properly, or else
> the system is not configured to pass that page of through PHP.
>
>
>   http://www.php.net/print
>   http://www.php.net/printf
>
>
> --
>  Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
>  http://www.thebuttlesschaps.com          http://www.inflatableeye.com
>  http://www.hybrid17.com                  http://www.themainonmain.com
>  -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----
>
>
>
>
> --
> 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 ---

--- End Message ---
--- Begin Message ---
On Sun, 2003-06-15 at 19:56, Khoo Merry wrote:
> Hei, everyone
> My configuration is working now. Thank's for everybody helps.
> My apache is able to parse the .php4 extension. 
> I found that i shouldn't save my .php4 in document format. I have to
> use notepad instead of world pad. I dun know why it works in notepad
> but not in world pad. Can anyone tell me why?

Yes: your scripts need to be in plain text format, and was saving the
formatting and other information along with the text--probably in some
binary format that only Microsoft fully understands. There might be an
option to save to plain text (*.txt) but it's been a couple of years
since I've used it and I'm not sure.


Torben


P.S. Please turn off HTML email when emailing this list.


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




--- End Message ---
--- Begin Message ---
<?php $data = "" ?>
<html><body>"
<?php echo ("$data"); ?>"
</body></html>
 
If you want the out put "message". You can just simply put the " before and after the php code. Try this code.  
 
good luck

Note: forwarded message attached.


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
--- Begin Message ---


From: Gabor Hojtsy <[EMAIL PROTECTED]> To: Shien Hang Low <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: need help on coding Date: Sun, 15 Jun 2003 12:26:53 +0200

Please ask support questions at [EMAIL PROTECTED]

Goba

Shien Hang Low :
hi there,
i am very sorry, previously i have send you an email but it is the email wich code is wrong, so this is the correct one. thank you
i am a php code user and i have below questions and problems
wish you could help me out and i think it is very easy for you.
thank you .


problem :

code :
<?
$data= "message";
echo $data;
?>

output :
message
-----------------------------------
if i want the output to be :
"message"

i try to used the below code but fail:
<?
$data = ""message"";
echo $data;
?>

so i wonder if i want to get the output that with the
'quatation' mark  how can i do it, your help means alot to me
thank you for your time and patient .

best regards,
shienhang

_________________________________________________________________
Are you in love? Find a date on MSN Personals http://match.msn.com.my/



_________________________________________________________________
Download ringtones, logos and picture messages from MSN Malaysia http://www.msn.com.my/mobile/ringtones/default.asp



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

--- End Message ---

--- End Message ---
--- Begin Message ---
When a session is started on my server, it gets a name in the
"sessiondata" folder like:
 
sess_8sjg4893m9d0j43847dk4o5l2
 
 
I was just wondering if all sessions on ANY server start with "sess_"?
Is this a PHP-wide default, or can it be changed (not that I want to
change it, I just want to know if it can be changed)?
 
Thanks,
 
Matt

--- End Message ---
--- Begin Message ---
On 16-Jun-2003 Matt Palermo wrote:
> When a session is started on my server, it gets a name in the
> "sessiondata" folder like:
>  
> sess_8sjg4893m9d0j43847dk4o5l2
>  
>  
> I was just wondering if all sessions on ANY server start with "sess_"?
> Is this a PHP-wide default, or can it be changed (not that I want to
> change it, I just want to know if it can be changed)?
>  

localhost.root# grep -r sess_ *
ext/session/mod_files.c:#define FILE_PREFIX "sess_"

Modify session/mod_files.c & recompile.

 -- 
or you can try your own handler:

http://www.php.net/manual/en/function.session-set-save-handler.php


Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                          


--- End Message ---
--- Begin Message ---
On Sun, 2003-06-15 at 06:44, DvDmanDT wrote:
> Hello... Today I downloaded 'phpfi' from CVS and I was wondering how to
> build it? It included no dsw/dsp files so I tried cygwin
> ./configure
> make
> cd src
> make
> 
> but it doesn't work... Says like no rules or something... Or that it doesn't
> know how to build... So, how?
> 
> Thanks in advance // DvDmanDT

phpfi? Are you sure you want to be building a version of PHP that's been
obsolete for half a decade?

If you're sure you know what you're doing and my snide comment hasn't
already put you off, the README indicates that you should be able to do
it with cygwin (although I don't know what might have changed between
the time that was written in 1998 and now). Give that a read--might have
something you can use.

Other than that, all I can say is that PHP/FI was never really
recommended for use on Win32 except as kind of an experiment. Unless you
need to do it for a very good reason, I'd say stick with PHP 4. :)


Cheers,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




--- End Message ---
--- Begin Message ---
Is this up on the web somewhere for us to test?

Justin


on 16/06/03 3:09 AM, MH_Hong ([EMAIL PROTECTED]) wrote:

> I have a very simple php code as below, but may i know why my SID changes
> every time i refresh the page?
> Do i need  to change anything in PHP.ini?? thanks
> <?php
> session_start();
> ?>
> <?php echo SID?>
> 
> MH Hong
> 


--- End Message ---
--- Begin Message ---
I have several admin modules for my portal. And I have also several admin users who 
are supposed to have access only to certain modules.

Say, the superadmin can access ALL modules (modA, modB, modC, modD) and
admin-A can only access modA and modB
admin-B can only access modA and modD
...
...

How can I setup my ACL that do bit (XOR) checking ?
Please advise.



---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

--- End Message ---
--- Begin Message ---
See this article:

http://www.zend.com/zend/trick/tricks-august-2001.php

It got me well on the way to understanding this.


You will need to combine with some sort of user/session/login management
script, but there are hundreds of articles on the web about this.

Personally, I started with an article by Kevin Yank on sitepoint.com, but
it's now pretty out of date (pre register globals off)... I doubt there's
even one line of code left that is his... as my understanding grew, I built
things the way I wanted.

There are definitely a few articles to help you with this on zend.com as
well, eg:

http://www.zend.com/zend/tut/


Trust me, take a little bit of time to learn what's going on with session
based authentication, then a little more understanding how to protect and
download files, then blend them together.  Not only will you have source
code that you completely understand, you'll also have exactly what you want,
with the power to extend it as you wish.



Justin French
---------------------------------
Indent.com.au
---------------------------------
Graphic, Web & Information Design
Web Application Development
---------------------------------
e: mailto:[EMAIL PROTECTED]
w: http://www.indent.com.au
t: 03 9531 4304 (+61 3 9531 4304)
m: 0414 243 462 (+61 414 243 462)
---------------------------------




on 16/06/03 12:32 AM, Peter Berglund ([EMAIL PROTECTED]) wrote:

> ok, I change my question, how do I protect downloadable files from users
> that are not valid?
> without the use of htaccess?
> 
> "Peter Berglund" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
>> I want to send user and password from php to a protected directory.
>> For example: If I go directly to the directory I get a popup to enter user
>> and password, the normallt way.
>> 
>> But if I go through a php-script that checks if I'm a valid user from a
>> database I will get access to the folder.
>> 
>> So i need a way to send user/password from php to the .htaccess file.
>> 
>> 
> 
> 


--- End Message ---
--- Begin Message ---
thanks all for all

i will test them


"M-Ali Mahmoodi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi all
> i'm a beginner in php
> can anyone help me about useful and powerful editors in php?
>
>
>



--- End Message ---
--- Begin Message ---
if no newer editors?
so the old messages suggest the older!


"Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2003-06-14 at 12:59, electroteque wrote:
> > boy how painfully dweebish is vi why make it harder for yourself :O
>
> Please don't start this again. If you want arguments about editors just
> read the old ones in the archives. It's highly unlikely that any useful
> new arguments will be made if we start a new flamewar over it. :) Just
> suggesting one or two editors you like is more useful.
>
>
>
> --
>  Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
>  http://www.thebuttlesschaps.com          http://www.inflatableeye.com
>  http://www.hybrid17.com                  http://www.themainonmain.com
>  -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----
>
>
>



--- End Message ---
--- Begin Message ---
This is driving me buggy...

I just upgraded to RH 8 which included an Apache 2.0 update.

PHP and MySQL work OK independently; I can call mysql_connect() from the
command line, but an attempt to do so from a script within Apache returns a
"Fatal error: Call to undefined function: mysql_connect()"

I tried to install php-mysql-4.2.2-8.0.7.i386.rpm but am getting:

warning: php-mysql-4.2.2-8.0.7.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
error: Failed dependencies:
        php = 4.2.2-8.0.7 is needed by php-mysql-4.2.2-8.0.7
        libmysqlclient.so.10 is needed by php-mysql-4.2.2-8.0.7

Attempts to install the client RPM return messages that it's already
installed.

I saw a message in the RH archive about this, but could not locate a
resolution.

phpinfo dump follows.

System info:
PHP Version 4.2.2
RH Kernel 2.4.18-14
Server API Apache 2.0 Filter
Apache 2.0.40

Thanks...

Dan


PHP Version 4.2.2

System Linux daffy.perf.redhat.com 2.4.18-11smp #1 SMP Thu Aug 15 06:41:59
EDT 2002 i686 i686 i386 GNU/Linux
Build Date Sep 3 2002 05:25:09
Configure Command './configure' '--host=i686-pc-linux-gnu'
'--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share'
'--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec'
'--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
'--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3'
'--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd'
'--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext'
'--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
'--with-openssl' '--with-png' '--with-pspell' '--with-regex=system'
'--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU'
'--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes'
'--enable-safe-mode' '--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-discard-path' '--enable-track-vars'
'--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8'
'--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr'
'--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared'
'--enable-memory-limit' '--enable-bcmath' '--enable-shmop'
'--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio'
'--enable-mcal' '--with-apxs2=/usr/sbin/apxs'
Server API Apache 2.0 Filter
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php.ini
Debug Build no
Thread Safety disabled

 This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies



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

PHP 4 Credits

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

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference
 On On
allow_url_fopen
 1 1
always_populate_raw_post_data
 0 0
arg_separator.input
 & &
arg_separator.output
 & &
asp_tags
 Off Off
auto_append_file
 no value no value
auto_prepend_file
 no value no value
browscap
 no value no value
default_charset
 no value no value
default_mimetype
 text/html text/html
define_syslog_variables
 Off Off
disable_functions
 no value no value
display_errors
 On On
display_startup_errors
 Off Off
doc_root
 no value no value
enable_dl
 On On
error_append_string
 no value no value
error_log
 no value no value
error_prepend_string
 no value no value
error_reporting
 2039 2039
expose_php
 On On
extension_dir
 /usr/lib/php4 /usr/lib/php4
file_uploads
 1 1
gpc_order
 GPC GPC
highlight.bg
 #FFFFFF #FFFFFF
highlight.comment
 #FF9900 #FF9900
highlight.default
 #0000CC #0000CC
highlight.html
 #000000 #000000
highlight.keyword
 #006600 #006600
highlight.string
 #CC0000 #CC0000
html_errors
 On On
ignore_user_abort
 Off Off
implicit_flush
 Off Off
include_path
 .:/usr/share/pear .:/usr/share/pear
log_errors
 Off Off
magic_quotes_gpc
 On On
magic_quotes_runtime
 Off Off
magic_quotes_sybase
 Off Off
max_execution_time
 30 30
memory_limit
 8M 8M
open_basedir
 no value no value
output_buffering
 no value no value
output_handler
 no value no value
post_max_size
 8M 8M
precision
 14 14
register_argc_argv
 On On
register_globals
 Off Off
safe_mode
 Off Off
safe_mode_exec_dir
 no value no value
safe_mode_gid
 Off Off
safe_mode_include_dir
 no value no value
sendmail_from
 [EMAIL PROTECTED] [EMAIL PROTECTED]
sendmail_path
 /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
short_open_tag
 Off Off
SMTP
 localhost localhost
sql.safe_mode
 Off Off
track_errors
 Off Off
unserialize_callback_func
 no value no value
upload_max_filesize
 2M 2M
upload_tmp_dir
 no value no value
user_dir
 no value no value
variables_order
 EGPCS EGPCS
xmlrpc_error_number
 0 0
xmlrpc_errors
 Off Off
y2k_compliance
 Off Off


yp
YP Support enabled


xml
XML Support active
XML Namespace Support active
EXPAT Version expat_1.95.4


wddx
WDDX Support enabled
WDDX Session Serializer enabled


standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i

Directive Local Value Master Value
assert.active
 1 1
assert.bail
 0 0
assert.callback
 no value no value
assert.quiet_eval
 0 0
assert.warning
 1 1
safe_mode_allowed_env_vars
 PHP_ PHP_
safe_mode_protected_env_vars
 LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags
 a=href,area=href,frame=src,input=src,form=fakeentry
a=href,area=href,frame=src,input=src,form=fakeentry


sockets
Sockets Support enabled


shmop
shmop support enabled


session
Session Support enabled

Directive Local Value Master Value
session.auto_start
 Off Off
session.cache_expire
 180 180
session.cache_limiter
 nocache nocache
session.cookie_domain
 no value no value
session.cookie_lifetime
 0 0
session.cookie_path
 / /
session.cookie_secure
 Off Off
session.entropy_file
 no value no value
session.entropy_length
 0 0
session.gc_maxlifetime
 1440 1440
session.gc_probability
 1 1
session.name
 PHPSESSID PHPSESSID
session.referer_check
 no value no value
session.save_handler
 files files
session.save_path
 /tmp /tmp
session.serialize_handler
 php php
session.use_cookies
 On On
session.use_trans_sid
 1 1


pspell
PSpell Support enabled


posix
Revision $Revision: 1.42.2.2 $


pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 3.4 22-Aug-2000


openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.6b [engine] 9 Jul 2001


iconv
iconv support enabled

Directive Local Value Master Value
iconv.input_encoding
 ISO-8859-1 ISO-8859-1
iconv.internal_encoding
 ISO-8859-1 ISO-8859-1
iconv.output_encoding
 ISO-8859-1 ISO-8859-1


gmp
gmp support enabled


gettext
GetText Support enabled


gd
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled


ftp
FTP support enabled


exif
EXIF Support enabled
EXIF Version 1.2
Supported EXIF Version 02100
Supported filetypes JPEG,TIFF


domxml
DOM/XML enabled
libxml Version 2.4.23
HTML Support enabled
XPath Support enabled
XPointer Support enabled


dio
dio support enabled


dbx
dbx support enabled
dbx version 1.0.0
supported databases MySQL
ODBC
PostgreSQL
Microsoft SQL Server
FrontBase
Oracle 8 (not really)
Sybase-CT


dba
DBA support enabled
Supported handlers gdbm db3


curl
CURL support enabled
CURL Information libcurl 7.9.8 (OpenSSL 0.9.6b) (ipv6 enabled)


ctype
ctype functions enabled (experimental)


calendar
Calendar support enabled


bz2
BZip2 Support Enabled
BZip2 Version 1.0.2, 30-Dec-2001


bcmath
BCMath support enabled


zlib
ZLib Support enabled
'zlib:' fopen wrapper enabled
Compiled Version 1.1.4
Linked Version 1.1.4

Directive Local Value Master Value
zlib.output_compression
 Off Off


imap
IMAP Support enabled
IMAP c-Client Version 2001
SSL Support enabled
Kerberos Support enabled


ldap
LDAP Support enabled
RCS Version $Id: ldap.c,v 1.116.2.1 2002/04/23 18:59:57 derick Exp $
Total Links 0/unlimited
API Version 2004
Vendor Name OpenLDAP
Vendor Version 20025


pgsql
PostgreSQL Support enabled
Active Persistent Links 0
Active Links 0

Directive Local Value Master Value
pgsql.allow_persistent
 On On
pgsql.auto_reset_persistent
 Off Off
pgsql.max_links
 Unlimited Unlimited
pgsql.max_persistent
 Unlimited Unlimited


Apache 2.0
Additional Modules
sysvshm
sysvsem


Environment
Variable Value
PATH /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PWD /
LANG en_US
SHLVL 1
_ /sbin/initlog


PHP Variables
Variable Value
_SERVER["UNIQUE_ID"] ubFsusCoAQEAAAT7hvoAAAAF
_SERVER["HTTP_ACCEPT"] */*
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
_SERVER["HTTP_HOST"] 192.168.1.1
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.0.40 Server at 192.168.1.1
Port 80</address>

_SERVER["SERVER_SOFTWARE"] Apache/2.0.40 (Red Hat Linux)
_SERVER["SERVER_NAME"] 192.168.1.1
_SERVER["SERVER_ADDR"] 192.168.1.1
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 192.168.1.2
_SERVER["DOCUMENT_ROOT"] /var/www/html
_SERVER["SERVER_ADMIN"] [EMAIL PROTECTED]
_SERVER["SCRIPT_FILENAME"]
/var/www/html/wildwis/core/phpscratch/phpinfo.php3
_SERVER["REMOTE_PORT"] 1780
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"]
_SERVER["REQUEST_URI"] /wildwis/core/phpscratch/phpinfo.php3
_SERVER["SCRIPT_NAME"] /wildwis/core/phpscratch/phpinfo.php3
_SERVER["PHP_SELF"] /wildwis/core/phpscratch/phpinfo.php3
_SERVER["argv"] Array
(
)


_SERVER["argc"] 0
_ENV["PATH"] /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
_ENV["PWD"] /
_ENV["LANG"] en_US
_ENV["SHLVL"] 1
_ENV["_"] /sbin/initlog


PHP License
This program is free software; you can redistribute it and/or modify it
under the terms of the PHP License as published by the PHP Group and
included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions
about PHP licensing, please contact [EMAIL PROTECTED]




--- End Message ---
--- Begin Message ---
On Monday 16 June 2003 13:49, Daniel R. Hansen wrote:

> Attempts to install the client RPM return messages that it's already
> installed.

What version of MySQL do you have installed? And where did you get it from? If 
it's not from Redhat then it's best that you remove it and install Redhat's.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
"Rembrandt's first name was Beauregard, which is why he never used it."
                -- Dave Barry
*/


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

I built a MySQL table for all authorized users and
their password , when user correctly enter his
username and password he can access to a PHP site that
contains a link to all document he need

When he click on one of the document to he can
download it, the URL will appear  : 
http://www.myweb/data/data.pdf

My problem is if any one get this URL or the path he
can get the document without authorized.
I need a way in which any one who try to get these
document from the URL get a message to ask him to
Login.


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---
--- Begin Message --- Mishari wrote:

Hi All

I built a MySQL table for all authorized users and
their password , when user correctly enter his
username and password he can access to a PHP site that
contains a link to all document he need

When he click on one of the document to he can
download it, the URL will appear : http://www.myweb/data/data.pdf


My problem is if any one get this URL or the path he
can get the document without authorized.
I need a way in which any one who try to get these
document from the URL get a message to ask him to
Login.

tore them below the web root, and create a script which takes the name of the file being downloaded. If the user has correct access, it passthru()s the file. If not, it shows a login screen.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



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

See if this helps you get started. I assume each user has an ID. If so all
you have to do is make a query above $userid that fetches the user ID of the
user that is auth to download.. Also, edit the $path to the location of the
files, you can download a file by file.php?file=a_file.zip -- he/she wont be
able to tell were the actual URL to the file is. you can also edit echo
"please login."; to something like a redirect to a login page, etc..


<?php
error_reporting(E_ALL);

$path   = '/home/user/files/';
$userid = array(1,2,3); //which IDs can access files

if ( empty($_REQUEST['file']) ||
!preg_match("/^[a-zA-Z_0-9]+.+[a-zA-Z0-9]+$/", $_REQUEST['file']) ) {
 die('Not a valid URL.');
}

if (!in_array($userid) ) {
 echo "please login.";
 die();
}
header("Content-type: application/octet-stream\n");
header("Content-disposition: attachment; filename=\"" . $_REQUEST['file'] .
"\"\n");
header("Content-transfer-encoding: binary\n");
header("Content-length: " . filesize($path . $_REQUEST['file']) . "\n");

$fp = fopen($path . $_REQUEST['file'], "r");

fpassthru($fp);
die();
?>

----- Original Message -----
From: "Mishari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 16, 2003 2:30 AM
Subject: [PHP] Please I need help it's very Urgent (Prevent un-authorized
users to download document)


| Hi All
|
| I built a MySQL table for all authorized users and
| their password , when user correctly enter his
| username and password he can access to a PHP site that
| contains a link to all document he need
|
| When he click on one of the document to he can
| download it, the URL will appear  :
| http://www.myweb/data/data.pdf
|
| My problem is if any one get this URL or the path he
| can get the document without authorized.
| I need a way in which any one who try to get these
| document from the URL get a message to ask him to
| Login.


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

Is it possible to implement an object pooling service with PHP?
Something like COM+ or IAS (Inprise Application Server)...
any ideas?

regards,
Sepho






--- End Message ---
--- Begin Message ---
Hello... I'm having a hard time passing values from one php scripts to the other because it doesn't seem to work. Here's part of the script


session_start();
require_once("./functions.php");
$usrname = $_POST['usrname'];
$passwrd= $_POST['passwrd'];
session_register('usrname');
session_register('passwrd');
$_SESSION['usrname']=$usrname;
$_SESSION['passwrd'] = $passwrd;


I don't know what's wrong with it. Maybe I missed something here. Btw, this doesn't happened on Mozilla.


Thanks in advance.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

--- End Message ---

Reply via email to