php-windows Digest 4 Jan 2005 20:29:24 -0000 Issue 2522

Topics (messages 25220 through 25226):

Re: any scripts to manage APACHE's HTPASSWD/AUTH file?
        25220 by: Irvin Piraman

Re: PHP cgi
        25221 by: Luis Moreira

Re: Searching for UPS tool
        25222 by: Jason Barnett
        25223 by: Jason Barnett
        25224 by: Tony Devlin
        25225 by: Jason Barnett

Making includes easy.... Am I a 'tard?
        25226 by: Leif Gregory

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 ---
just feed the appropriate parameters to htpasswd through shell
execution. there are a number of functions to do this:

htpasswd -b[cmdpsD] passwordfile username password

HTH

Irvin


On Mon, 03 Jan 2005 20:48:27 -0800, Leo G. Divinagracia III
<[EMAIL PROTECTED]> wrote:
> i guess i'd asked first before reinventing the wheel...  lol
> 
> running xp with apache 2.x and i am looking for a script to manage users
> using apache's http authentication.  you know, apache's HTPASSWD util?
> 
> would like an admin screen and then user screens...
> 
> is that asking too much?   ;)
> 
> searched in PEAR...nothing.  googling comes up close but i maybe using
> wrong terms...
> 
> thanks...
> 
> --
> Leo G. Divinagracia III
> [EMAIL PROTECTED]
> 
> zzzzz
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message --- If you don't have errors, then probably PHP is starting but there is some other problem.
My HTTPD.CONF is as follows, and it runs fine.


Luis



#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
# ScriptAlias /cgi-bin/ "d:/program files/Apache Group/Apache/cgi-bin/"
ScriptAlias /php/ "c:/php/"
ScriptAlias /php/ "d:/myweb/scripts_php/"
ScriptAlias /php/ "d:/Songahm_management/"


#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps


#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action application/x-httpd-php /php/php.exe



blulagoon wrote:

I've looked in the apache error.log file, but there are no entries logged there 
when apache fails to start.

I think you could make the case either way as to which group is more relevant 
here, PHP or Apache.

That's what I meant

However I'm sure there
are lots of people here who use PHP with Apache running under Windows,


Me, for one

and hopefully some of them will have switched between
cgi and module mode and be able to tell me what I'm doing wrong.


That, I didn't do.

Apologies to IIS users to whom this thread is of no interest.

Luis Moreira wrote:



This is a PHP list, and there is an Apache one were this problem fits
better.
Go to www.apache.org and subscribe it.
Meanwhile, do you have an error log to look at ?
What does it say ?

Luis

blulagoon wrote:



Thanks Dean. I've commented out the lines that say:

Action application/x-httpd-php /php/php.exe
ScriptAlias /php/ "C:/php/"

which I think are involved with cgi, but I don't know enough about the 
configuration files to know what else it uses,
but with those lines '#' out, the two new lines added and all my addtype lines 
together, again Apache refuses to start.
Do you have any idea if any other lines need to be disabled, the two above are 
the only ones mentioned in the
install.txt file

Thanks again for your help.

Dean Hayes wrote:





Yes remove all the lines that relate to running PHP as a CGI u can not run
both at the same time

Sorry forgot to say this before did not think about it

Dean "The Insane Guy" Hayes

<-- I design and i redesign but still i never designed true beauty like you
-->

~~~ Call me Insane call me Crazy but there is one thing i know i am That is
someone that shall reach peoples hearts with words ~~~

~~ PHP seems easy enough but what about this ASP now that looks hard ~~












--- End Message ---
--- Begin Message --- Didn't you already search their site and find the answer? It is *very* infuriating when people refuse to help themselves! Because I can guarantee that if you search the UPS site you will find the answer.

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message --- Ah, you were just asking for a scipt. In that case I send you my apologies my good sir. This works for PHP 4.3

http://www.phpscriptsearch.com/0/PHP-XML-and-PHP/UPS-XML-Shipping-Tool-PHP-Function-Library.html

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message ---
Thanks for the ignorant reply.

        I'll assume that you hastidely read the email and didn't see the part 
where
I said "I have searched".  They have Jscript examples, but I can't decipher
that spanglish.  Their documentation, although very bloated, gives no real
answers to anyof my needed questions.  My particular problem is the XML
interface using PHP, and yes I've scoured and read the PHP manual on XML.
Is it so hard to think someone did search before asking?  I've scanned over
300 googled websites for answers to this problem and have found none.  All
that I have found were outdated examples.

Good day to you, Sir
Tony

-----Original Message-----
From: Jason Barnett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 04, 2005 9:11 AM
To: [email protected]
Subject: [PHP-WIN] Re: Searching for UPS tool


Didn't you already search their site and find the answer?  It is *very*
infuriating when people refuse to help themselves!  Because I can
guarantee that if you search the UPS site you will find the answer.

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

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

--- End Message ---
--- Begin Message --- Yes, I did reply without carefully reading the message. See my second response to the thread for a PHP script that does as you ask.

--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

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

  
Here's the situation. I have a site where each php page contains the
"header" (top bar), "navigator" (left-side bar), the "footer" (bottom
bar), and the css file. Each of those four files are in a folder
called includes in the site root folder (sorry if the terminology is
incorrect).

So, on a webserver hosting numerous virtual sites, I have something
like this:


Apache
  htdocs
    site1
      includes
        (those four files)
    site2
      includes
        (those four files)
    etc...

Apache is set up so that when you hit http://site1 it brings up the
index page in the site1 folder, and for http://site2 you get the index
page in the site2 folder.

So for the purpose of this question, I'm going to call each of those
the site root folder for that particular site.

Now, those four files are different for site1 and site2 in terms of
different buttons used etc., so they aren't the same in terms of being
able to use the exact same four files for both sites.

The problem I have is that when including these files, I don't want to
have to mess with actually putting the correct number of "../" before
"includes/top.php" as well as the other three files I want to include
on each page. It's not really a hassle, so to speak, until you do
something like move an entire subfolder of pages (which might contain
more subfolders of pages) into another location. Then you have to go
back and fix the number of "../" for each page that was affected.

The include function either wants the relative path "../" or it wants
the URL. It's just a personal hangup of mine to not hardcode things in
like that (yes I use a config.php file for stuff like that). If that's
not good enough, the other reason is that there is a production server
and development server for these two sites which have different URLs,
so you'd have to fix all the URLs to work on the production server
once you were done.

I read through php.net on things like dirname(), realpath(),
pathinfo(). include(), require(), etc... But I couldn't find a
"dynamic" way of doing it.

So, I decided to write my own which I'll show here, but my question is
whether or not there is an easier way. As it stands now, I have to put
that function on every page, which is ok because I only have to do it
once, but it seems extremely redundant.

Well, here it is.


****************

function dynRoot()
{
  $levels = substr_count($_SERVER['PHP_SELF'],"/");

  for ($i=0; $i < $levels - 1; $i++)
  {
    $relativeDir .= "../";
  }
  
  return $relativeDir;
}

****************


Which then allows me to do the below:


****************

<HEAD>
  <link rel="stylesheet" type="text/css" href="<? echo 
dynRoot();?>includes/site.css"/>
</HEAD>


<?php include(dynRoot() . 'includes/footer.php');?>

****************


Yes, I know I don't have to do that for the css up there, but I was
playing around with it and just wanted to show it worked there too.


So far, I haven't run into any issues regardless of how deep the page
is buried in subfolders.


The question is.... Is there a better way.


Thanks for any help.



Tagline of the day:
The trouble with being punctual
is that nobody's there to appreciate it.




-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.2.3 Rush under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

--- End Message ---

Reply via email to