|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Thu Aug 22 2002 - 21:31:49 CDT
php-general Digest 23 Aug 2002 02:31:49 -0000 Issue 1541
Topics (messages 113616 through 113709):
insert query fails w/ postgres database
113616 by: Javier Montserat
oops - solved re: insert fails w/ postgres database
113617 by: Javier Montserat
PDFlib error help --
113618 by: Hank Marquardt
113624 by: Rasmus Lerdorf
113627 by: Hank Marquardt
Pausing PHP?
113619 by: Erich Kolb
113621 by: Rasmus Lerdorf
113623 by: Jay Blanchard
mysql upate return false?
113620 by: Randy Johnson
113622 by: Rasmus Lerdorf
113625 by: Adam Williams
113626 by: Randy Johnson
113628 by: Rasmus Lerdorf
Re: Question about sessions: how to force expiry
113629 by: Peter Bottenberg
113635 by: Jason Wong
Get directory items, read file lines...
113630 by: Bill Leonard
113631 by: Jay Blanchard
113632 by: Joseph W. Goff
113637 by: Robert Cummings
113638 by: Richard Black
113640 by: Robert Cummings
!!! error messages about the use of uninitialized variables !!!
113633 by: Djurovski Dejan
113634 by: Jay Blanchard
113645 by: Evan Nemerson
default value of a variable
113636 by: Support . Fourthrealm.com
113639 by: Rasmus Lerdorf
113643 by: Evan Nemerson
Re: How Do You Protect Individual Files
113641 by: Roger Lewis
113653 by: Justin French
113688 by: Roger Lewis
113697 by: Roger Lewis
113705 by: Jason Wong
Assigning PHP Arrays to Javascript arrays
113642 by: Kicenko, Frank
passchange.php or changepass.php
113644 by: Michael Lee (TOR)
Re: OOP / dynamic SQL class
113646 by: Peter J. Schoenster
Digest Authentication
113647 by: Seairth Jacobs
113650 by: Rasmus Lerdorf
113651 by: Matt Schroebel
113652 by: Seairth Jacobs
113656 by: Seairth Jacobs
113657 by: Seairth Jacobs
113666 by: Manuel Lemos
113668 by: Chris Shiflett
113670 by: Manuel Lemos
113673 by: Seairth Jacobs
113675 by: Manuel Lemos
113690 by: Chris Shiflett
113695 by: Manuel Lemos
113696 by: Chris Shiflett
113704 by: Seairth Jacobs
113709 by: Manuel Lemos
Re: Web Site
113648 by: Paul Roberts
HELP HELP with a problem.
113649 by: Dan McCullough
<?=$var?> ..equiv w/ short-tags: off;
113654 by: Thoenen, Peter Mr. EPS
113655 by: Rasmus Lerdorf
113660 by: Thoenen, Peter Mr. EPS
Redirect?
113658 by: Erich Kolb
113659 by: Clint Tredway
113661 by: Kondwani Spike Mkandawire
113662 by: Chris Shiflett
113665 by: Lowell Allen
mkdir() only makes one folder level deep.
113663 by: Shane
113671 by: SHEETS,JASON (Non-HP-Boise,ex1)
113699 by: David Freeman
Session Array 2 dimensions
113664 by: Christian Ista
113669 by: Bogdan Stancescu
113677 by: Christian Ista
113687 by: Kevin Stone
113694 by: Eric Pignot
Simple mkdir() Q: Please help.
113667 by: Shane
113698 by: David Freeman
Unable to get a form to update
113672 by: Patrick Kirk
113678 by: Brad Dameron
echo "$PHP_SELF"
113674 by: Jeremy Bowen
113676 by: Rasmus Lerdorf
PHP.INI and then again PHP.INI, then again...
113679 by: Jason Caldwell
Automatic Download using URL, HELP!
113680 by: Hankley, Chip
Re: Background process (sending mails)
113681 by: Daren Cotter
113706 by: Jason Wong
Initializing a textarea box of a form with text.
113682 by: Gui Guy
113685 by: Kevin Stone
Re: Passing variables between servers
113683 by: Rasmus Lerdorf
test
113684 by: Kevin Stone
session start
113686 by: Alexander Ross
session question
113689 by: Alexander Ross
113691 by: SimanHew
Variables in the URL
113692 by: RaNd0M
113693 by: Chris Shiflett
Upload files
113700 by: Juan Pablo Aqueveque
113701 by: eriol
113702 by: Juan Pablo Aqueveque
113703 by: Juan Pablo Aqueveque
113708 by: Jason Wong
chdir() issues.
113707 by: luke.stickney
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello PHP people...
I'm trying to insert a filename (string) into a postgres database field but
the insert query is failing -
Warning: pg_exec() query failed: ERROR: oidin: error in
"abc_abcde012_010_mpeg1.mpeg": can't parse "abc_abcde012_010_mpeg1.mpeg"
in /usr/local/apache/htdocs/filename.php on line 835
Here's the query -
$addFileResult = pg_exec($db->db, "INSERT INTO
files(filename,type,size,uploaded) VALUES
('$this->uploadedFileName','$this->uploadedFileType','$this->uploadedFileSize','now'::datetime)");
Table looks like this -
CREATE TABLE "files"
(
"filename" oid,
"type" varchar(30),
"size" int,
"uploaded" datetime
);
Any Ideas?
Saludos,
Javier
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
attached mail follows:
the filename field is of type 'oid' rather than 'character varying'...
yep, inserting a string into an oid feild will make the db baarrrfff...
Saludos
Javier
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
I've got an old, inherited codebase (>18months) that generates PDFs -- just
upgraded the server and libraries and php versions and now the PDF stuff
is broken -- a quick scan of the archive and on google didn't this issue
on there.
The error I'm getting is:
PDFlib error: function 'PDF_stroke' must not be called in 'page' scope
I started to just comment out the offending line and see what happened,
but it complains on every instance of function call throughout the
scripts and a couple of supporting classes --- eww.
I did notice a lot of calls to the deprecated API, but I'd really like
to find a bandaid to put on this rather than rewrite the class library
and all the scripts under time pressure --
Anyone else run into this? ... any pointers, faqs, etc.
-- Hank Marquardt <hankyerpso.net> GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
attached mail follows:
There is no bandaid for this. Your code is simply wrong. You are calling a stroke function without having a path to stroke. You need to fix the code.
-Rasmus
On Thu, 22 Aug 2002, Hank Marquardt wrote:
> I've got an old, inherited codebase (>18months) that generates PDFs -- just
> upgraded the server and libraries and php versions and now the PDF stuff
> is broken -- a quick scan of the archive and on google didn't this issue
> on there.
>
> The error I'm getting is:
>
> PDFlib error: function 'PDF_stroke' must not be called in 'page' scope
>
> I started to just comment out the offending line and see what happened,
> but it complains on every instance of function call throughout the
> scripts and a couple of supporting classes --- eww.
>
> I did notice a lot of calls to the deprecated API, but I'd really like
> to find a bandaid to put on this rather than rewrite the class library
> and all the scripts under time pressure --
>
> Anyone else run into this? ... any pointers, faqs, etc.
>
> --
> Hank Marquardt <hank
yerpso.net>
> GPG Id: 2BB5E60C
> Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Well an answer, even one I didn't want is better than no answer -- I only thought a band-aid might be around as the code did work at one time ... oh well, I guess I'm going to go learn more about PDFlib than I ever wanted to:(
Thanks for the help.
On Thu, Aug 22, 2002 at 07:53:13AM -0700, Rasmus Lerdorf wrote:
> There is no bandaid for this. Your code is simply wrong. You are calling
> a stroke function without having a path to stroke. You need to fix the
> code.
>
> -Rasmus
>
> On Thu, 22 Aug 2002, Hank Marquardt wrote:
>
> > I've got an old, inherited codebase (>18months) that generates PDFs -- just
> > upgraded the server and libraries and php versions and now the PDF stuff
> > is broken -- a quick scan of the archive and on google didn't this issue
> > on there.
> >
> > The error I'm getting is:
> >
> > PDFlib error: function 'PDF_stroke' must not be called in 'page' scope
> >
> > I started to just comment out the offending line and see what happened,
> > but it complains on every instance of function call throughout the
> > scripts and a couple of supporting classes --- eww.
> >
> > I did notice a lot of calls to the deprecated API, but I'd really like
> > to find a bandaid to put on this rather than rewrite the class library
> > and all the scripts under time pressure --
> >
> > Anyone else run into this? ... any pointers, faqs, etc.
> >
> > --
> > Hank Marquardt <hank
yerpso.net>
> > GPG Id: 2BB5E60C
> > Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
-- Hank Marquardt <hankyerpso.net> GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C
attached mail follows:
Is there a way to "pause" a script?
attached mail follows:
sleep()
On Thu, 22 Aug 2002, Erich Kolb wrote:
> Is there a way to "pause" a script? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
[snip] Is there a way to "pause" a script? [/snip]
Do you want it to wait for input? Or just pause? If the second try sleep()
Jay
***********************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* San Antonio Area PHP Developers Group *
* Interested? Contact jay.blanchard
niicommunications.com *
***********************************************************
attached mail follows:
I have a function
update_trans();
in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row.
Thanks
Randy
attached mail follows:
mysql_affected_rows()
On Thu, 22 Aug 2002, Randy Johnson wrote:
> I have a function > > > update_trans(); > > > in a mysql_query() that processes an update, what could i check for to see > if it was successful or not. The update only updates 1 row. > > Thanks > > Randy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
mysql_query($sql_statement) or die ("Couldn't run UPDATE statement");
Adam
On Thu, 22 Aug 2002, Randy Johnson wrote:
> I have a function > > > update_trans(); > > > in a mysql_query() that processes an update, what could i check for to see > if it was successful or not. The update only updates 1 row. > > Thanks > > Randy > > > >
attached mail follows:
Is this a proper way to see if an insert has failed?
$Query="insert blah into blah where blah=blah"; if (! mysql_query($Query,$link)) { $dberror= mysql_error() }
Is there a better way to do it?
Randy
----- Original Message -----
From: "Rasmus Lerdorf" <rasmus
php.net>
To: "Randy Johnson" <icgphp
icecoldgold.com>
Cc: "Rodrigo Peres" <rperes
mac.com>; "PHP" <php-general
lists.php.net>
Sent: Thursday, August 22, 2002 10:52 AM
Subject: Re: [PHP] mysql upate return false?
> mysql_affected_rows() > > On Thu, 22 Aug 2002, Randy Johnson wrote: > > > I have a function > > > > > > update_trans(); > > > > > > in a mysql_query() that processes an update, what could i check for to see > > if it was successful or not. The update only updates 1 row. > > > > Thanks > > > > Randy > > > > > > > > -- > > 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 >
attached mail follows:
That's fine.
On Thu, 22 Aug 2002, Randy Johnson wrote:
> Is this a proper way to see if an insert has failed?
>
> $Query="insert blah into blah where blah=blah";
> if (! mysql_query($Query,$link))
> {
> $dberror= mysql_error()
> }
>
>
> Is there a better way to do it?
>
> Randy
>
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus
php.net>
> To: "Randy Johnson" <icgphp
icecoldgold.com>
> Cc: "Rodrigo Peres" <rperes
mac.com>; "PHP" <php-general
lists.php.net>
> Sent: Thursday, August 22, 2002 10:52 AM
> Subject: Re: [PHP] mysql upate return false?
>
>
> > mysql_affected_rows()
> >
> > On Thu, 22 Aug 2002, Randy Johnson wrote:
> >
> > > I have a function
> > >
> > >
> > > update_trans();
> > >
> > >
> > > in a mysql_query() that processes an update, what could i check for to
> see
> > > if it was successful or not. The update only updates 1 row.
> > >
> > > Thanks
> > >
> > > Randy
> > >
> > >
> > >
> > > --
> > > 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
> >
>
>
attached mail follows:
Hi,
Place these headers in the top of your php file just below the <?PHP and your problem should be gone.
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");
Greetings Peter
"Donpro" <donpro
lclcan.com> schreef in bericht
news:004601c249dd$9a0034a0$c889cdcd
lclcan.com...
> Hi,
>
> I am using a session variable to create an area where customers can access
> certain pages via login/password. If they successfully login, I create a
> session variable and initialize it with their logon username.
>
> I also have a logout button which unregisters the session variables and
> issues a session_unset() and session_destroy(). Then is takes them back
to
> the login page.
>
> Now all my pages in this area first check if the session variable is set
and
> if not, displays a message that the user must first login.
>
> I noticed that after logging out and clicking click on the "Back" button
in
> my browser, it takes me back to the previous page which is does NOT
display
> the warning that the user must login. However, when I click on the
Refresh,
> it does. Is this some sort of caching problem? I note that other sites
> with similar setups do not have this problem. When I click on the "Back"
> button, I saw an expiry message.
>
> How can I emulate this please?
>
> Thanks,
> Don
>
>
attached mail follows:
On Thursday 22 August 2002 23:14, Peter Bottenberg wrote: > Hi, > > Place these headers in the top of your php file just below the <?PHP > and your problem should be gone. > > header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); > header("Cache-Control: no-cache, must-revalidate"); > header("Pragma: no-cache");
Remember, no matter what you do, some browsers (eg Opera) always show a cached copy when using the 'BACK' button.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Etiquette is for those with no breeding; fashion for those with no taste. */
attached mail follows:
Hey all,
Pretty new to PHP... A couple of general questions will help me solve a larger problem...!
1) I need to read all of the names of the files in a given directory
2) read a given line number out of each of these files (just text)
3) write it to a delimited file of some sort
I think I am on to #2 and #3, but #1 I am having trouble with... Any pointers would be appreciated!
-- Bill Leonard billmachinemen.com www.machinemen.com 407.464.0147
XrackHosting.com - Mac OS X hosting on Apple's Xserve! http://www.xrackhosting.com/
attached mail follows:
[snip] 1) I need to read all of the names of the files in a given directory [/snip]
opendir() http://www.php.net/manual/en/function.opendir.php
HTH!
Jay
"Manuals, aren't THEY fun!"
***********************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* San Antonio Area PHP Developers Group *
* Interested? Contact jay.blanchard
niicommunications.com *
***********************************************************
attached mail follows:
1) readdir();
2) $your_file = file($filename); $your_line=$your_file[$your_line_number]
3) $fp = fopen($filename,'w'); fputs($fp,$your_text); fclose($fp);
In the second argument to fopen, w = write, a = append, r = read
See the manual for more info on these functions.
----- Original Message -----
From: "Bill Leonard" <bill
machinemen.com>
To: <php-general
lists.php.net>
Sent: Thursday, August 22, 2002 10:15 AM
Subject: [PHP] Get directory items, read file lines...
> Hey all,
>
> Pretty new to PHP... A couple of general questions will help me solve a
> larger problem...!
>
> 1) I need to read all of the names of the files in a given directory
>
> 2) read a given line number out of each of these files (just text)
>
> 3) write it to a delimited file of some sort
>
> I think I am on to #2 and #3, but #1 I am having trouble with... Any
> pointers would be appreciated!
>
>
> --
> Bill Leonard bill
machinemen.com
> www.machinemen.com 407.464.0147
>
> XrackHosting.com - Mac OS X hosting on Apple's Xserve!
> http://www.xrackhosting.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Here you go...
if( ($dir =
opendir( $path )) )
{
while( $aFile =
readdir( $dir ) )
{
//
// Test you really have a file vs. having a
// directory and then do your stuff.
//
}
}
A far better approach though, is to familiarize yourself with the appropriate routines:
http://www.php.net/manual/en/ref.dir.php http://www.php.net/manual/en/function.file.php
Cheers, Rob.
---------------------------------------------------------------------------
"Joseph W. Goff" wrote:
>
> 1) readdir();
>
> 2) $your_file = file($filename); $your_line=$your_file[$your_line_number]
>
> 3) $fp = fopen($filename,'w');
> fputs($fp,$your_text);
> fclose($fp);
>
> In the second argument to fopen, w = write, a = append, r = read
> See the manual for more info on these functions.
> ----- Original Message -----
> From: "Bill Leonard" <bill
machinemen.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 22, 2002 10:15 AM
> Subject: [PHP] Get directory items, read file lines...
>
> > Hey all,
> >
> > Pretty new to PHP... A couple of general questions will help me solve a
> > larger problem...!
> >
> > 1) I need to read all of the names of the files in a given directory
> >
> > 2) read a given line number out of each of these files (just text)
> >
> > 3) write it to a delimited file of some sort
> >
> > I think I am on to #2 and #3, but #1 I am having trouble with... Any
> > pointers would be appreciated!
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
You need to check the TYPE of the return value from readdir, because a filename that evaluates to fals will stop the loop.
So you need
while ( ($aFile =
readdir( $dir ) ) !== false)
{
// Stuff in here
}
It's in the manual page...
Richy
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: rblack
datavisibility.co.uk
-----Original Message-----
From: robert.cummings
webmotion.com
[mailto:robert.cummings
webmotion.com]
Sent: 22 August 2002 16:38
To: Joseph W. Goff
Cc: php-general; Bill Leonard
Subject: Re: [PHP] Get directory items, read file lines...
Here you go...
if( ($dir =
opendir( $path )) )
{
while( $aFile =
readdir( $dir ) )
{
//
// Test you really have a file vs. having a
// directory and then do your stuff.
//
}
}
A far better approach though, is to familiarize yourself with the appropriate routines:
http://www.php.net/manual/en/ref.dir.php http://www.php.net/manual/en/function.file.php
Cheers, Rob.
------------------------------------------------------------------------
--- "Joseph W. Goff" wrote: > > 1) readdir(); > > 2) $your_file = file($filename); > $your_line=$your_file[$your_line_number] > > 3) $fp = fopen($filename,'w'); > fputs($fp,$your_text); > fclose($fp); > > In the second argument to fopen, w = write, a = append, r = read See > the manual for more info on these functions. > ----- Original Message ----- > From: "Bill Leonard" <billmachinemen.com> > To: <php-general
lists.php.net> > Sent: Thursday, August 22, 2002 10:15 AM > Subject: [PHP] Get directory items, read file lines... > > > Hey all, > > > > Pretty new to PHP... A couple of general questions will help me > > solve a larger problem...! > > > > 1) I need to read all of the names of the files in a given directory > > > > 2) read a given line number out of each of these files (just text) > > > > 3) write it to a delimited file of some sort > > > > I think I am on to #2 and #3, but #1 I am having trouble with... Any
> > pointers would be appreciated!
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummings
webmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hmmm it's been working fine for me, but thanks, I'll update the code I ripped this from.
Cheers, Rob. ------------------------------------------------------------------------
Richard Black wrote:
>
> You need to check the TYPE of the return value from readdir, because a
> filename that evaluates to fals will stop the loop.
>
> So you need
>
> while ( ($aFile =
readdir( $dir ) ) !== false)
> {
> // Stuff in here
> }
>
> It's in the manual page...
>
> Richy
> ==========================================
> Richard Black
> Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
> Tel: 0141 435 3504
> Email: rblack
datavisibility.co.uk
>
> -----Original Message-----
> From: robert.cummings
webmotion.com
> [mailto:robert.cummings
webmotion.com]
> Sent: 22 August 2002 16:38
> To: Joseph W. Goff
> Cc: php-general; Bill Leonard
> Subject: Re: [PHP] Get directory items, read file lines...
>
> Here you go...
>
> if( ($dir =
opendir( $path )) )
> {
> while( $aFile =
readdir( $dir ) )
> {
> //
> // Test you really have a file vs. having a
> // directory and then do your stuff.
> //
> }
> }
>
> A far better approach though, is to familiarize yourself with the
> appropriate routines:
>
> http://www.php.net/manual/en/ref.dir.php
> http://www.php.net/manual/en/function.file.php
>
> Cheers,
> Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Hi,
error messages about the use of uninitialized variables?
I use PHP Version: 4.2.1
thanks!
attached mail follows:
[snip] error messages about the use of uninitialized variables? [/snip]
And this surprises you how? According to all of the information that you so graciously passed along we can all say with authority .... YES!
<no sarcasm> I don't know how many times it has been said, but we must see code, examples, have a much more thorough description, ad nauseum ... a general stament/question will not get you any help. </sarcasm>
Oh gawd, I am channeling Jason! :^]
Jay
attached mail follows:
Well, we could help more if you were slightly more liberal with the details of your situation, but...
The most likely thing is register_globals is off in your php.ini, and your script depends on it being on.
On Thursday 22 August 2002 08:28 am, you wrote: > Hi, > > error messages about the use of uninitialized variables? > > I use PHP Version: 4.2.1 > > thanks!
attached mail follows:
Hey everyone... I'm fairly new to PHP, and this is my first post to the list. I've been developing on the web for about 6 years now with other languages, but need some help getting started with this one.
1) This isn't working unless the form is submitted...
if (!isset($HTTP_POST_VARS['step'])) { $step=$HTTP_POST_VARS['step']; }
I get the error: Notice: Undefined index
I need to set Step=1 as default, but set Step=x when form is posted, where x is a value from the submitted form. This to control whether or not to show certain parts of the page.
2) Is there an easier/alternate way to default the value of a variable if it's not already set?
Thanks in advance, Peter
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
> 1) This isn't working unless the form is submitted... > > if (!isset($HTTP_POST_VARS['step'])) { $step=$HTTP_POST_VARS['step']; } > > I get the error: Notice: Undefined index
Hrm? You check to see if $HTTP_POST_VARS['step'] is not set, and if it isn't set you try to read the value and put it into $step. That makes no sense. Obviously you will get an undefined index warning.
-Rasmus
attached mail follows:
try
if ( isset($HTTP_POST_VARS['step']) ) { $step = $HTTP_POST_VARS['step']; { else { $step = 1; }
the "!" before isset basically makes it "is not set". Really all you have to do is get rid of that.
On Thursday 22 August 2002 08:37 am, you wrote:
> Hey everyone...
> I'm fairly new to PHP, and this is my first post to the list. I've been
> developing on the web for about 6 years now with other languages, but need
> some help getting started with this one.
>
>
> 1) This isn't working unless the form is submitted...
>
> if (!isset($HTTP_POST_VARS['step'])) { $step=$HTTP_POST_VARS['step']; }
>
> I get the error: Notice: Undefined index
>
>
> I need to set Step=1 as default, but set Step=x when form is posted, where
> x is a value from the submitted form. This to control whether or not to
> show certain parts of the page.
>
>
>
> 2) Is there an easier/alternate way to default the value of a variable if
> it's not already set?
>
> Thanks in advance,
> Peter
>
>
>
> - - - - - - - - - - - - - - - - - - - - -
> Fourth Realm Solutions
> pbechard
fourthrealm.com
> http://www.fourthrealm.com
> Tel: 519-739-1652
> - - - - - - - - - - - - - - - - - - - - -
attached mail follows:
On Wednesday, August 21, 2002 8:21 PM Justin French wrote:
> Read my last email again, and again, and again. It (hopefully) clearly sets > out what you need, and how each part interacts. I don't know how to be much > clearer, without doing it for you (which I can do, at a cost :))
If I had some income from my venture, I'd certainly take you up on your offer :-) Your advice is clear. It's my skills that are fuzzy. Not to worry ... I'll just keep studying until I get it.
Roger
attached mail follows:
Let us know how you go, and feel free to ask specific problems as you dig through the Zend article, which is pretty much all you need.
Justin
on 23/08/02 1:51 AM, Roger Lewis (re.lewis
attbi.com) wrote:
> > > On Wednesday, August 21, 2002 8:21 PM > Justin French wrote: > >> Read my last email again, and again, and again. It (hopefully) clearly > sets >> out what you need, and how each part interacts. I don't know how to be > much >> clearer, without doing it for you (which I can do, at a cost :)) > > If I had some income from my venture, I'd certainly take you up on your > offer :-) > Your advice is clear. It's my skills that are fuzzy. Not to worry ... I'll > just keep studying until I get it. > > Roger >
attached mail follows:
Justin French wrote On Thursday, August 22, 2002 10:32 AM
> Let us know how you go, and feel free to ask specific problems as you dig > through the Zend article, which is pretty much all you need.
Good News! It's working
Bad News. It's not working right.
I pretty much followed the Zend article. 1. My main web site is at /home/sites/home/users/demo/web 2. I have a document site at /home/sites/home/users/demodocs/web 3. I created a directory of files called "/docs/ProjDocs/", and put it outside the web root of my document site at ../demodocs/docs/ProjDocs/. 4. I created a file called "getdir.php" which reads "docs/ProjDocs/", lists the files therein, creates a link to each file, and then redirects to the file "getdocfiles.php" after clicking a link. 5. I created a file called "getdocfiles.php" which opens and downloads the linked file. "getdocfiles.php defines the mime types of all the files I wish to download. 6. I created the headers exactly per the Zend article. 7. I uploaded both "getdir.php" and "getdocfile.php" to ../demo/web 8. Calling "getdir.php" displays my file list correctly. 9. Clicking on a link gives the following error messages and downloads the file to the browser in binary (or something ??)
Can you help me to understand these error messages. I have experimented with omitting the headers. The results is that I don't get the error messages and continue to receive the file in binary.
(NOTE: I get warnings for lines 70, 71, 73, and 74 when trying to open gif or pdf files I get warnings for lines 65, 73, and 74 when trying to open other files.)
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 65
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 70
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 71
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 73
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 74
Here is the code for getdocfiles.php:
<?php define('FILEDIR', '/home/sites/home/users/demodocs/docs/ProjDocs/'); $path = FILEDIR . $file;
//check that this file exists and that it doesn't include //any special characters if(!is_file($path) OR !eregi('^[A-Z_0-9][A-Z_0-9.]*$', $file)) { header("Location: error.php"); exit(); }
$mimetype = array( 'doc'=>'application/msword', 'htm'=>'text/html', 'html'=>'text/html', 'jpg'=>'image/jpeg', 'pdf'=>'application/pdf', 'txt'=>'text/plain', 'xls'=>'application/vnd.ms-excel', 'ppt'=>'application/vnd.ms-powerpoint', 'mdb'=>'application/msaccess', 'mpp'=>'application/vnd.ms-project', 'dwf'=>'drawing/x-dwf', 'dxf'=>'image/vnd.dxf', 'dwg'=>'image/vnd.dwg' );
$p = explode('.', $file); $pc = count($p);
//send headers if(($pc > 1) AND isset($mimetype[$p[$pc - 1]])) { //display file inside browser header("Content-type: " . $mimetype[$p[$pc - 1]] . "\n"); //LINE 65 } else { //force download dialog header("Content-type: application/octet-stream\n"); //LINE 70 header("Content-disposition: attachment; filename=\"$file\"\n"); //LINE 71 } header("Content-transfer-encoding: binary\n"); //LINE 73 header("Content-length: " . filesize($path) . "\n"); //LINE 74
//send file contents $fp=fopen($path, "r"); fpassthru($fp); ?>
Thanks much, Roger
attached mail follows:
Roger Lewis wrote On Thursday, August 22, 2002 3:16 PM
Justin French wrote On Thursday, August 22, 2002 10:32 AM
> Let us know how you go, and feel free to ask specific problems as you dig > through the Zend article, which is pretty much all you need.
Good News! It's working
Bad News. It's not working right.
I pretty much followed the Zend article. 1. My main web site is at /home/sites/home/users/demo/web 2. I have a document site at /home/sites/home/users/demodocs/web 3. I created a directory of files called "/docs/ProjDocs/", and put it outside the web root of my document site at ../demodocs/docs/ProjDocs/. 4. I created a file called "getdir.php" which reads "docs/ProjDocs/", lists the files therein, creates a link to each file, and then redirects to the file "getdocfiles.php" after clicking a link. 5. I created a file called "getdocfiles.php" which opens and downloads the linked file. "getdocfiles.php defines the mime types of all the files I wish to download. 6. I created the headers exactly per the Zend article. 7. I uploaded both "getdir.php" and "getdocfile.php" to ../demo/web 8. Calling "getdir.php" displays my file list correctly. 9. Clicking on a link gives the following error messages and downloads the file to the browser in binary (or something ??)
Can you help me to understand these error messages. I have experimented with omitting the headers. The results is that I don't get the error messages and continue to receive the file in binary.
(NOTE: I get warnings for lines 70, 71, 73, and 74 when trying to open gif or pdf files I get warnings for lines 65, 73, and 74 when trying to open other files.)
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 65
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 70
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 71
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 73
Warning: Cannot add header information - headers already sent by (output started at /home/sites/home/users/demo/web/getdocfile.php:14) in /home/sites/home/users/demo/web/getdocfile.php on line 74
Here is the code for getdocfiles.php:
<?php define('FILEDIR', '/home/sites/home/users/demodocs/docs/ProjDocs/'); $path = FILEDIR . $file;
//check that this file exists and that it doesn't include //any special characters if(!is_file($path) OR !eregi('^[A-Z_0-9][A-Z_0-9.]*$', $file)) { header("Location: error.php"); exit(); }
$mimetype = array( 'doc'=>'application/msword', 'htm'=>'text/html', 'html'=>'text/html', 'jpg'=>'image/jpeg', 'pdf'=>'application/pdf', 'txt'=>'text/plain', 'xls'=>'application/vnd.ms-excel', 'ppt'=>'application/vnd.ms-powerpoint', 'mdb'=>'application/msaccess', 'mpp'=>'application/vnd.ms-project', 'dwf'=>'drawing/x-dwf', 'dxf'=>'image/vnd.dxf', 'dwg'=>'image/vnd.dwg' );
$p = explode('.', $file); $pc = count($p);
//send headers if(($pc > 1) AND isset($mimetype[$p[$pc - 1]])) { //display file inside browser header("Content-type: " . $mimetype[$p[$pc - 1]] . "\n"); //LINE 65 } else { //force download dialog header("Content-type: application/octet-stream\n"); //LINE 70 header("Content-disposition: attachment; filename=\"$file\"\n"); //LINE 71 } header("Content-transfer-encoding: binary\n"); //LINE 73 header("Content-length: " . filesize($path) . "\n"); //LINE 74
//send file contents $fp=fopen($path, "r"); fpassthru($fp); ?>
Thanks much, Roger
------------------------------------------------------------------- There is obviously something wrong with how the headers are being sent. I read that they should be at the top. I tried eliminating all of the code except for the following few lines, and it works. That is, if I click on a link to a jpg file, it loads into the browser properly. This code obviously is not practical. Does it help in analyzing what was wrong with the full code?
<?php header("Content-type: image/jpeg"); ?>
<?php define('FILEDIR', '/home/sites/home/users/demodocs/docs/ProjDocs/'); $path = FILEDIR . $file;
//send file contents $fp=fopen($path, "r"); fpassthru($fp); ?>
Roger
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Friday 23 August 2002 08:25, Roger Lewis wrote:
> Warning: Cannot add header information - headers already sent by (output > started at /home/sites/home/users/demo/web/getdocfile.php:14) in > /home/sites/home/users/demo/web/getdocfile.php on line 65
> ------------------------------------------------------------------- > There is obviously something wrong with how the headers are being sent. I > read that they should be at the top.
The header() does not necessarily have to be at the top. The answer to this has been covered in the archives umpteen times (even more so than the protecting file download question).
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Earth -- mother of the most beautiful women in the universe. -- Apollo, "Who Mourns for Adonais?" stardate 3468.1 */
attached mail follows:
Hi, Question: How can assign a PHP array to a Javascript array?
Example:
while($row=$result->FetchRow()) { $serv[$i++] = $row[0]; }
var server = new Array(index); server = <?= $serv ?>;
for(ind = 0; ind < index; ind++) { alert(server[ind]); }
This doesn't work for some strange reason....
attached mail follows:
Hi, everyone.
I see two really good scripts out there for changing a user password. I've seen passchange.php, and changepass.php. Anyone know where I can get either of these scripts? Thanks!
Michael Lee (TOR)
TELUS Corporation
910-222 Bay Street
Toronto, Ontario M5K 1A1
michael.lee3
telus.com
-----Original Message-----
From: Kicenko, Frank [mailto:Frank.Kicenko
attcanada.com]
Sent: Thursday, August 22, 2002 11:54 AM
To: 'php-general
lists.php.net'
Subject: [PHP] Assigning PHP Arrays to Javascript arrays
Hi, Question: How can assign a PHP array to a Javascript array?
Example:
while($row=$result->FetchRow()) { $serv[$i++] = $row[0]; }
var server = new Array(index); server = <?= $serv ?>;
for(ind = 0; ind < index; ind++) { alert(server[ind]); }
This doesn't work for some strange reason....
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On 22 Aug 2002 at 12:10, jochen schultz wrote:
> i got a question concerning OOP, would be nice if anyone could help. > > I am trying to build a class that builds SQL statements dynamically like > i send tablenames, fieldnames, etc and it should build select, insert,
> but elements of $vals 'can' be strings and some can be numeric... > > Do you think it´s a good idea to make queries to find out about > fieldtypes as i need that info to set quotes for the string entries? Or > do you think i should predefine it instead in the class that checks the > postvars? > > Or do you think i have a absolute stupid idea?
Jochen,
First thing is to always search for an example of what you want. Rarely is anything new under the sun. Well, I have been searching and I have not found any good example ... I do what you want to do in Perl (I have not bothered to do it in PHP). Here is what I do in Perl in plain language:
On every instance of the script I get the current database schema in an array of arrays:
$database = new array( table1 => ( filed=>( type=int, or char or enum or date or lenght=>10 or 20 or 255 tec ) table2=> and so on )
So I have that. Then I want to insert data into the database. I ALWAYS have data in an array that has been parsed and validated and it's in a array of arrays (if necessary) as well.
So then I pass to the function as such This is Perl but you get the idea my $results = $self->{dbi}->insert_into_tables( data_model=>$self->{data_model}, data_hash=>$self->{input}, required=>\%required, tables=>[qw(user_config)], dbh=>$self->{dbh}, );
$self->{data_model} = database schema $self->{input} = the data that my script received from wherever it received it, it is put in an array of arrays as necessary %required = this is weak, but I pass which fields are required and it will fail if no data is associated with a required field tables=>[qw(user_config)], = that is an array of the tables that is in the database, data will get inserted for each table dbh=>$self->{dbh}, = that's the database handler
insert_into_tables = the function that accepts the data and iterates over everything to verify that everythign is what it should be, it returns information that I store in the $results array.
Someone must be doing somethin gsimilar to this in PHP. When inserting or updating you repeat the same code over and over, why not centralize it.
I did not find it. You should post to the DB list.
Peter
attached mail follows:
I am having trouble finding working examples of HTTP Digest Authentication, esp. in PHP. Doe anyone have any links or code they can share? Also, I know that not all browsers support it or have incompatible support. Does anyone have a list of which browsers support what authentication schemes?
Thanks.
--- Seairth Jacobs seairthseairth.com
attached mail follows:
I think only IE supports it. And no, we do not have digest auth support in PHP yet.
On Thu, 22 Aug 2002, Seairth Jacobs wrote:
> I am having trouble finding working examples of HTTP Digest Authentication,
> esp. in PHP. Doe anyone have any links or code they can share? Also, I
> know that not all browsers support it or have incompatible support. Does
> anyone have a list of which browsers support what authentication schemes?
>
> Thanks.
>
> ---
> Seairth Jacobs
> seairth
seairth.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> From: Seairth Jacobs [mailto:seairth
seairth.com]
> Sent: Thursday, August 22, 2002 12:29 PM
> To: php-general
lists.php.net
> Subject: [PHP] Digest Authentication
>
>
> I am having trouble finding working examples of HTTP Digest
> Authentication,
> esp. in PHP. Doe anyone have any links or code they can
> share? Also, I
> know that not all browsers support it or have incompatible
> support. Does
> anyone have a list of which browsers support what
> authentication schemes?
You can read what the Apache Group has to say about Digest Authentication at: http://httpd.apache.org/docs/howto/auth.html#digest
It's not really any better the Basic. While user/password is encryted the data is still sent in cleartext. And if someone captures the encrypted user/password values, they can send it and get the page.
attached mail follows:
I was thinking manually implementing it, if that was even possible. Also, it was my impression that both the latest Netscape and Mozilla supported it as well. I was aware that there's an incompatibility with IE5's implementation with Apache's implementation (and Mozilla's with IIS's as well), but I could not find anything stating whether this issue was resolved with IE6 or not...
--- Seairth Jacobs seairthseairth.com
"Rasmus Lerdorf" <rasmus
php.net> wrote in message news:Pine.LNX.4.44.0208221007330.30244-100000
www.lerdorf.com... > I think only IE supports it. And no, we do not have digest auth support > in PHP yet. > > On Thu, 22 Aug 2002, Seairth Jacobs wrote: > > > I am having trouble finding working examples of HTTP Digest Authentication, > > esp. in PHP. Doe anyone have any links or code they can share? Also, I > > know that not all browsers support it or have incompatible support. Does > > anyone have a list of which browsers support what authentication schemes? > > > > Thanks. > > > > --- > > Seairth Jacobs > > seairth
seairth.com > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
"Matt Schroebel" <MSchroebel
hsus.org> wrote in message
news:D4DB668A680B2549AE977FB0B193E2E80424AC
email.hsus.org...
>
> You can read what the Apache Group has to say about Digest Authentication
at:
> http://httpd.apache.org/docs/howto/auth.html#digest
>
> It's not really any better the Basic. While user/password is encryted the
data is still sent in cleartext. And if someone captures the encrypted
user/password values, they can send it and get the page.
Actually, it is better in at least one respect. Since many people tend to use the same password for multiple sites/services, Digest does not allow someone to see the original password. Yes, they may be able to use the hashed version to gain access to a single service, but that would be it. Also, from what I read in the RFC (http://www.merit.edu/internet/documents/rfc/rfc2617.txt), there are techniques to limit replay attacks (even stop them entirely if you don't mind the overhead).
I am not saying that the use of Digest Authentication is ideal, but it is an improvement over Basic authentication and much less costly when SSL (esp. when SSL is overkill for my needs).
--- Seairth Jacobs seairthseairth.com
attached mail follows:
Oaky, it was Opera and Amaya, not Netscape and Mozilla. sorry about that... Still, they only worked with Apache, while IE5 only worked with IIS. As far as I am concerned, the IE/IIS version is incorrect, so I effectively treat IE5 as not having digest support. Unfortunately, I cannot if any changes were made in IE6 or not...
--- Seairth Jacobs seairthseairth.com
"Seairth Jacobs" <seairth
seairth.com> wrote in message news:20020822172504.54605.qmail
pb1.pair.com... > I was thinking manually implementing it, if that was even possible. Also, > it was my impression that both the latest Netscape and Mozilla supported it > as well. I was aware that there's an incompatibility with IE5's > implementation with Apache's implementation (and Mozilla's with IIS's as > well), but I could not find anything stating whether this issue was resolved > with IE6 or not... > > --- > Seairth Jacobs > seairth
seairth.com > > "Rasmus Lerdorf" <rasmus
php.net> wrote in message > news:Pine.LNX.4.44.0208221007330.30244-100000
www.lerdorf.com... > > I think only IE supports it. And no, we do not have digest auth support > > in PHP yet. > > > > On Thu, 22 Aug 2002, Seairth Jacobs wrote: > > > > > I am having trouble finding working examples of HTTP Digest > Authentication, > > > esp. in PHP. Doe anyone have any links or code they can share? Also, I > > > know that not all browsers support it or have incompatible support. > Does > > > anyone have a list of which browsers support what authentication > schemes? > > > > > > Thanks. > > > > > > --- > > > Seairth Jacobs > > > seairth
seairth.com > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >
attached mail follows:
Hello,
On 08/22/2002 01:29 PM, Seairth Jacobs wrote: > I am having trouble finding working examples of HTTP Digest Authentication, > esp. in PHP. Doe anyone have any links or code they can share? Also, I > know that not all browsers support it or have incompatible support. Does > anyone have a list of which browsers support what authentication schemes?
Do you mean NTLM authentication?
--Regards, Manuel Lemos
attached mail follows:
I think he means what he says - digest authentication.
NTLM authentication is a Microsoft thing and as such is supported by Microsoft products and pretty much no one else.
Manuel Lemos wrote:
> Hello, > > On 08/22/2002 01:29 PM, Seairth Jacobs wrote: > >> I am having trouble finding working examples of HTTP Digest >> Authentication, >> esp. in PHP. Doe anyone have any links or code they can share? Also, I >> know that not all browsers support it or have incompatible support. >> Does >> anyone have a list of which browsers support what authentication >> schemes? > > > Do you mean NTLM authentication?
attached mail follows:
Hello,
On 08/22/2002 04:28 PM, Chris Shiflett wrote: > I think he means what he says - digest authentication. > > NTLM authentication is a Microsoft thing and as such is supported by > Microsoft products and pretty much no one else.
That is very wrong. NTLM is based on exchanging digest messages. It is not supported just by Microsoft products. There is even an Apache NTLM authentication module for Unix/Linux. Mozilla/Netscape 6/7 support NTLM. So, as you may see this is not just a Microsoft thing, regardless if this is what the original poster meant.
Anyway, PHP is not an anti-Microsoft thing regardless what some PHP users or developers think. PHP has a lot to gain in working with Microsoft products because many users have choosen such products, whether you like it or not.
As a matter of fact, in a recent poll that is still running, 53% of the inquired develoipers use Windows as their production environment to run PHP applications. In some countries the rate is even much higher.
There is a great demand for NTLM authentication among Windows PHP users because that lets user login in Web applications without having to enter their credentials again after already having done so in the Windows logon. That is why I asked if was that the orginal poster could be asking.
I do not use or recommend Windows, but I wish some PHP people stop being so stupidly against Microsoft products because that is like shooting yourself in the feet as more and more of the remaining PHP jobs are Windows based.
Manuel Lemos
> Manuel Lemos wrote: > >> Hello, >> >> On 08/22/2002 01:29 PM, Seairth Jacobs wrote: >> >>> I am having trouble finding working examples of HTTP Digest >>> Authentication, >>> esp. in PHP. Doe anyone have any links or code they can share? Also, I >>> know that not all browsers support it or have incompatible support. >>> Does >>> anyone have a list of which browsers support what authentication >>> schemes? >> >> >> >> Do you mean NTLM authentication?
attached mail follows:
No, I had not meant NTLM authentication. However, support for this wouldn't hurt as well, I suppose. What I am looking to do is something like the following:
if browser supports digest authentication use digest authentication else use basic authentication
right now, though, it looks like I will be using basic authentication only, since most browsers support it. If it becomes necessary, I will use SSL to encrypt both the authentication headers (and everything else), but I would like to avoid this if possible. In my case, I am more concerned about someone stealing login information that I am about someone seeing something they shouldn't see. With basic authentication, there is a risk of the first. With digest authentication (done properly), there is only a risk of the second. And since most of the viewable data will be public anyhow, this is not much of a concern... for now...
--- Seairth Jacobs seairthseairth.com
"Manuel Lemos" <mlemos
acm.org> wrote in message news:3D6537B8.1010906
acm.org... > Hello, > > On 08/22/2002 01:29 PM, Seairth Jacobs wrote: > > I am having trouble finding working examples of HTTP Digest Authentication, > > esp. in PHP. Doe anyone have any links or code they can share? Also, I > > know that not all browsers support it or have incompatible support. Does > > anyone have a list of which browsers support what authentication schemes? > > Do you mean NTLM authentication? > > > -- > > Regards, > Manuel Lemos >
attached mail follows:
Hello,
On 08/22/2002 05:06 PM, Seairth Jacobs wrote: > No, I had not meant NTLM authentication. However, support for this wouldn't > hurt as well, I suppose. What I am looking to do is something like the > following: > > if browser supports digest authentication > use digest authentication > else > use basic authentication
Just specify both methods by that order and the browser will use the first that it supports.
> right now, though, it looks like I will be using basic authentication only, > since most browsers support it. If it becomes necessary, I will use SSL to > encrypt both the authentication headers (and everything else), but I would > like to avoid this if possible. In my case, I am more concerned about > someone stealing login information that I am about someone seeing something > they shouldn't see. With basic authentication, there is a risk of the > first. With digest authentication (done properly), there is only a risk of > the second. And since most of the viewable data will be public anyhow, this > is not much of a concern... for now...
If you can use NTLM authentication it could be a good thing because it would not require users to enter passwords to access your site. PHP does not have built-in support for it, but there are Web server modules that support it and even handle credentials caching for you.
Anyway, if you are looking for a more browser independent message, you may want to try using forms based authentication using md5 to encrypt the passwords. It will require a Javascript enabled browser but that is more than 95% of the browsers.
Here you may find an example that works that way:
http://www.phpclasses.org/login.html
Here you may find a forms class with an example that demonstrates how that kind of authentication can be used.
--Regards, Manuel Lemos
attached mail follows:
Manuel Lemos wrote:
> NTLM is based on exchanging digest messages. It is not supported just > by Microsoft products. There is even an Apache NTLM authentication > module for Unix/Linux. Mozilla/Netscape 6/7 support NTLM.
The only Apache support I know of is mod_ntlm (http://sourceforge.net/projects/modntlm/). As I understand, this module is very untested and unused. I'm not aware of support in either Netscape 6/7 or Mozilla. Care to give a reference?
> Anyway, PHP is not an anti-Microsoft thing regardless what some PHP > users or developers think. PHP has a lot to gain in working with > Microsoft products because many users have choosen such products, > whether you like it or not. > > As a matter of fact, in a recent poll that is still running, 53% of > the inquired develoipers use Windows as their production environment > to run PHP applications. In some countries the rate is even much higher. > > There is a great demand for NTLM authentication among Windows PHP > users because that lets user login in Web applications without having > to enter their credentials again after already having done so in the > Windows logon. That is why I asked if was that the orginal poster > could be asking. > > I do not use or recommend Windows, but I wish some PHP people stop > being so stupidly against Microsoft products because that is like > shooting yourself in the feet as more and more of the remaining PHP > jobs are Windows based.
I'm not sure where you get the anti-Microsoft sentiment. Microsoft simply doesn't make a habit of using open standards or opening their own (NTLM, for example). Thus, one can logically conclude that support for Microsoft technologies traditionally lies largely in Microsoft products alone. Yes, there are exceptions (Samba), but no one suggested that NTLM was *only* supported by Microsoft products.
If you wish to refute this, please give us a reference to the NTLM specification.
Happy hacking.
Chris
attached mail follows:
Hello,
On 08/22/2002 07:44 PM, Chris Shiflett wrote: > Manuel Lemos wrote: > >> NTLM is based on exchanging digest messages. It is not supported just >> by Microsoft products. There is even an Apache NTLM authentication >> module for Unix/Linux. Mozilla/Netscape 6/7 support NTLM. > > The only Apache support I know of is mod_ntlm > (http://sourceforge.net/projects/modntlm/). As I understand, this module
There are versions for Apache under Unix and under Windows. Besides that there are Perl based NTLM authentication modules, not to mention support for Java and Python.
Only support for PHP seems to not be available. That seems to be due to the fact that the code is based on libsmbclient that is only available under GPL and GPL code is not accepted for PHP because of the contagious aspect of GPL license.
> is very untested and unused. I'm not aware of support in either Netscape > 6/7 or Mozilla. Care to give a reference?
http://www.mozilla.org/status/2002-08-21.html
>> Anyway, PHP is not an anti-Microsoft thing regardless what some PHP >> users or developers think. PHP has a lot to gain in working with >> Microsoft products because many users have choosen such products, >> whether you like it or not. >> >> As a matter of fact, in a recent poll that is still running, 53% of >> the inquired develoipers use Windows as their production environment >> to run PHP applications. In some countries the rate is even much higher. >> >> There is a great demand for NTLM authentication among Windows PHP >> users because that lets user login in Web applications without having >> to enter their credentials again after already having done so in the >> Windows logon. That is why I asked if was that the orginal poster >> could be asking. >> >> I do not use or recommend Windows, but I wish some PHP people stop >> being so stupidly against Microsoft products because that is like >> shooting yourself in the feet as more and more of the remaining PHP >> jobs are Windows based. > > I'm not sure where you get the anti-Microsoft sentiment. Microsoft > simply doesn't make a habit of using open standards or opening their own > (NTLM, for example). Thus, one can logically conclude that support for > Microsoft technologies traditionally lies largely in Microsoft products > alone. Yes, there are exceptions (Samba), but no one suggested that NTLM > was *only* supported by Microsoft products.
Read your own line:
> NTLM authentication is a Microsoft thing and as such is supported by Microsoft products and pretty much no one else.
> If you wish to refute this, please give us a reference to the NTLM > specification.
http://www.innovation.ch/java/ntlm.html
--Regards, Manuel Lemos
attached mail follows:
Manuel Lemos wrote:
>> I'm not aware of support in either Netscape 6/7 or Mozilla. Care to >> give a reference? > > > http://www.mozilla.org/status/2002-08-21.html
Thanks. I was not aware of this activity. As the only information referencing NTLM on this page is dated August 8, I think it is safe to assume that Netscape 6 does not support NTLM nor does any released version of Mozilla, correct? Your initial comments seemed to indicate that they do. However, it does indicate that Mozilla support for this is coming (and exists in the CVS snapshots after August 8), so thanks for the link.
>> I'm not sure where you get the anti-Microsoft sentiment. Microsoft >> simply doesn't make a habit of using open standards or opening their >> own (NTLM, for example). Thus, one can logically conclude that >> support for Microsoft technologies traditionally lies largely in >> Microsoft products alone. Yes, there are exceptions (Samba), but no >> one suggested that NTLM was *only* supported by Microsoft products. > > > Read your own line: > >> NTLM authentication is a Microsoft thing and as such is supported by >> Microsoft products and pretty much no one else. >
Yes, as I also just said, "support for Microsoft technologies traditionally lies largely in Microsoft products alone." There are certain words that remove the absoluteness of statements. For example:
I always win. != I almost always win. I almost always win. == I pretty much always win.
My first comment was very brief, as I assumed most people could infer the longer version quoted above.
>> If you wish to refute this, please give us a reference to the NTLM >> specification. > > > http://www.innovation.ch/java/ntlm.html
The opening sentence of this document proves my point:
"This is an attempt at documenting the undocumented NTLM authentication scheme."
or this statement:
"Since most of this info is reverse-engineered it is bound to contain errors."
The point is, while this "attempt at documenting" NTLM might be perfectly accurate, there is no guarantee of that. NTML is a closed "standard," and there is no documented specification for it. To interoperate with many of Microsoft's closed protocols and standards, people are forced to reverse-engineer something. This is exactly what was necessary for Samba to be created. It follows suit that the more difficult it is to create compatible software with a specific protocol or standard, the less software will be created for that particular protocol or standard. Since Microsoft can build software with the benefit of the actual specification, their software is more likely to support it.
Happy hacking.
Chris
attached mail follows:
"Manuel Lemos" <mlemos
acm.org> wrote in message
news:3D6549F3.1070208
acm.org...
>
> Anyway, if you are looking for a more browser independent message, you
> may want to try using forms based authentication using md5 to encrypt
> the passwords. It will require a Javascript enabled browser but that is
> more than 95% of the browsers.
The problem with this is that I am attempting to implement a RESTful webservice. I do not want to use PHP's session handling because it tries to do things that I do not want done (like sending cookies). In order to work within the REST principles, I also do not want alter my URLs by passing around a Session ID. As a result, my options are very limited, hence the HTTP Authentication scheme.
Using an HTML form would be nice (and would look *much* nicer), but it still requires me to assign and keep track of some sort of session ID, which would mean the use of cookies or modifying my URLs (either altering the path or adding a querystring).
--- Seairth Jacobs seairthseairth.com
attached mail follows:
Hello,
On 08/22/2002 09:18 PM, Chris Shiflett wrote: >>> I'm not aware of support in either Netscape 6/7 or Mozilla. Care to >>> give a reference? >> >> >> >> http://www.mozilla.org/status/2002-08-21.html > > > > Thanks. I was not aware of this activity. As the only information > referencing NTLM on this page is dated August 8, I think it is safe to > assume that Netscape 6 does not support NTLM nor does any released > version of Mozilla, correct? Your initial comments seemed to indicate
What I meant is that Mozilla which is indeed the same program just bundled differently from Netscape 6/7 have the support for this.
> that they do. However, it does indicate that Mozilla support for this is > coming (and exists in the CVS snapshots after August 8), so thanks for > the link.
Actually the feature is older but was not as complete and tested as it is now that the developer released it as official. Look in the Bugzilla report history.
>>> I'm not sure where you get the anti-Microsoft sentiment. Microsoft >>> simply doesn't make a habit of using open standards or opening their >>> own (NTLM, for example). Thus, one can logically conclude that >>> support for Microsoft technologies traditionally lies largely in >>> Microsoft products alone. Yes, there are exceptions (Samba), but no >>> one suggested that NTLM was *only* supported by Microsoft products. >> >> Read your own line: >> >>> NTLM authentication is a Microsoft thing and as such is supported by >>> Microsoft products and pretty much no one else. >> >> > > Yes, as I also just said, "support for Microsoft technologies > traditionally lies largely in Microsoft products alone." There are > certain words that remove the absoluteness of statements. For example: > > I always win. != I almost always win. > I almost always win. == I pretty much always win. > > My first comment was very brief, as I assumed most people could infer > the longer version quoted above.
The way you have put it, it sounded as if this authentication method is only useful if you use only Microsoft products alone, which is not true. Maybe you should have been clearer.
>>> If you wish to refute this, please give us a reference to the NTLM >>> specification. >> >> >> >> http://www.innovation.ch/java/ntlm.html > > The opening sentence of this document proves my point: > > "This is an attempt at documenting the undocumented NTLM authentication > scheme." > > or this statement: > > "Since most of this info is reverse-engineered it is bound to contain > errors." > > The point is, while this "attempt at documenting" NTLM might be > perfectly accurate, there is no guarantee of that. NTML is a closed > "standard," and there is no documented specification for it. To > interoperate with many of Microsoft's closed protocols and standards, > people are forced to reverse-engineer something. This is exactly what > was necessary for Samba to be created. It follows suit that the more > difficult it is to create compatible software with a specific protocol > or standard, the less software will be created for that particular > protocol or standard. Since Microsoft can build software with the > benefit of the actual specification, their software is more likely to > support it.
Personally I do not care for the rhetoric. What I care is that with this reverse engineered information it was possible to build Samba and HTTP NTLM authetication modules that make viable for non-Microsoft products be used in applications where PHP can be used as a viable solution, thus providing job opportunities for many people like us that have been working mostly with PHP.
--Regards, Manuel Lemos
attached mail follows:
if your selling to US users or users already signed up with paypal, then you'll have few problems, if you want to sell to the rest of the world then you will have a high drop out rate due to paypals insistence on loading a US form as default, which your buyer will have to scroll down and find an outside the US link to get to the right page, this tends to confuse the user and annoy them as well as they try to submit the US form.
FYI paypal was recently taken over by ebay.
Paul Roberts
http://www.paul-roberts.com
mail
paul-roberts.com
++++++++++++++++++++++++
----- Original Message -----
From: "Bogdan Stancescu" <mgv
canad.ro>
To: <php-general
lists.php.net>
Sent: Thursday, August 22, 2002 3:42 AM
Subject: Re: [PHP] Web Site
> Just for the record, I'm sure you can Google out quite a few nasty > comments on PayPal - I remember reading some along the lines of "dear > all, I know it was much easier for you to send money via PayPal, I know > that giving up on using it will considerably decrease my income, but > after my [...] experience I want to have nothing to do with them > anymore". Never used PayPal myself, and problems are inherent for such a > large system, so don't take this as an anti-PayPal message - just try > searching for some user comments before starting to use it. > > Bogdan > > Roger Lewis wrote: > > On Wednesday, August 21, 2002 6:41 PM > > Peter Goggin wrote > > > > < 2. I need to set up credit card payments. Has anyone any experience with > > < PayPal? Are there any other providers I should consider. > > Nothing but good to say about PayPal > > Roger > > > > > > > > > > -- > > 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 > > >
attached mail follows:
I am looking to do some sort of content promotion tool for a site that I am working on. Now I am doing this, because the people who are running it know nothing about databases, or exports or anything like that, so I though I would make it easy for them.
So anyway what I have is a "staging" database and a "production" database, now some tables need updates and inserts, some tables need inserts and some can just blow away the table and go from there.
I am starting with the hardest one, this one carries data that is different from production and stage. So the production data in certain fields cannot be touched. So my thought is to compare the two tables, and of course on stage there will be more, so I grab the ids of the ones that are missing on production from stage and write the insert statement, after that is done I then run the update sql to turn the correct data online.
Okay there are other pieces, but where I am having troble is doing the compare, I want it to look at stage and say I have 5 rows, and look at production and say I have 2 rows, now it will say get the ids from stage that dont have counter parts on production.
Any thoughts ????
thanks
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
Hello,
With shorttags on ..you can do a quick <?=$var?> (instead of <? echo $var ?>) .... tried this with shorttags off and doesn't seem to work ... ideas? (tried <?php=$var?> .. fails)
-Peter
################################## Peter Thoenen - Systems Programmer Commercial Communications Camp Bondsteel, Kosovo ##################################
attached mail follows:
Not supported.
php=$var looks rather misleading, don't you think?
On Thu, 22 Aug 2002, Thoenen, Peter Mr. EPS wrote:
> Hello, > > With shorttags on ..you can do a quick <?=$var?> (instead of <? echo $var > ?>) .... tried this with shorttags off and doesn't seem to work ... ideas? > (tried <?php=$var?> .. fails) > > -Peter > > ################################## > Peter Thoenen - Systems Programmer > Commercial Communications > Camp Bondsteel, Kosovo > ################################## > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks for the quick answer..always just assumed I had the sytnax wrong :)
As for being misleading .. not really ... <?=$var?> looks no more/less misleading the <?php=$var?> If the person coding understands PHP he would know <?php === <? ... after all .. php=$var doesn't make any sense (since php by iself can't possibly be a var)
Anyways ... thanks for the clearing it up though (as in unsupported).
Cheers,
-Peter
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Thursday, August 22, 2002 19:35
> To: Thoenen, Peter Mr. EPS
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] <?=$var?> ..equiv w/ short-tags: off;
>
>
> Not supported.
>
> php=$var looks rather misleading, don't you think?
>
> On Thu, 22 Aug 2002, Thoenen, Peter Mr. EPS wrote:
>
> > Hello,
> >
> > With shorttags on ..you can do a quick <?=$var?> (instead
> of <? echo $var
> > ?>) .... tried this with shorttags off and doesn't seem to
> work ... ideas?
> > (tried <?php=$var?> .. fails)
> >
> > -Peter
> >
> > ##################################
> > Peter Thoenen - Systems Programmer
> > Commercial Communications
> > Camp Bondsteel, Kosovo
> > ##################################
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
Can I "redirect" a user with PHP without sending header("Location: ...")?
attached mail follows:
No, you cannot. The only other way is to use javascript to redirect.
-----Original Message-----
From: Erich Kolb [mailto:ekolb
randbreceivables.com]
Sent: Thursday, August 22, 2002 1:41 PM
To: php-general
lists.php.net
Subject: [PHP] Redirect?
Can I "redirect" a user with PHP without sending header("Location: ...")?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
"Erich Kolb" <ekolb
randbreceivables.com> wrote in message
news:20020822184042.11228.qmail
pb1.pair.com...
> Can I "redirect" a user with PHP without sending header("Location: ...")?
>
None I can think of unless you are using the UNIX Non-Graphical browser
lynx and upon a certain user action you execute:
if User Does A-B-C-D{ shell_exec() "coupled with the lynx commands lynx http://www.RedirectPage" }
That would be kind of silly though considering I don't know of a single person who uses browsers that don't have GUIs incorporated into them...
Spike...
attached mail follows:
Well, you can use HTML:
<meta http-equiv="refresh" content="0; url=http://www.php.net/">
Clint Tredway wrote:
>No, you cannot. The only other way is to use javascript to redirect.
>
>-----Original Message-----
>From: Erich Kolb [mailto:ekolb
randbreceivables.com]
>Sent: Thursday, August 22, 2002 1:41 PM
>To: php-general
lists.php.net
>Subject: [PHP] Redirect?
>
>
>Can I "redirect" a user with PHP without sending header("Location:
>...")?
>
attached mail follows:
You can use readfile(), which I've done at the end of a script that emails form data. At the end of the script, I "redirect" to a success message like this:
if ($ok) { readfile("http://www.whatever.com/thanks.html"); } else { echo("<p>Mail could not be sent.</p>"); }
-- Lowell Allen> From: Chris Shiflett <shiflett
php.net> > > Well, you can use HTML: > > <meta http-equiv="refresh" content="0; url=http://www.php.net/"> > > Clint Tredway wrote: > >> No, you cannot. The only other way is to use javascript to redirect. >> >> -----Original Message----- >> From: Erich Kolb [mailto:ekolb
randbreceivables.com] >> Sent: Thursday, August 22, 2002 1:41 PM >> To: php-general
lists.php.net >> Subject: [PHP] Redirect? >> >> >> Can I "redirect" a user with PHP without sending header("Location: >> ...")?
attached mail follows:
I have read that mkdir() (ON WINDOWS) will only make ONE file directory level deep at a time.
So if you need two directories, one inside another, you can NOT specify this in one line like... mkdir(/top/middle/bottom,0700);
Is this true? If so, what is the work around???
Thanks gang! -NorthBayShane
attached mail follows:
Hello Shane,
Here is some sample code that I've used on Unix, you may have to adapt it, etc. I verified this works on my Unix machine but the code as-is.
Jason
<?php function mkdir_parents($dir) { //seperate directory at /, this would have to be changed for windows
$directories = explode("/", $dir);
foreach ($directories as $directory) { $dirstring .= $directory . '/'; if (!is_dir($dirstring)) { mkdir($dirstring); } }
if (is_dir($dir)) { return 1; } else { return 0; } }
/* dir is the directory that will be created */ $dir="/home/jsheets/www/testdir/subdir1/subdir2";
/* call mkdir_parents with the path that needs to be created */ if (mkdir_parents($dir)) { print 'directory created!'; } else { print 'directory not created :('; }
?>
-----Original Message-----
From: Shane [mailto:shane
delaplaine.com]
Sent: Thursday, August 22, 2002 12:58 PM
To: php-general
lists.php.net
Subject: [PHP] mkdir() only makes one folder level deep.
I have read that mkdir() (ON WINDOWS) will only make ONE file directory level deep at a time.
So if you need two directories, one inside another, you can NOT specify this in one line like... mkdir(/top/middle/bottom,0700);
Is this true? If so, what is the work around???
Thanks gang! -NorthBayShane
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> I have read that mkdir() (ON WINDOWS) will only make ONE > file directory level deep at a time. > > So if you need two directories, one inside another, you can > NOT specify this in one line like... > mkdir(/top/middle/bottom,0700); > > Is this true? > If so, what is the work around???
Shane
It seems to me that this is something that you can test pretty easily for yourself. Create a small php test script that tries to create a directory and see what happens.
If you actually do this you'll learn more than if someone provides you with an answer.
In the end, you'll find yourself a much better programmer if you learn how to answer your own questions most of the time - particularly if you learn how to test things to see how they work.
In all honesty, the only way I could answer this question would be to try it for myself - since you can do that for yourself why should I?
CYA, Dave
attached mail follows:
Hello,
Could you tell me how to declare a session array 2 dimensions ?
Thanks
Christian,
attached mail follows:
Hi!
You don't have to declare it - just use it: $my_array[10][500]="foo";
Bogdan
Christian Ista wrote: > Hello, > > Could you tell me how to declare a session array 2 dimensions ? > > Thanks > > > Christian, >
attached mail follows:
> You don't have to declare it - just use it: > $my_array[10][500]="foo";
I talk about a session array. ($_SESSION)
Bye
attached mail follows:
Your question was already answered but you didn't understand. The $_SESSION var works just like any other. There's absolutely nothing special happening except that anything set to the $_SESSION array is automatically stored in the Session File on the server which you can call into other scripts with session_start(); It seems that Sessions confuse a lot of people but hopefully this make more sense now. :)
<? // page1.php session_start();
$_SESSION[0][0] = 'Row 1: Column 1'; $_SESSION[1][0] = 'Row 2: Column 1'; $_SESSION[0][1] = 'Row 1: Column 2'; $_SESSION[1][1] = 'Row 2: Column 2';
echo '<p><a href="page2.php">- Loop Array -</a>'; ?> ------- <? // page2.php session_start();
for($i=0; $i<count($_SESSION); $i++) { for ($j=0; $j<count($_SESSION[$i]); $j++) { echo $_SESSION[$i][$j]."<br>"; } } ?>
Enjoy, Kevin
> ----- Original Message -----
> From: "Christian Ista" <christian.ista
teledisnet.be>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 22, 2002 2:50 PM
> Subject: [PHP] Re: Session Array 2 dimensions
>
>
> >
> > > You don't have to declare it - just use it:
> > > $my_array[10][500]="foo";
> >
> > I talk about a session array. ($_SESSION)
> >
> > Bye
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
I am not sure this will reply to your question, but it is always worth to know this : if you need to save complex data structures such as n-dimension arrays, objects and so on in a cookie or in a DB, then there is a way to convert the data structure into a string with the function serialize(); and unserialize(); see : http://www.php.net/serialize
cheers !
Eric
"Christian Ista" <christian.ista
teledisnet.be> a écrit dans le message de
news: 20020822205254.32632.qmail
pb1.pair.com...
>
> > You don't have to declare it - just use it:
> > $my_array[10][500]="foo";
>
> I talk about a session array. ($_SESSION)
>
> Bye
>
>
attached mail follows:
PLEASE PLEASE PLEASE... I just need a simple clarification beyond what is in the manual.
When using mkdir()on WINDOWS do you specify the path string to start from where the script that is calling mkdir() is located..?
Like... mkdir(../current/dir_to_be_made,0700);
or do you have to enter the entire path from the main drive?
Like... mkdir(C:/top/current/dir_to_be_made,0700);
The manual didn't specify, and I am trying to trouble shoot why my calls are being denied.
Thanks folks. - NorthBayShane
attached mail follows:
> > PLEASE PLEASE PLEASE... > I just need a simple clarification beyond what is in the manual. > > When using mkdir()on WINDOWS do you specify the path string > to start from where the script that is calling mkdir() is located..? > > Like... > mkdir(../current/dir_to_be_made,0700); > > or do you have to enter the entire path from the main drive? > > Like... > mkdir(C:/top/current/dir_to_be_made,0700); > > The manual didn't specify, and I am trying to trouble shoot > why my calls are being denied.
I haven't tried either option lately so I couldn't say for certain but I suspect that either will work so long as you have the paths right. Set up a small test script for yourself and try it. I'm suggesting using a small test script as it lets you test this particular item in isolation so you can figure out what it is doing. Then you can apply what you learn to the script you're trying to trouble-shoot and if it still doesn't work you can then look elsewhere for the problem.
CYA, Dave
attached mail follows:
Hi all,
I've written a really simple contact management system that seems to work perfectly except for updating. Any changes to the contact record can't be fed back to the database.
I'd be very grateful if someone would take a look at a text version of the system and suggest where I am going wrong.
Thanks in advance.
http://captain.kirks.net/rhino/contacts.txt
-- PatrickGSM: 07876 560 646
Diplomacy is the art of saying "Nice doggie" until you find a rock
attached mail follows:
WHERE person_id=$person_id";
this needs to be:
WHERE person_id='$person_id'";
SQL items need to be single quoted.
--- Brad Dameron Network Account Executive TSCNet Inc. www.tscnet.com Silverdale, WA. 1-888-8TSCNET> -----Original Message----- > From: Patrick Kirk [mailto:patrick
kirks.net] > Sent: Thursday, August 22, 2002 1:03 PM > To: php-general
lists.php.net > Subject: [PHP] Unable to get a form to update > > > Hi all, > > I've written a really simple contact management system that seems to work > perfectly except for updating. Any changes to the contact record can't be > fed back to the database. > > I'd be very grateful if someone would take a look at a text version of the > system and suggest where I am going wrong. > > Thanks in advance. > > http://captain.kirks.net/rhino/contacts.txt > > > -- > Patrick > > GSM: 07876 560 646 > > Diplomacy is the art of saying "Nice doggie" until you find a rock > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Has anyone had a problem with getting $PHP_SELF to work on php 4.2.2. We installed php 4.2.2 on our server yesterday and now I cannot get it to <? echo "$PHP_SELF" ?>. I have several forms that are now broken.
Anyone else had this problem?
Thanks,
Jeremy
attached mail follows:
Turn on register_globals in your php.ini file or use $_SERVER['PHP_SELF']
On Thu, 22 Aug 2002, Jeremy Bowen wrote:
> Has anyone had a problem with getting $PHP_SELF to work on php 4.2.2. We > installed php 4.2.2 on our server yesterday and now I cannot get it to <? > echo "$PHP_SELF" ?>. I have several forms that are now broken. > > Anyone else had this problem? > > Thanks, > > Jeremy > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Not sure if this is the best place to ask this --- but...
It would be *great* if someone came up with a PHP.INI importer !!!!
OR, even better a PHP.INI wizard (not that the .INI is complex at all, but) -- it would be great instead of tagging through the doc with my text editor -- I can be presented with fields I can click in -- fresh with Tabs for different sub-sections -- it would be nice and fast!!
With new versions coming out about every month or so -- I find myself manually going through the new PHP.INI; checking to see if there is anything new in it -- and then manually adding my previous entries. I'm sure there are utils out there that will compare text files and look for Diff's... but if any of you out there are programming gods -- it would be a cool thing to have for PHP.
Thanks Jason
attached mail follows:
I'm stuck.
I'm trying to mine a bunch of data from a site, and I've gotten my script to the point where I can collect the path to the filename that I need... something like:
$File_To_Get = "http://www.someserver.org/ftp/yourfile.zip";
Now I want to automatically save this file to my hard drive, WITHOUT prompting me where to save it. I've tried simply using COPY:
COPY($File_To_Get, "d:\\myfiles\\file1.zip");
But this doesn't work. Seems like this should be really easy...but I'm failing miserably.
TIA
Chip Hankley
attached mail follows:
The problem with this, is that messages only queue at a max of 1,000 per minute (depending on hardware). If you're sending 100,000 mailings, the script still runs for over an hour, and does not return immediately.
--- Rasmus Lerdorf <rasmus
php.net> wrote:
> Simply configure your MTA to queue requests coming
> from PHP. Your php.ini
> file has the sendmail invocation line that is used
> by PHP's mail()
> function. Most MTA's out there have a sendmail-like
> interface and most
> have a way to tell it to simply queue the request
> and return immediately.
>
> For sendmail you tell it to queue by adding a option
> to the command line
> specified in php.ini using the -o flag. Check your
> sendmail docs for the
> actual option, but on my system my docs say:
>
> DeliveryMode=x
> Set the delivery mode to x. Delivery modes
> are `i' for
> interactive (synchronous) delivery, `b' for
> background
> (asynchronous) delivery, `q' for queue only -
> i.e., actual
> delivery is done the next time the queue is run,
> and
> `d' for deferred - the same as `q' except that
> database
> lookups for maps which have set the -D option
> (default
> for the host map) are avoided.
>
> Don't forget that if you just queue the mssages, you
> need to flush the
> queue every now and then. Traditionally that is
> done by a cron job that
> runs periodically and calls sendmail to flush the
> queue.
>
> -Rasmus
>
> On Wed, 21 Aug 2002, Pupeno wrote:
>
> > I know this issue have been discussed a lot of
> times but I checked a lot of
> > archives and documents and I couldn't find any
> solution.
> > What I want to do is send a lot of mails (belive
> me, it's not spamming) and
> > I thought about running the process of sending
> mails in background
> > (detached from the PHP script that runs it), so
> the page will return
> > immediatly and the other process will continue
> sending the mails in the
> > background.
> > I didn't find any way to run a process in the
> background from PHP
> > succesfully.
> > The manual says that using system(), if the stdout
> is redirected to a file,
> > it's run in background, I tryed redirecting
> stdout, stderr and stdin
> > to/from files and it still waits for the
> termination of the process, I
> > tryed adding & at the end of the process line and
> it didn't work neither.
> > Any idea of how I can do this (without using at,
> but maybe cron, I don't
> > know how) ?
> > Thank you.
> >
> > --
> > 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
>
__________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
attached mail follows:
On Friday 23 August 2002 05:37, Daren Cotter wrote: > The problem with this, is that messages only queue at > a max of 1,000 per minute (depending on hardware). If > you're sending 100,000 mailings, the script still runs > for over an hour, and does not return immediately.
The problem is that if you're sending that number of mail then you shouldn't be using PHP anyway. You should be using some real mailing-list manager.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Peace was the way. -- Kirk, "The City on the Edge of Forever", stardate unknown */
attached mail follows:
How do I open a text file, read its contents and use it to fill a textarea box of a form?
Thanks
attached mail follows:
<textarea><?readfile("file.txt");?></textarea> -Kevin
> ----- Original Message -----
> From: "Gui Guy" <gui_guy
hotmail.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, August 22, 2002 3:55 PM
> Subject: [PHP] Initializing a textarea box of a form with text.
>
>
> > How do I open a text file, read its contents and use it to fill a
textarea
> > box of a form?
> >
> > Thanks
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
If you use the wddx serializer you should be able to share sessions across the two systems. Not that I have ever tried it, but that is the theory anyway.
-Rasmus
On Wed, 21 Aug 2002, Mark McCulligh wrote:
> I have two server. One running PHP/Linux the other running ASP/2000.
> The user logins into the PHP server and session variables are made to hold
> their username, password, department, etc.. The site from time to time
> redirect the user to the ASP server. I want to pass the session variable
> across to the other server. I can't use the GET method.
> (www.domain.com/form.asp?username=Mark.....) because putting the password on
> the address bar is not an option. The ASP server will redirect them back
> when they are done on it. It will pass back the variables just in case the
> session on the PHP server has expired for the PHP server can create a new
> session if needed.
>
> I don't want to use a cookie.
>
> I was thinking of using cURL but I can't fine any information about using it
> in ASP. I know how to use cURL in PHP to redirect the user to the ASP
> server and pass the variables in the POST method, but not the other way.
>
> Any ideas would be a GREAT help.
> Mark.
>
> _________________________________________
> Mark McCulligh, Application Developer / Analyst
> Sykes Canada Corporation www.SykesCanada.com
> mmcculli
SykesCanada.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Just a test. Sorry if this goes through but I've been having significant trouble posting to the list lately. -Kevin
attached mail follows:
is there any reason why i shouldn't put my session_start(); in my include.php (which I include on all my *.php??)
attached mail follows:
I think my session_start; statment is devouring the variables that are posted with my form. Here are the basics (pseudo code):
<? include(includes.php); // the first line of this php file is "session_start();" printr($_POST) //debugging echo ($submit)//debugging
if(form was filled in and posted) check login/password agains mysql database info; else display form;
?>
The weird part is my debugs dont quite match...
$_POST = Array ['username']=>test, ['password']=test-pword, ['submit']=submit; $submit = NULL;
What gives?
attached mail follows:
Please try this:
printr($_POST) //debugging import_request_variables('p', 'p_'); echo ($p_submit)//debugging
"Alexander Ross" <alexross
bleen.net> wrote in message
news:20020822222340.14514.qmail
pb1.pair.com...
> I think my session_start; statment is devouring the variables that are
> posted with my form. Here are the basics (pseudo code):
>
> <?
> include(includes.php); // the first line of this php file is
> "session_start();"
> printr($_POST) //debugging
> echo ($submit)//debugging
>
> if(form was filled in and posted)
> check login/password agains mysql database info;
> else
> display form;
>
> ?>
>
> The weird part is my debugs dont quite match...
>
> $_POST = Array ['username']=>test, ['password']=test-pword,
> ['submit']=submit;
> $submit = NULL;
>
> What gives?
>
>
attached mail follows:
I have seen someone doing this in a script, but it don't work for me, and I didn't find documentation about it
----------------------------------------------------------------- In foo.php: <? echo "<a href='bar.php?color=blue'>Blue</a>"; ?>
In bar.php: <? echo "You have choosen $color"; ?> // Should print blue? -----------------------------------------------------------------
Whats the deal with php?x=y links ?
Regards
(RaNd0M)
attached mail follows:
RaNd0M wrote:
>In foo.php: ><? echo "<a href='bar.php?color=blue'>Blue</a>"; ?> >
If you only want to output static information in PHP, just do this instead:
<a href="bar.php?color=blue">Blue</a>
>In bar.php: ><? echo "You have choosen $color"; ?> // Should print blue? >
This example assumes that register globals is turned on. If it is not working for you, it is likely that this is not the case for you. Try this instead:
<? echo "You have chosen" . $_GET["color"]; ?>
Happy hacking.
Chris
attached mail follows:
Hi everybody!, I can't upload files?
<FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST>
my php.ini file_uploads = On
PHP Version 4.1.2/Apache
Please!! help me!!!
--jp
attached mail follows:
Whats the code in upload.php? Also, is upload.php also the file with the <form> tag or is this a seperate html/php file?
Please post the rest of your php code so someone can better help you and find any possible problems..
Take care.. peace.. eriol
====
"Juan Pablo Aqueveque" <juque
uct.cl> disgorged:
: I can't upload files? : : <FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST> : : my php.ini file_uploads = On : : PHP Version 4.1.2/Apache
attached mail follows:
OK eriol, this is my code!.
<HTML><BODY BGCOLOR=FFFFFF>
<?php
$uploadDir = '.fotos/';
if (isset($submit)){
if ($upload != 'none'){
$dest = $uploadDir . $upload_name;
if (
copy($upload, $dest)){
echo "Successfully uploaded $dest<BR>\n";
}
else{
echo "<FONT COLOR=FF0000><B>File Upload
Failed</B></FONT><BR>\n";
$perms =
fileperms($uploadDir);
$owner =
fileowner($uploadDir);
if (!$perms){
echo "Directory does not exist: $uploadDir<BR>\n";
}
else{
$myuid = getmyuid();
if (!($perms & 2) && !(($owner == $myuid) &&
($perms & 128))){
echo get_current_user(), " doesn't have
permission to write in $uploadDir<BR>\n";
}
}
}
}
else{
echo "<FONT COLOR=FF0000><B>File Upload
Failed</B></FONT><BR>\n";
echo "Filesize exceeds limit in FORM or php.ini<BR>\n";
}
}
?>
<FORM ENCTYPE=multipart/form-data ACTION="upload.php" METHOD=POST>
<INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000>
Upload File: <INPUT NAME=upload TYPE=FILE><BR>
<INPUT TYPE=SUBMIT NAME=submit VALUE="Upload">
</FORM>
</BODY></HTML>
At 19:34 22-08-2002 -0600, eriol wrote:
>Whats the code in upload.php? Also, is upload.php also the file with the
><form>
>tag or is this a seperate html/php file?
>
>Please post the rest of your php code so someone can better help you and find
>any possible problems..
>
>Take care.. peace..
>eriol
>
>====
>
>"Juan Pablo Aqueveque" <juque
uct.cl> disgorged:
>
>: I can't upload files?
>:
>: <FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST>
>:
>: my php.ini file_uploads = On
>:
>: PHP Version 4.1.2/Apache
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Here's is again if you Email client interpret HTML code:
<?php
$uploadDir = '.fotos/';
if (isset($submit)){
if ($upload != 'none'){
$dest = $uploadDir . $upload_name;
if (
copy($upload, $dest)){
echo "Successfully uploaded $dest<BR>\n";
}
else{
echo "<FONT COLOR=FF0000><B>File Upload
Failed</B></FONT><BR>\n";
$perms =
fileperms($uploadDir);
$owner =
fileowner($uploadDir);
if (!$perms){
echo "Directory does not exist: $uploadDir<BR>\n";
}
else{
$myuid = getmyuid();
if (!($perms & 2) && !(($owner == $myuid) &&
($perms & 128))){
echo get_current_user(), " doesn't have
permission to write in $uploadDir<BR>\n";
}
}
}
}
else{
echo "<FONT COLOR=FF0000><B>File Upload
Failed</B></FONT><BR>\n";
echo "Filesize exceeds limit in FORM or php.ini<BR>\n";
}
}
?>
the form
<FORM ENCTYPE=multipart/form-data ACTION="upload.php" METHOD=POST> <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10000> Upload File: <INPUT NAME=upload TYPE=FILE><BR> <INPUT TYPE=SUBMIT NAME=submit VALUE="Upload"> </FORM>
--jp
At 19:34 22-08-2002 -0600, you wrote: >Whats the code in upload.php? Also, is upload.php also the file with the ><form> >tag or is this a seperate html/php file? > >Please post the rest of your php code so someone can better help you and find >any possible problems.. > >Take care.. peace.. >eriol > >==== > >"Juan Pablo Aquev