php-windows Digest 9 Jul 2002 09:15:33 -0000 Issue 1231

Topics (messages 14604 through 14622):

Administration using PHP/ADSI
        14604 by: Bill Rucker
        14617 by: Manuel Lemos

Closest store location by zip code
        14605 by: R.S. Herhuth
        14606 by: George Nicolae
        14608 by: Paul Roberts
        14611 by: Scott Hurring

Re: track_vars and register_globals
        14607 by: David Elliott
        14609 by: Shrock, Court
        14610 by: David Elliott

Re: playing with register globals  ....
        14612 by: Scott Hurring

Re: COM stalls the server..
        14613 by: Scott Hurring

Re: WinampCOM problem
        14614 by: Scott Hurring

Re: Session - funny or magic?
        14615 by: Scott Hurring

Using file metadata and Windows 2000/XP's Index
        14616 by: C.A. Malartre

Zip Problem
        14618 by: Mathew Joseph

time stamp .... ????
        14619 by: toby z

XML parser file
        14620 by: Mathew Joseph

XSL problem
        14621 by: Mathew Joseph

Request for ideas...
        14622 by: Mikey

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 ---
I have written an intranet application that needs to be used by different
types of users. However, I want to prevent some users from changing the data
in the database. The server providing this application is running PHP 4.2 on
IIS5. I would like to capture the error message cleanly and present a "You
are not authorized to view this page" message based on Windows NT user ID or
group membership. I use ADSI for other tasks and it is an obvious choice
here as well. I just can't seem to get it to work properly.

Here is a sample of what I am trying just to prove it can work:
<?php
    $objDomain = new COM("WinNT://DomainName") or die("Cannot get DomainName
object");
    $objDomain->filter = array("group");
    foreach($objDomain as $group){
        print $group->name."<br>\n";
    }
    print "\nDomainName Group enum complete<br>\n";
?>

The output of this script is just the final print statement. It appears to
get the object fine.

Any help would be appreciated.

Bill

--
"It is not what name others call you that matters,
but what name you respond to that truly determines
who you are." - Old Swahili saying



--- End Message ---
--- Begin Message ---
Hello,

On 07/08/2002 04:48 PM, Bill Rucker wrote:
> I have written an intranet application that needs to be used by different
> types of users. However, I want to prevent some users from changing the data
> in the database. The server providing this application is running PHP 4.2 on
> IIS5. I would like to capture the error message cleanly and present a "You
> are not authorized to view this page" message based on Windows NT user ID or
> group membership. I use ADSI for other tasks and it is an obvious choice
> here as well. I just can't seem to get it to work properly.
> 
> Here is a sample of what I am trying just to prove it can work:
> <?php
>     $objDomain = new COM("WinNT://DomainName") or die("Cannot get DomainName
> object");
>     $objDomain->filter = array("group");
>     foreach($objDomain as $group){
>         print $group->name."<br>\n";
>     }
>     print "\nDomainName Group enum complete<br>\n";
> ?>
> 
> The output of this script is just the final print statement. It appears to
> get the object fine.
> 
> Any help would be appreciated.

I don't know if you are aware of it, but there is a book on PHP 
programming for Windows that has a whole chapter on Active Directory. It 
also shows how to make queries with PHP LDAP functions besides using COM 
objects.

You may want to take a look at a review of the book here:

http://www.phpclasses.org/products.html/id/0735711690.html



-- 

Regards,
Manuel Lemos

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

Does any one know of a php script to calculate the closest store to a
user entered zip code?

Thanks,
Ron
--- End Message ---
--- Begin Message ---
Does any one know a php script that send to my account unlimited money?

--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"R.S. Herhuth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Does any one know of a php script to calculate the closest store to a
> user entered zip code?
>
> Thanks,
> Ron


--- End Message ---
--- Begin Message ---
No but when you find it please post it here.

----- Original Message ----- 
From: "George Nicolae" <[EMAIL PROTECTED]>
To: <>
Sent: Monday, July 08, 2002 9:16 PM
Subject: [PHP-WIN] Re: Closest store location by zip code


Does any one know a php script that send to my account unlimited money?

--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"R.S. Herhuth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Does any one know of a php script to calculate the closest store to a
> user entered zip code?
>
> Thanks,
> Ron



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




--- End Message ---
--- Begin Message ---
Actually, a fine gentleman from Nigera the other day
emailed me the encrypted source code to just such
a script.... all i had to do was give him my bank
account information and let him transfer over
$25 million to me so i could afford some machines
to crack the encryption.  :-)

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Paul Roberts" <[EMAIL PROTECTED]> wrote in message
007301c226bc$fda2d790$96eb86d9@laptop1">news:007301c226bc$fda2d790$96eb86d9@laptop1...
No but when you find it please post it here.

----- Original Message -----
From: "George Nicolae" <[EMAIL PROTECTED]>
To: <>
Sent: Monday, July 08, 2002 9:16 PM
Subject: [PHP-WIN] Re: Closest store location by zip code


Does any one know a php script that send to my account unlimited money?

--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"R.S. Herhuth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Does any one know of a php script to calculate the closest store to a
> user entered zip code?
>
> Thanks,
> Ron



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






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

On 08 July 2002 at 10:02:42 -0500 (which was 16:02 where I live) Scott Carr
wrote

> $SESSION['count'] should be used to access the variable.

Did not work but see below.

> Register globals set to true, would let you use $count, but is not
> suggested due to security risks.

True that is why I have it turned off.

This worked, thanks Scot for the pointer.
==========8<=============================================================
<?
session_start();
if (!session_is_registered('count')) 
{
  session_register('count');
  $count = 1;
}
else 
{
  $count = $HTTP_SESSION_VARS["count"] +1;
  $HTTP_SESSION_VARS["count"] = $count ;
}
?>
Hello visitor, you have seen this page <?= $count; ?> times.<p>
<?= session_id(); ?><br>
To continue, <A HREF="page2.php">click here</A>
==========8<=============================================================
-- 
 BFN,                      _______________________________________________
  David                   |    David  Elliott    |   Software Engineer    |
 _________________________|  [EMAIL PROTECTED] | PGP Key ID 0x650F4534  |
| Ah Sarcasm, Gotta love it. -- Garrison Jim of Bajor.                    |

--- End Message ---
--- Begin Message ---
$SESSION['count'] wouldn't work....but $_SESSION['count'] should....if not,
you are using an older version of PHP.

> -----Original Message-----
> From: David Elliott [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 08, 2002 1:18 PM
> To: php-windows
> Subject: Re: [PHP-WIN] track_vars and register_globals
> 
> 
> Hi Scott
> 
> On 08 July 2002 at 10:02:42 -0500 (which was 16:02 where I 
> live) Scott Carr wrote
> 
> > $SESSION['count'] should be used to access the variable.
> 
> Did not work but see below.
> 
> > Register globals set to true, would let you use $count, but is not 
> > suggested due to security risks.
> 
> True that is why I have it turned off.
> 
> This worked, thanks Scot for the pointer. 
> ==========8<==================================================
> ===========
> <?
> session_start();
> if (!session_is_registered('count')) 
> {
>   session_register('count');
>   $count = 1;
> }
> else 
> {
>   $count = $HTTP_SESSION_VARS["count"] +1;
>   $HTTP_SESSION_VARS["count"] = $count ;
> }
> ?>
> Hello visitor, you have seen this page <?= $count; ?> 
> times.<p> <?= session_id(); ?><br> To continue, <A 
> HREF="page2.php">click here</A> 
> ==========8<==================================================
> ===========
> -- 
>  BFN,                      
> _______________________________________________
>   David                   |    David  Elliott    |   Software 
> Engineer    |
>  _________________________|  [EMAIL PROTECTED] | PGP Key ID 
> 0x650F4534  |
> | Ah Sarcasm, Gotta love it. -- Garrison Jim of Bajor.        
>             |
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Greetings Court

On 08 July 2002 at 13:20:48 -0700  (which was 21:20 where I live) Shrock,
Court emanated these words of wisdom

> $SESSION['count'] wouldn't work....but $_SESSION['count'] should....if
> not, you are using an older version of PHP.

It works. Ta.

-- 
 Best regards,             _______________________________________________
  David                   |    David  Elliott    |   Software Engineer    |
 _________________________|  [EMAIL PROTECTED] | PGP Key ID 0x650F4534  |
| "You better be great...brilliant!" - Riker                              |

--- End Message ---
--- Begin Message ---
Erm, it might be easier to use $_REQUEST rather than
determining _POST and _GET (and possibly running
into prob's later if the form submission METHOD changes)

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Dash McElroy" <[EMAIL PROTECTED]> wrote in message
ABA3F1F1A223D411BE6C006008A6F7E26043FE@MSX1-PTON">news:ABA3F1F1A223D411BE6C006008A6F7E26043FE@MSX1-PTON...
> Toby,
>
> You may have some fun in this undertaking. If most of your variables are of
> one type (i.e. POST, or GET) then your transition should be relatively easy.
> You can't just do a mass replace though, as variables you set in the script
> won't work if you make them $_POST['varname']. It gets a bit messier with
> cookies and other stuff.
>
> You may want to take a look at the user's comments on this page:
>
> http://www.php.net/manual/en/security.registerglobals.php
>
> There are some neat ideas on how to import variables easily and nice.
>
> It's probably easier, from now on, to use the _GET, _POST, _ETC methods :)
>
> Good luck!
>
> -Dash
>
> -----Original Message-----
> From: toby z [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 07, 2002 10:53 PM
> To: php hlp list
> Subject: Re: [PHP-WIN] playing with register globals ....
>
>
>  & nother thing
>
> i have to allow users to upload their files on MY
> server ... :s
>
>
> > plz pardon my ignorence
> >
> > i ve been working with php for the last 3 and a 1/2
> > months and i turned my register globals ON when i
> > started off initially knowing im risking security
> >
> > now i have to upload the site and i simply cannot
> > risk
> > security anymore
> >
> > what shall i do ????
> >
> > if i turn register globals OFF i guess ill have to
> > change all my variables in ALLLLL the pages i ve
> > made
> > or will i ????
> > and the count of the variables .... allah alone
> > knows
> >
> > help me plz
> >
> > id appriciate any help on this
> >
> > thnx a million ....
> >
> > stuck as usual
> > toby .....
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Sign up for SBC Yahoo! Dial - First Month Free
> > http://sbc.yahoo.com
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Have you been making sure that the COM app. actually
finishes and cleans up properly on the server
(i.e. CTL+ALT+DEL process list doesn't show it)?

I was playing with Excel+COM with PHP 4.2.0 and
there was a bug with the COM implementation and the
Excel instance would never terminate.... so after a few
minutes, there'd be so many open Excel instances that
the computer would really slow down.

I'd imagine that on a server, the problem would be
magnified.

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Ross Fleming" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi again
>
> I'm trying a bit of COM programming in PHP but can't for the life of me
> figure out what's wrong.  I've tried both Winamp (have winampCOM installed)
> and MS Word and it just seems to stall the server whenever I view a page
> with it.  Can anyone explain why or is there a setting in php.ini I have to
> play with? (I've looked but can't find anything)
>
> It seems to work from the command line, but not through a browser.
>
> Config:
> Win XP Pro (administator)
> Apache 1.3.26
> PHP 4.2.1
>
> Ross
>


--- End Message ---
--- Begin Message ---
What user is your Server running as?

For me, when i setup apache on my Win2k machine, i
had to "RunAs" my personal "scott" account, rather than
the system account, or else apache wouldn't be able to
read certain "scott-only" files.... perhaps the user that
apache is running as doesn't have permission to do
COM stuff.... but i really don't know for sure.

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Olivier Hubert" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hiya,
>
> Just wondering if anyone else is having this problem. I am trying to
> control Winamp through HTTP using the WinampCOM plugin. It works fine when
> I call the script from the command line but not at all when the exact same
> script runs through HTTP (using Apache). Here is a bit of the code I use:
>
>          $Winamp = new COM("WinampCOM.Application") or die('Could not
> instanciate the WinampCOM object');
>
>          if (isset($Winamp))
>                  echo 'Test: ' . $Winamp->CurrentSongFileName();
>
>          else
>                  echo 'Not working';
>
> Now, through the command line I see 'Test: ' followed by the current song's
> name but on the web page I see only 'Test: '. Anyone ever experienced this?
> Any help appreciated. For those who wonder, WinampCOM is available at:
> http://www.adcock8.freeserve.co.uk/winamp.htm.
>
> Thanks,
>
> Olivier
>


--- End Message ---
--- Begin Message ---
I assure you, it's not magic, and it doesn't stop working
"without reason" - there's always a reason with computers :)

Could you please send a code snippet so we can
see exactly what you're doing?

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Tomator" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Generally I don't believe in magic, but...
>
> I tried to use 'session' machanism. So I typed "session_start()" and so on,
> configured path to store session info. Surely before sending any headers. I
> defined variable "level", accesed by $_SESSION["level"]. Sesion files were
> being created in correct directory, but files had zero length and mentioned
> variable was not changing... was not even set.
>
> Register_globals was ON, everything should work. But didn't.
> Turning off register_globals didn't change anything.
>
> I have added "counter" - just example from php manual. Initially nothing
> happened until I changed acces mode to counter from $_SESSION["counter"] to
> $HTTP_SESSION_VAR["counter"]. "Counter" was still unaffected and
> unaccesible, but "level" (still accesed by $_SESSION["level"]) was!
>
>  I'd love to know WHY. I'm afraid it can stop working "without" reason, just
> as started. Could anybody explain me what's going on?
>
>


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

I'dd like to know if anyone knows how to connect to the SQL engine behind 
Windows 2000/XP's file Indexing service and if you know how to read file 
properties (ie, metadata, size, date, etc...).

It would be quite cool because I would not have to build an index of files 
and a database of these already recorded property.

Thank You
Malartre

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--- End Message ---
--- Begin Message ---
Hi There,
I am trying to incorporate zipping and unzipping files on a windows 
platform via PHP. I came across ZZiplib but wasnt able to find any 
information with regard to windows installation. Is there anyone who has 
tried something similar ?
If yes, could you give me installation details and if possible a DLL which 
works on the windows platform.
thanks in advance,
Mathew

--- End Message ---
--- Begin Message ---
hi guyz 

im trying to save user uploaded files each with a
unique name 
now .... 

1. for some strange reason this piece of code aint
working :S 

if
(is_uploaded_file($HTTP_POST_FILES['$userfile']['$name']))
{ 
   copy($HTTP_POST_FILES['$userfile']['$name'],"c:/tmp
uploadz/"); 
} else { 
   echo "Possible file upload attack. Filename: " . 
$HTTP_POST_FILES['$userfile']['$name']; 
} 



neither does this : 

move_uploaded_file($HTTP_POST_FILES['$userfile']['$name'],
"c:/tmp 
uploadz/"); 



i get a msg: 
file submitted .NeedsUPDATED.doc. file sixe .23552.
file type 
.application/msword. Possible file upload attack.
Filename: 

and nothing gets saved on disk 


2. while this works fine 

$name =
$firstName.$lastName.$title.$cat.$lang.$unique_id; 

if (copy($userfile, "c:/tmp uploadz/" .
$unique_id."-".$name)) 

echo("<b> file successfully uploaded </b>"); 

else //(!$userfile_size) 
echo( "Either you did not upload any file, or you
uploaded an empty 
file! "); 


whats with the first code ???? 

3. i want the file to be save as $name but it doesnt
do dat 
it either saves the file as its original name or it
saves it as a horrid timestamp OR worse even ....as
1026114031-$firstName
while its supposed to take the $firstName from the
previous form
:(

4. the most horribale thing 
1026114031-NeedsUPDATED.doc
this is the horrid time stamp i get fo my file name 
whats wrong with it .... i cant make anything outta it


where m i messing up now .... 


id really appriciate any help with this 

thnx a million 

stuck as usual .... :s

toby ...... 



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--- End Message ---
--- Begin Message ---
hi there,
     does any one have copies of XMlparser.dll and xmltok.dll. these files 
seem to be missing on my comp. could someone send it across.
thanks,
Mathew

--- End Message ---
--- Begin Message ---
Hi there,
   I have been trying for the past hour to try and get the XSL installation 
correct in PHP(windows). inspite of the file being there in the extensions 
dir, Apache gives me an error saying php_xslt.dll not found. What could be 
the problem. The path is correct because PHP is able to find other dlls 
from that extension directory.
Thanks in advance,
Mathew

--- End Message ---
--- Begin Message ---
Does anyone on this list know how to send a file automatically to a site
user after viewing an HTML page, such as is done at download.com?

I can re-direct to the file using an HTTP directive in the page but was
wondering if there was anyway to do this within one page?

regards,

Mikey

--- End Message ---

Reply via email to