php-windows Digest 21 Feb 2003 17:15:34 -0000 Issue 1599
Topics (messages 18646 through 18657):
Re: Authenticate user
18646 by: toby z
18651 by: Rui
18656 by: Rich Gray
Re: PHP HTTP Authentication, Win2k & IIS
18647 by: Juraj Hasko
user selectionz ?????
18648 by: toby z
18654 by: Jill.Ramonsky.Aculab.com
Re: Writing in txt file...
18649 by: Radovan Radic
Re: Force a user to download a text file from a link
18650 by: Jill.Ramonsky.Aculab.com
18652 by: FARRINGTON, RYAN
18653 by: Jill.Ramonsky.Aculab.com
Problem with extensions in PHP4.3.1
18655 by: Christian Bartsch
18657 by: Russell Johnson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
hi rui
1st of all y do u want to clean up user data collected ????
:S
2nd if u only want to authentify a user (logged into ur system/site)
try this :
// session check ! ! ! !
session_start();
if(!session_is_registered("name-of-session-u-registered-for-user" ))
{
header("Location: /root/error-file-name.php");
exit();
}
hope i ve helped
good luck
toby ......
--- Rui <[EMAIL PROTECTED]> wrote: > I'm trying to make a page
that requires an authentification by the
> user.
>
> A lot of problems appear when I run a script copied from the
> "O'Reilly : Web
> Database Applications".
>
> One of them is the function :clean: that doesn't exist, according
> with the
> php compiler:
>
> session_start();
>
> $authenticated = false;
>
> // Clean the data collected from the user
> $appUsername =
> clean($HTTP_POST_VARS["formUsername"], 10);
> $appPassword =
> clean($HTTP_POST_VARS["formPassword"], 15);
>
> Can someone tell me what is the prob? Where can I get information
> for this
> kind of script?
>
> Thanks.
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
I'm really new at this authentification thing...
What I want do to:
1- a user appears
2- he fills a form (easy)
3- gain access to the page (?)
4- no one else can log-on until the user who is logged quits (very
important) (????)
5- inside the user can surf in diferent php files without being asked for
new athentification (????)
-----------------------------------
3 - Trying to authentificate user the warnings bellow appear:
Warning: Cannot send session cache limiter - headers
already sent
Warning: Cannot add header information - headers already
sent by (
Line of the first Warning:
// Main ----------
session_start();
Line of second warning:
// Relocate back to the login page
header("Location: index.php");
5- How can a user surf in diferent pages with the same loggin?
Thanks
Rui Monteiro
"Rui" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to make a page that requires an authentification by the user.
>
> A lot of problems appear when I run a script copied from the "O'Reilly :
Web
> Database Applications".
>
> One of them is the function :clean: that doesn't exist, according with the
> php compiler:
>
> session_start();
>
> $authenticated = false;
>
> // Clean the data collected from the user
> $appUsername =
> clean($HTTP_POST_VARS["formUsername"], 10);
> $appPassword =
> clean($HTTP_POST_VARS["formPassword"], 15);
>
> Can someone tell me what is the prob? Where can I get information for this
> kind of script?
>
> Thanks.
>
>
--- End Message ---
--- Begin Message ---
Rui
You will have to check a session attribute at the start of each of your
scripts that you want to protect to ensure that the user has logged on.
Locking out other users whilst this user is logged on will mean flipping
some flag in a database table or creating a row that tells your login script
that someone is altready logged on. Problem is that this row will have to
get cleared after a certain timeout else noone will be able to logon again
even though the original user has gone away. The errors you are getting are
because you are sending http headers - session.start() sends an http header
as a session cookie and obviously header() as well - you cannot send http
headers once html output to the browser has started so check that these
functions are called first... you can use output buffering if this poses a
logical problem for your scripts.
<pseudo code>
<?
// Protected script
// Assume db is connected already
session.start();
if (!isset($_SESSION['logged_on'])) {
$rs = mydb_query('select 1 from user_already_logged_in');
$in = (mydb_num_rows($rs) == 1);
header('Location: http://mysite.com/'.($in ? 'sorry.php' : 'login.php'));
exit();
}
// User is logged in ...
.
.
?>
</pseudo code>
HTH
Rich
> -----Original Message-----
> From: Rui [mailto:[EMAIL PROTECTED]]
> Sent: 21 February 2003 11:24
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: Authenticate user
>
>
> I'm really new at this authentification thing...
>
> What I want do to:
>
> 1- a user appears
> 2- he fills a form (easy)
> 3- gain access to the page (?)
> 4- no one else can log-on until the user who is logged quits (very
> important) (????)
> 5- inside the user can surf in diferent php files without being asked for
> new athentification (????)
>
> -----------------------------------
>
> 3 - Trying to authentificate user the warnings bellow appear:
> Warning: Cannot send session cache limiter - headers
> already sent
> Warning: Cannot add header information - headers already
> sent by (
>
> Line of the first Warning:
>
> // Main ----------
> session_start();
>
> Line of second warning:
>
> // Relocate back to the login page
> header("Location: index.php");
>
>
> 5- How can a user surf in diferent pages with the same loggin?
>
>
> Thanks
>
> Rui Monteiro
>
>
>
> "Rui" <[EMAIL PROTECTED]> escreveu na mensagem
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm trying to make a page that requires an authentification by the user.
> >
> > A lot of problems appear when I run a script copied from the "O'Reilly :
> Web
> > Database Applications".
> >
> > One of them is the function :clean: that doesn't exist,
> according with the
> > php compiler:
> >
> > session_start();
> >
> > $authenticated = false;
> >
> > // Clean the data collected from the user
> > $appUsername =
> > clean($HTTP_POST_VARS["formUsername"], 10);
> > $appPassword =
> > clean($HTTP_POST_VARS["formPassword"], 15);
> >
> > Can someone tell me what is the prob? Where can I get
> information for this
> > kind of script?
> >
> > Thanks.
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
I don't know if this is what you need but I'm using authentication on
IIS 5.1 & PHP 4.3.0 with this configuration:
PHP:
register_globals off
IIS config:
Anonymous access off
Integrated windows authentication on
Cheers,
Juraj
-----Original Message-----
From: John Toews [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 20, 2003 9:55 PM
To: Rich Gray
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] PHP HTTP Authentication, Win2k & IIS
Thanks Rich, and Rico...
I turned register_globals on to no effect.
The only odd thing I am doing for IIS is that I
installed PHP under the ISAPI filters tab as well as
the configuration button. Normally I only install
under the configuration button. But it doesn't seem to
help.
Thanks!
--- Rich Gray <[EMAIL PROTECTED]> wrote:
> Are you doing the hack needed to use HTTP
> authentication with IIS? HTTP
> Authentication is only supported by Apache with PHP
> as a module, but there
> is a hack/workaround for IIS/ISAPI.
>
> Cheers
> Rich
> > -----Original Message-----
> > From: Rico Derks [mailto:[EMAIL PROTECTED]]
> > Sent: 20 February 2003 07:49
> > To: John Toews; [EMAIL PROTECTED]
> > Subject: Re: [PHP-WIN] PHP HTTP Authentication,
> Win2k & IIS
> >
> >
> > Hi,
> >
> > I saw on the Zend page that they global variables.
> Check in your
> > php.ini if
> > your register_globals is on.
> >
> > Cheers, RICO.
> >
> > At 15:58 19/02/2003, John Toews wrote:
> > ><apologies if this came through yesterday as
> well, I never saw
> > it propogate
> > >though>
> > >
> > >Hello All,
> > >
> > >I am experimenting with HTTP authentication in
> IIS 5.0 on a
> > Windows 2000 SP3
> > >server with PHP 4.3.0. PHP is installed as an
> ISAPI module both
> > as a filter
> > >and an application mapping (both point to the
> php4isapi.dll).
> > All forms of
> > >authentication are turned off in IIS (anonymous
> access only). I
> > am using the
> > >php.ini-dist with only the /extensions directory
> changed.
> > >
> > >It appears to me that the user/pass I enter is
> never getting
> > through to PHP.
> > >I've tried authentication examples from
> > >http://www.zend.com/zend/tut/authentication.php
> as well as
> >
>
>http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCode
> > Id=252&lngW
> > >Id=8 with no luck.
> > >
> > >(btw, tested on a friends BSD/Apache, worked fine
> [a simple test from the
> > >zend.com page])
> > >
> > >Thanks!
> > >
> > >
> > >
> > >
> > >--
> > >PHP Windows Mailing List (http://www.php.net/)
> > >To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> >
> >
>
--- End Message ---
--- Begin Message ---
hi guyz
im making this report generation form which
lets the user select a category out of 8 through a dropdown list
then the user has to select a few more thinggs
only then the report can be generated
now my problem is
each of the 8 categories has 3 to 5 sub-categories
what i want to do is when he selects a category the sub-cat-dropdown
should get the sub-cats of ONLY the category selected
n i have no clue how to go about this decently
that is without having to re-load the page when category is selected
suggesstion .... solutions pleeeeeeez
thnx a million
toby .....
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
The good news is it's possible. The bad news is that it's not possible using
PHP alone.
You can't do client-side stuff with a server-side script.
You need to write that bit in Javascript, I'm afraid, so the code can run on
the user's browser.
Jill
-----Original Message-----
From: toby z [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 8:02 AM
To: php hlp list
Subject: [PHP-WIN] user selectionz ?????
hi guyz
im making this report generation form which
lets the user select a category out of 8 through a dropdown list
then the user has to select a few more thinggs
only then the report can be generated
now my problem is
each of the 8 categories has 3 to 5 sub-categories
what i want to do is when he selects a category the sub-cat-dropdown
should get the sub-cats of ONLY the category selected
n i have no clue how to go about this decently
that is without having to re-load the page when category is selected
suggesstion .... solutions pleeeeeeez
thnx a million
toby .....
--- End Message ---
--- Begin Message ---
Why dont open for append
$fp=fopen("file.txt","a");
fputs($fp,"New line?");
Or i didnt understand what do u need?
"Afan Pasalic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> I'm working on adding a new row in text file. I use file() to transfer
file
> to array and then after recognizing the row with MARK_HERE hadd new row
> above the MARK row. It works fine. I use this code:
>
> $AddContent = "Content of the new line...";
>
> $lines = file('old_content.txt');
> for($i=0; $i<count($lines); $i++)
> {
> echo "$i. $lines[$i]<br>";
> if(ereg('### MARK_HERE New row comes above this one', $lines[$i]))
> {
> $NewArray[] = $AddContent;
> }
> $NewArray[] = $lines[$i];
> }
>
> But what then? Code to add new line works fine but can't convert/write
back
> to new_content.txt file. looking for something opposite then file() -
> taking array and writing it in file...
>
> Thanks for any help!
>
>
> Afan
>
--- End Message ---
--- Begin Message ---
Far be it from me to question the wisdom of tweaking the headers, but why do
you need them at all?
Why can't you just do:
<a href ="filename.txt">click here</a>
which, so far as I can see, will load said text page into the user's browser
window as soon as they click on the link. If the user then wants to save it,
they can use the browser's Save As function.
Too easy?
Jill
-----Original Message-----
From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 20, 2003 2:22 PM
To: 'George Pitcher'; Matt Babineau; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Force a user to download a text file from a link
you could also try this:
or this
or this
--- End Message ---
--- Begin Message ---
that requires some form of trust in the user... I experience too many stupid
people in what I do on a day to day basis and it is just easier if it forces
a download...
typical user experience: I were a user and there was a link to a word
document that i wanted to edit. If I clicked on the link [and I had word
installed =)] it would open the file in my browser window and allow me to
edit it... but there is not toolbar for saving.. where are all my formatting
tools... oh no I've gotta call the person that put the link out because I
can't figure out what to do... help me ... BLAH!!! I hate people like that
so I force the download and they edit it locally and use the same page to
re-upload it.. it is just easier =)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 3:51 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Force a user to download a text file from a link
Far be it from me to question the wisdom of tweaking the headers, but why do
you need them at all?
Why can't you just do:
<a href ="filename.txt">click here</a>
which, so far as I can see, will load said text page into the user's browser
window as soon as they click on the link. If the user then wants to save it,
they can use the browser's Save As function.
Too easy?
Jill
-----Original Message-----
From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 20, 2003 2:22 PM
To: 'George Pitcher'; Matt Babineau; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Force a user to download a text file from a link
you could also try this:
or this
or this
--- End Message ---
--- Begin Message ---
Yeah, but the title of this thread says to download a TEXT FILE, not a Word
document.
No-one with any sense would ever download a Microsoft Word document off the
internet by choice, unless they had a serious amount of trust in the web
site owner, were browsing over a secure connection using SSL, and said
document was digitally signed with a PHP signature or similar. And even
then, you'd want to make sure your virus checker was switched on. This is
because Microsoft Word documents, like executables, CAN CARRY VIRUSES
(called Word Macros).
...and if you should _ever_ discover how to force someone to download
something against their will, then that of course would be highly
unethical...
Maybe I'm just missing the point here. Is it really TEXT documents you're
interested in, or something else? If it's text documents only, then my
original suggestion still stands. If it's something more sinister then
perhaps we should consider changing the thread title.
Jill
-----Original Message-----
From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 1:28 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Force a user to download a text file from a link
that requires some form of trust in the user... I experience too many stupid
people in what I do on a day to day basis and it is just easier if it forces
a download...
typical user experience: I were a user and there was a link to a word
document that i wanted to edit. If I clicked on the link [and I had word
installed =)] it would open the file in my browser window and allow me to
edit it... but there is not toolbar for saving.. where are all my formatting
tools... oh no I've gotta call the person that put the link out because I
can't figure out what to do... help me ... BLAH!!! I hate people like that
so I force the download and they edit it locally and use the same page to
re-upload it.. it is just easier =)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 3:51 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Force a user to download a text file from a link
Far be it from me to question the wisdom of tweaking the headers, but why do
you need them at all?
Why can't you just do:
<a href ="filename.txt">click here</a>
which, so far as I can see, will load said text page into the user's browser
window as soon as they click on the link. If the user then wants to save it,
they can use the browser's Save As function.
Too easy?
Jill
--- End Message ---
--- Begin Message ---
Hi folks,
we just upgraded to the newest PHP from 4.3.0. I´m a little bit surprised
because of the manual saying that this should be a security fix only.
Unfortunately, serveral extensions fail to work.
PHP 4.3.1 is running with IIS5.0 (no comments on that please). Runing as a
CGI. with version 4.3.0 everything was fine. After the upgrade extensions
CURL and MSSQL fail to work. The failure is that no page is returned, the
process is then stopped after 300 seconds by IIS with a timeout error.
The ini points to
extension_dir = c:\php\extensions\
where the extensions reside. Moving the "faulty" extensions to then system32
dir does not help either.
Am I doing anything wrong?!
Regards,
Chris
--- End Message ---
--- Begin Message ---
I had a similar problem installing PHP 4.3.1. There appear to be more than a
few php libraries that Windows has problems finding. What I did was the
following:
In php.ini, I set the extension_dir to nothing:
extension_dir =
Then I moved most everying in the dlls and extension directories of the php
distribution into \windows\system32 (at least the ones I needed).
It worked for me, so good luck
- Russ
-----Mensaje original-----
De: Christian Bartsch [mailto:[EMAIL PROTECTED]]
Enviado el: Friday, February 21, 2003 4:07 PM
Para: [EMAIL PROTECTED]
Asunto: [PHP-WIN] Problem with extensions in PHP4.3.1
Hi folks,
we just upgraded to the newest PHP from 4.3.0. I?m a little bit surprised
because of the manual saying that this should be a security fix only.
Unfortunately, serveral extensions fail to work.
PHP 4.3.1 is running with IIS5.0 (no comments on that please). Runing as a
CGI. with version 4.3.0 everything was fine. After the upgrade extensions
CURL and MSSQL fail to work. The failure is that no page is returned, the
process is then stopped after 300 seconds by IIS with a timeout error.
The ini points to
extension_dir = c:\php\extensions\
where the extensions reside. Moving the "faulty" extensions to then system32
dir does not help either.
Am I doing anything wrong?!
Regards,
Chris
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---