php-windows Digest 7 Aug 2001 23:52:08 -0000 Issue 690

Topics (messages 8695 through 8707):

Re: Seconds retrieving
        8695 by: Hugh Bothwell

Re: Problem
        8696 by: Martin Kemp

Re: Problem with session data on PHP4/Win2k
        8697 by: Holm Puder
        8706 by: Scott Piccotti

Re: I need some help or a .45 magnum
        8698 by: elias

Re: can anyone explain this code segment?
        8699 by: elias

includes
        8700 by: William E. T.
        8702 by: Angie Tollerson
        8703 by: William E. T.
        8705 by: Angie Tollerson
        8707 by: Ignatius Teo

Re: Make  file.php   look like   file.htm  ???
        8701 by: Rick S
        8704 by: Mike Flynn

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]


----------------------------------------------------------------------



"Ventsyslav Vassilev" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi, is there any function, which returns the number of seconds between
> 01.01.1970 and a GIVEN date - similar to UNIX_TIMESTAMP in mySQL?
> time() works, but counts from current time only...

Either mktime() or strtotime() depending on what you're working from...






The biggest thing you need to consider here is that you're using *
interchangably as a character to look for, and also as a wildcard operator:

.* is a combination; the . means any character and the * means 0 or more
occurrences of it. Therefore a.*a would match azzzzza, but also aa.
Similarly + means match 1 or more occurrences. Another thing to bear in mind
is that * is what's known as hungry, so <.*> will pull out <test><here> from
<test><here> and not just <test> as you might expect.

You're also looking for <*tr*>, so you're looking for things like <<<trrrr>,
the way to get around this is to put the * in square brackets: [*] or escape
it (usually using a backslash). Square brackets means 'any of the characters
in the brackets', so

[aeiou*]* will match a*aaa, aei, uo, but not abc.

any clearer?

I've found that one of the better RE help files was the one that came with
Textpad (go edit->find and click help), but the man pages for grep aren't
bad, either.

cheers,

martin kemp



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 07 August 2001 7:52
> To: [EMAIL PROTECTED]
> Subject: Problem
>
>
> Ok, first, I want to ask what mailing list should I mail for a scripting
> question?  Ive been on this list for about 6 months now, And i
> dont recall
> seeing to many script questions.
>
> 2nd, Im having a problem with the eregi command again (if you remember my
> e-mail from yesterday).  Heres the problem, I can find a match for what I
> want, but it wont get the rest of the lines if theres a return in
> them, such
> as the following:
> (commands have * inside of the brackets for people with HTML
> mail, such as
> myself)
>
> <*tr*><*td*>1) Name here<*/td*>
> <*td align=right*>Results Here<*/td*>
> <*td align=right*>Result Time Here<*/td*>
> <*td align=right*>Average Time Here<*/td><*/tr*>
>
> If i use just the <*tr*><*td*>1) (.*)to search for, it will just
> return the
> Name Here part,
> If I use <*td*><*td*>1)(.*)<*/td*><*/tr*> to search for it, it
> wont return
> anything?  If anyone has any ideas, or can pont me in the right
> direction, I
> would appreciate it.
>
> ~Jeff
>





Check if the IUSER_<....... > has write access


Holm

>I'm using PHP4.0.6 on Win2k with IIS 5.0. I've already checked the
>permissions on c:\php\sessiondata, and everything should be ok. The script
>has the same problem on my web host's server. It does *not* have this
>problem on my desktop machine (MacOS X/Apache/PHP4.0.6).
>







Thank you for your reply. Yes, IUSR_ has read and write access.
Is there anything else in Active Directory that I should be looking for? My 
ISP and I are still both stumped about this one.

Thanks again-
scott


On Tuesday, August 7, 2001, at 10:10  AM, Holm Puder wrote:
 >Check if the IUSER_<....... > has write access
 >
 >Holm
 >
 >>I'm using PHP4.0.6 on Win2k with IIS 5.0. I've already checked the
 >>permissions on c:\php\sessiondata, and everything should be ok. The script
 >>has the same problem on my web host's server. It does *not* have this
 >>problem on my desktop machine (MacOS X/Apache/PHP4.0.6).





Are you sure you didn't forgot the uncomment this line in PHP.INI ? :
[mail function]
; For Win32 only.
SMTP = mailserver.com ; specify here your SMTP server

"Rodney" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I'm new to php. I'm having trouble making the mail function work.
> I wrote a simple mail script that supports mail delivery when a user
> fills out a form. It's not working.
>
> The editor tells me this is the problem:
>
>      mail("[EMAIL PROTECTED]", "Feedback", $msg, $mailheaders);
>
> However I don't see it.
>
> Here is the complete script:
>
> <?php_tracking_vars?>
> <?php
>  $msg = "Sender's Full Name:\t$sendor_name\n";
>  $msg .= "Sender's Email:\t$sender_email\n";
>  $msg .= "Did you like this site?\t$like_site\n";
>  $msg .= "Additional Message:\t$message\n\n";
>
>  $mailheaders = "From: My Web Site\n;
>  $mailheaders .= "Reply-To: $sender_email\n\n";
>
> if (($sender_email == "") || ($message == "")) {
>    header(location: http://127.0.0.1/show.feedback.html";);
>    exit;
> }
>  mail("[EMAIL PROTECTED]", "Feedback", $msg, $mailheaders);
>
>  echo "<H1 align=center>Thank you.$sender_name</H1>";
>  echo "<P align=center>We dig you feedback.</P>";
>
> ?>
>
>
> I am stuck like chuck on this one. Any help is appreciated.
>
> rw
>
>






I agree with you.

I think the first statment alone is enough.

"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Apologies for posting to php.windows with a
> non-windows-specific question, but I haven't
> been receiving php.general for several weeks
> now; I assume it went mailing-list-only to lower
> the load on the news server??
>
>
> I've been poking through source to a message-board script,
> and came across some code I don't quite understand;
>
>     ...
>     $text=ereg_replace("<[^>]*>", "", $text);
>     $text=ereg_replace("^<[^>]*>", "", $text);
>     $text=ereg_replace("<[^>]*>$", "", $text);
>     echo $text;
>     ...
>
> in context, they are trying to strip any html and/or scripty stuff out
> of the body of a message before outputting it.
>
> The first statement removes '<anything in brackets>',
> the second replaces anything in brackets starting at
> the beginning of a line...
>
> Q.  Isn't that redundant?  Shouldn't the first statement
> have removed all the bracket-pairs?  In which case,
> this statement will never find a set of brackets and
> thus does nothing at all?!
>
> .. and the third removes anything in brackets
> followed by a dollars-sign...
>
> Q.  Even more redundant!? There should be no
> bracketed stuff left by now!
>
>
> Can anyone figure out the logic behind this??
>
>






I'm running apache on win98 as a test platform for a site, but whenever
I do includes it says it can't read the file.  I know the file is there,
as apache lists it in the director listing.
The exact error I get is
Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
c:\program files\apache group\apache\htdocs\site\index.php on line 45


The syntax I used to call the include is
include("main.inc");

This worked on the  REAL server I'm using, so I was wondering why it
won't work locally.
Thanks
William





try include("./main.inc");


>>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 12:41PM >>>
I'm running apache on win98 as a test platform for a site, but whenever
I do includes it says it can't read the file.  I know the file is there,
as apache lists it in the director listing.
The exact error I get is
Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
c:\program files\apache group\apache\htdocs\site\index.php on line 45


The syntax I used to call the include is
include("main.inc");

This worked on the  REAL server I'm using, so I was wondering why it
won't work locally.
Thanks
William


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
To contact the list administrators, e-mail: [EMAIL PROTECTED] 






THat works.  Thanks.  I was clueless as to why it wouldn't work.  Could you
explain why the ./ is necessary? I'm still a newbie, and I'm just curious so
that I don't repeat the same mistake in other areas.
Thanks
William


Angie Tollerson wrote:

> try include("./main.inc");
>
> >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 12:41PM >>>
> I'm running apache on win98 as a test platform for a site, but whenever
> I do includes it says it can't read the file.  I know the file is there,
> as apache lists it in the director listing.
> The exact error I get is
> Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
> c:\program files\apache group\apache\htdocs\site\index.php on line 45
>
> The syntax I used to call the include is
> include("main.inc");
>
> This worked on the  REAL server I'm using, so I was wondering why it
> won't work locally.
> Thanks
> William
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





I noticed that is necessary only on Apache...IIS you don't need it.  That might have 
been why you didn't know if you are using windows and had been developing using IIS 
before.  To add a new question to this thread:
Has anyone else been able to get includes to work from the top of the web?  For some 
reason..if I want to move around directories (i'm using windows 2000 and 4.0.5) I have 
to do this: 
include("../../phpfile");
when I want to do this:
include("/admin/folder/phpfile");

any ideas?

Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]

>>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 01:52PM >>>
THat works.  Thanks.  I was clueless as to why it wouldn't work.  Could you
explain why the ./ is necessary? I'm still a newbie, and I'm just curious so
that I don't repeat the same mistake in other areas.
Thanks
William


Angie Tollerson wrote:

> try include("./main.inc");
>
> >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 12:41PM >>>
> I'm running apache on win98 as a test platform for a site, but whenever
> I do includes it says it can't read the file.  I know the file is there,
> as apache lists it in the director listing.
> The exact error I get is
> Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
> c:\program files\apache group\apache\htdocs\site\index.php on line 45
>
> The syntax I used to call the include is
> include("main.inc");
>
> This worked on the  REAL server I'm using, so I was wondering why it
> won't work locally.
> Thanks
> William
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> To contact the list administrators, e-mail: [EMAIL PROTECTED] 


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 
To contact the list administrators, e-mail: [EMAIL PROTECTED] 






What happens when you move stuff up or down a directory level?

I normally do this:

config.php
----------
define('BASE_DIR',getenv('DOCUMENT_ROOT').'/somedir/');

main.php
--------
include('config.php');
include(BASE_DIR.'phpfile.php');
include(BASE_DIR.'someother_dir/phpfile.php');

YMMV,

Ignatius

----- Original Message -----
From: "Angie Tollerson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 08, 2001 7:07 AM
Subject: Re: [PHP-WIN] includes


> I noticed that is necessary only on Apache...IIS you don't need it.  That
might have been why you didn't know if you are using windows and had been
developing using IIS before.  To add a new question to this thread:
> Has anyone else been able to get includes to work from the top of the web?
For some reason..if I want to move around directories (i'm using windows
2000 and 4.0.5) I have to do this:
> include("../../phpfile");
> when I want to do this:
> include("/admin/folder/phpfile");
>
> any ideas?
>
> Angie Tollerson
> Alliance Technologies
> Web Programmer
> (515)245-7628
> [EMAIL PROTECTED]
>
> >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 01:52PM >>>
> THat works.  Thanks.  I was clueless as to why it wouldn't work.  Could
you
> explain why the ./ is necessary? I'm still a newbie, and I'm just curious
so
> that I don't repeat the same mistake in other areas.
> Thanks
> William
>
>
> Angie Tollerson wrote:
>
> > try include("./main.inc");
> >
> > >>> "William E. T." <[EMAIL PROTECTED]> 08/07/01 12:41PM >>>
> > I'm running apache on win98 as a test platform for a site, but whenever
> > I do includes it says it can't read the file.  I know the file is there,
> > as apache lists it in the director listing.
> > The exact error I get is
> > Warning: Failed opening 'main.inc' for inclusion (include_path='..') in
> > c:\program files\apache group\apache\htdocs\site\index.php on line 45
> >
> > The syntax I used to call the include is
> > include("main.inc");
> >
> > This worked on the  REAL server I'm using, so I was wondering why it
> > won't work locally.
> > Thanks
> > William
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hello,

I was interested in producing a link that looked like www.index.htm instead
of www.index.php this would hide the use of dynamic HTML.  My goal is to
enhance security.  Your insight on this is appreciated.

Thanks,
Rick S.


"Alain Samoun" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It's always transparent for the 'average user' since that you mainly send
> him HTML code anyway... For the ones who look carefully at your address
> extension, it should not bother them to see .php as you see it more
> and more in URLs (close to 7 millions at the last count I believe).
> Anyway, I know how to change a php extension for Apache in the httpd.conf,
> but I believe that if you use html, then all your html will be parsed by
> php... Is that what you want?
> Alain
>
> On Thu, Jul 26, 2001 at 01:21:23AM -0400, Rick S wrote:
> > Hello,
> > Anyone know how to make the URL look like a basic HTML link?  I would
like
> > PHP to be transparent to the user and not displaying the .php extention
in
> > the browser's address window.  Is there a way to do this?
> >
> > Thanks,
> > Rick S.
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]






Hi,

1. This is dependent on your server software.  If you configure .htm or 
.html files or whatever to execute PHP the way you have .php configured, 
then all files ending in .htm or whatnot will be executed the same as .php.

2. I hope you don't expect too many private replies when you put your 
return e-mail address for the listserv as "[EMAIL PROTECTED]".

-Mike

At 03:26 PM 8/7/01 -0400, Rick S wrote:
>Hello,
>
>I was interested in producing a link that looked like www.index.htm instead
>of www.index.php this would hide the use of dynamic HTML.  My goal is to
>enhance security.  Your insight on this is appreciated.
>
>Thanks,
>Rick S.




Reply via email to