php-windows Digest 19 Oct 2002 08:23:39 -0000 Issue 1394
Topics (messages 16436 through 16440):
Re: [PHP] Re: Need help with HTTP-Authentication
16436 by: Ryan Marrs
Re: printer_ functions...
16437 by: Brian McGarvie
IIS \ Apache and header(location: errors
16438 by: BOb Pardoe
Re: Question about emalloc
16439 by: Mikey
configuraing PDFlib & ClibPDF with php ????
16440 by: toby z
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 ---
Actually, I have used both. You can authenticate using basic
authentication, then grab the $_SERVER["AUTH_USER"]... (I believe that's the
correct variable) and authenticate them internally through that. I wrote a
task management system for our department a few months ago where it was
necessary to log them in to keep it internal only, and there was no point in
managing two sets of passwords.
Turn Basic authentication on, and windows authentication off (I found PHP
would crash with this on, never felt like investigating it, and since it was
internal, it didn't matter too much).
Then you can do something like this:
<? If(!empty($_SERVER["AUTH_USER"]))
{
?> You have successfully logged in, <?
print($_SERVER["AUTH_USER"]); ?>!
then do your database query to see what they have access to:
mssql_query("Select AccessLevel From Users Where UserName ='" .
$_SERVER["AUTH_USER"] . "');
One thing you should remember, is that the AUTH_USER also contains the
domain they logged into, so you may have to do a replace on that variable
(IE):
<?
$_SESSION["Username"] = substr($_SERVER["AUTH_USER"], strrchr("\\",
$_SERVER["AUTH_USER"]), strlen($_SERVER["AUTH_USER"]);
?>
should do the trick.
As a warning, I don't know for certain that the above code is 100% correct,
as I just threw it together, but it should be fine. As a second warning,
all that code assumes that you have the default options set on the PHP
Config, and that none of the standard functions are blocked. I write most
of my code to be as portable as possible, and the only way to do that is to
adhere to the default php.ini, which can be downloaded and dumped in place
of my current one, with minimal changes, and without my code breaking :)
I also use MSSQL, so if you're using mySQL, make sure you change that as
well.
Good luck in your endeavor!
___________________________________
Ryan Marrs
-----Original Message-----
From: Davy Obdam [mailto:info@;davyobdam.com]
Sent: Friday, October 18, 2002 7:59 AM
To: 'Cam Dunstan'; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] RE: [PHP] Re: Need help with HTTP-Authentication
Hi Cam,
Thanks for your reaction. I was wondering if u could send me some
example code maybe;-)
I am a bit new to session based login systems myself;-) Thanks already.
Best regards,
Davy Obdam,
mailto:info@;davyobdam.com
> David and Davy,
>
> My two bobs worth - I like to use sessions myself usually, I
> suppose because it means my scripts are controlling access
> rather than the server or the operating system. With sessons
> you can store all sorts of variables such as exactly what the
> user can do in a list of tasks rather than just "will we let
> him in or not". The user submits a form with his username
> and password, I look them up in a database, and if I find him
> I grab a "task list" of things he is allowed to do on the
> site (could be different for every user) and store them in a
> session. Everytime he tries to go somewhere on the site the
> script first checks if that task is in his list -
> furthermore, you can kick him off if he has overstayed or
> there has been no action for a period of time - also gives
> you the opportunity to log or time his total activity on the site.
>
> I wrap each script in a small "include" routine which does
> all this so its
> no big deal in terms of coding effort or extra overhead.
> You might like to
> go this road rather than the simpler but more restrictive
> HTTP auth. way.
>
> Cheers CD
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
that is what i asked about in my question...
What i was asking is if anyone had used it and if there was any examples to
get me gong...
"Frank M. Kromann" <[EMAIL PROTECTED]> wrote in message
news:103487994601@;kromann.info...
> You could also take a look at the printer extension for PHP
>
> http://php.net/printer
>
> These functions are available for server side printing, when PHP is
running on a Win32 box.
>
> - Frank
>
>
> > it depends on your printer & system.
> >
> > if you want to use printer commands directly in your code then u must
know
> > the commands for your printer. the algorithm will be:
> >
> > 1. Initialize printer ( <ESC>@ is the command for most dot matrix
printers)
> > .
> > 2. Set paper size, tabs (vertical & horizontal) etc. using appropriate
> > printer commands
> > 3. Send the data including embedded printer commands for advancing paper
> > etc.
> >
> > quite some time back, i made a program in clipper for printing purchase
> > orders on dot matrix printer, its still working fine.
> >
> > the simplest printer commands are of dot matrix printers, for other
inkjet /
> > laser printers the commands vary from manufacturer to manufacturer.
> >
> > Alternatively, i think MS-Access is very good for this application, all
u
> > need is to design a report, where u can specify the paper size, where to
> > print data etc. You don't have to worry about printer commands in this
> > case.
> >
> > regds,
> > -----Original Message-----
> > From: Brian McGarvie [mailto:brian.mcgarvie@;anypurposeloans.co.uk]
> > Sent: Wednesday, October 16, 2002 20:18
> > To: [EMAIL PROTECTED]
> > Subject: printer_ functions...
> >
> >
> > I have a specific problem ;)
> >
> > I have been asked if it is possible to write a 'simple' application that
> > will print onto Bank Cheques - they will be supplied on a continuous
> > roll
> > aparently, so it'll be one cheque followed by another etc perferated
> > inbetween...
> >
> > So my question is has anyone ever tried this or similar? or even if you
> > have'nt has anyone got any pointers to start me off?
> >
> > Alternativley is there any software already out there?
> >
> > I have been looking but can only find things like Sage, which ha all the
> > stock controll etc etc which is not required, the application will
> > simple be
> > to take a series name's & ammount's and print the cheques...
> >
> > Thanks in advance...
> >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
--- End Message ---
--- Begin Message ---
I am trying to execute the following redirection on a web page if the error
condition is true
if ($_POST["txtPassword"] == "" ) {
header ("Location :
http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"])."/"."errors.php
?Err=".URLEncode("LogOn -002")."&SrcLocn=".URLEncode("LogOn.php")."&Info=".U
RLEncode("The Password Cannot Be
Empty")."&RtnTo=".URLEncode("LogOn.php")."&Params=".URLEncode($Params));
exit;
}
The text resolves to
http://localhost/public/errors.php?Err=LogOn+-+002&SrcLocn=LogOn.php&Info=Th
e+Password+Cannot+Be+Empty&RtnTo=LogOn.php&Params=
which is correct.
I am running on XP SP1
My problem is that this works fine on IIS 5.0 but fails on Apache 1.3.26 and
Apache 2.0.39
No errors are logged in php, apache or event logs.
I just get a blank page, viewing this source it is the index.php page (the
frameset definitions)
Ideas ?
Any help appreciated.
Thanks
--- End Message ---
--- Begin Message ---
> The result is efreed in that case. RETURN_STRINGL is a macro that assigns
> result to return_value and return_value is implicitly efreed by PHP.
> That's the only reason you are not getting a warning in that case. For
> other stuff that you emalloc but don't assign to return_value, you will
> get a warning if you do not efree it.
>
> -Rasmus
OK, thanks for clearing this up for me guys :-)
I reckon I might have to check this O'Reilly book out though...
regards,
Mikey
--- End Message ---
--- Begin Message ---
hi guyz
now im stuck between ClibPDF and PDFlib
1. i jst cant figure out which ne to use , ive
already downloaded both
2. in PDFlib requirements they say ill need JPEG and
TIFFlibraries too
i ve em all on my machene n im totally lost as how
to configure all of these with php :$
can n will sumbdy hlp plz
thnx a million guyz
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 ---