php-windows Digest 21 Jan 2002 05:00:38 -0000 Issue 962

Topics (messages 11527 through 11535):

Re: Redirection Question.
        11527 by: Symeon Charalabides

Re: Is ISAPI stable ?
        11528 by: John Lim

$PHP_SELF
        11529 by: Aasmund Sæter
        11530 by: Rasmus Lerdorf
        11533 by: Rubén Gutiérrez

wildcards
        11531 by: Symeon Charalabides

Re: New To PHP need help with mail
        11532 by: Rubén Gutiérrez

Re: Help with regex
        11534 by: John Moeller

Imap_Open
        11535 by: Neil H.

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 ---
> A lot of people have trouble with sending the Location header. A more 
> effective means is sending this:
> 
> header("Refresh: 1;url=/path/to/myinfo.php");
> 
> I believe that's right. I haven't done it in awhile...
> 
Like the HTML header, you can even turn 1 into 0 and get redirected straight 
away.
> >
> >Here is where the code is failing.
> >
> >if ($myrow = mysql_fetch_array($result)) {
> >//if there is a row in the database then the user
> >//must have submitted the username and matching password
> >
> >session_start();
> >session_register($username);
> >header ("Location: ./myinfo.php"); //THIS IS NOT WORKING!!!!!

The usual problem is that headers have already been sent, i.e. if there's even a 
single blank before your "<?php" tag. If that were the case, you'd get the 
message 'headers already sent ' or something. I'm not too sure about the './' 
part, either: I always go straight for the filename if it's in the same directory, 
and it's never failed me yet.
That's all the help I can give, I'm afraid...

Symeon Charalabides (cosmopolitan trainee)
------------------------------------------
http://www.webmate.gr

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

I have found that there are bugs in the isapi version when
you have errors in your PHP code. PHP 4.1.1 does not clean
 up properly at times and eventually will crash.

If your PHP code has no errors you might find ISAPI to be
reliable. I run test suites for the ADODB library with
deliberate scripting errors to test ADODB error handling -
these always crash the ISAPI module after a few reruns.

I have reported to bugs.php.net. So far no fix.

Regards, John

Alain Sayez <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I think there is no trouble with ISAPI Module.
>
> I use it with PHP 4.1.0 since the launch of this version.
>
> Alain
> "Ertan Tike" <[EMAIL PROTECTED]> wrote in message
> EFD455694497D21187A10004ACB81BE4041075C1@INTSERVER">news:EFD455694497D21187A10004ACB81BE4041075C1@INTSERVER...
> > no, cause i have live some problems (random) with isapi mod. (memory
> leaks,
> > cpu times.. exceptions.. etc.)
> > but i think this is problem of IIS.
> > some times you have to use module version of php..
> >
> > -----Original Message-----
> > From: Steen Rabol [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 18, 2002 3:21 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] Is ISAPI stable ?
> >
> >
> > Hi
> >
> > According to the install.txt of php, the ISAPI version is not stable,
> > but.... that statement have been there for about 1 year, so my question
> is:
> > Is ISAPI version considered stable ?
> >
> > Thanks in advance.
> >
> > Best
> > Steen
> >
> >
>
>


--- End Message ---
--- Begin Message ---
I have been trying to get $PHP_SELF to display the filename, but I only get
"Warning: Undefined variable: PHP_SELF ". Isn't this a supposed to a
predefined variable?

I got Windows XP, Apache 1.3.12 and PHP 4.1.0. I use PHP as a Apache module.
Shouldn't it work then? I read on www.php.net that PHP_SELF wouldn't work if
PHP is running as a command-line processor (CGI verion of PHP?).

Please help me, I have been looking everywhere for an answer. I got scripts
(not made by me) which uses this variable.


--- End Message ---
--- Begin Message ---
Are you inside a function when you do this?  If so, make sure you use
global $PHP_SELF;
at the top of the function.

-Rasmus

On Sun, 20 Jan 2002, Aasmund Sæter wrote:

> I have been trying to get $PHP_SELF to display the filename, but I only get
> "Warning: Undefined variable: PHP_SELF ". Isn't this a supposed to a
> predefined variable?
>
> I got Windows XP, Apache 1.3.12 and PHP 4.1.0. I use PHP as a Apache module.
> Shouldn't it work then? I read on www.php.net that PHP_SELF wouldn't work if
> PHP is running as a command-line processor (CGI verion of PHP?).
>
> Please help me, I have been looking everywhere for an answer. I got scripts
> (not made by me) which uses this variable.
>
>
>
> --
> 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]
>

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

On Sun, 20 Jan 2002 16:03:13 +0100
"Aasmund Sæter" <[EMAIL PROTECTED]> wrote:

> I have been trying to get $PHP_SELF to display the filename, but I only get
> "Warning: Undefined variable: PHP_SELF ". Isn't this a supposed to a
> predefined variable?
> 
> I got Windows XP, Apache 1.3.12 and PHP 4.1.0. I use PHP as a Apache module.
> Shouldn't it work then? I read on www.php.net that PHP_SELF wouldn't work if
> PHP is running as a command-line processor (CGI verion of PHP?).
> 
> Please help me, I have been looking everywhere for an answer. I got scripts
> (not made by me) which uses this variable.

Try using $HTTP_SERVER_VARS["PHP_SELF"] instead.

Rubén Gutiérrez

--- End Message ---
--- Begin Message ---
I must be missing something here...
I've got these 3 lines of code:

if (file_exists('dir/'.$filename.'.gif'))                                              
 
        unlink('dir/'.$filename.'.gif');
if (file_exists('dir/'.$filename.'.jpg'))                                       
                unlink('dir/'.$filename.'.jpg');
if (file_exists('dir/'.$filename.'.png'))                                       
                unlink('dir/'.$filename.'.png');

...and I'm sure they can be turned into one using some kind of wildcard, only I 
can't figure out how. In fact, I don't mind erasing files of a certain filename 
with ANY extension at all. I just know, in this case, that it can only be one of 
those three.
Any advice, people?
Symeon Charalabides (cosmopolitan trainee)
------------------------------------------
http://www.webmate.gr

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

On Sun, 20 Jan 2002 15:40:23 -0000
"Ross Fleming" <[EMAIL PROTECTED]> wrote:

> Asuuming you have PHP setup already, edit your PHP.ini file.  Change your
> mail settings in it to:
> [mail function]
> ; For Win32 only.
> SMTP= mail.mysmtpserver.com ; for Win32 only
> 
> ; For Win32 only.
> sendmail_from= [EMAIL PROTECTED] ; for Win32 only
> 
> and save it.
> 

One more thing: don't forget to restart your server for changes in
php.ini to take effect.

Rubén Gutiérrez

--- End Message ---
--- Begin Message ---
Michael,

First off, you can eliminate the right-left stuff with the regex.  Use:

ereg("%ial\(([^[:blank:]]{1,},[0-9]{1,})\)",$text,$temp)

Adding the parentheses around your function arguments lets you reference
your "string,num" pattern directly with $temp[1].  For that matter, just
use:

ereg("%ial\([:blank:]*([^[:blank:])]+)[:blank:]*,[:blank:]*([^[:blank:])]+)[
:blank:]*\)",$text,$temp)

This may look ugly, but it allows you to reference each argument using
$temp[1] and $temp[2], without exploding or whatever.  Then, just verify
$temp[2] with is_numeric($temp[2]), and cast it to the type you want (e.g.
(integer) $temp[2]).

The [^[:blank:])]+ grabs one or more non-blank, non-right-paren characters.
The exclusion of right-paren prevents it from trying to match the closing
paren in your function.  The [:blank:]* allows for some whitespace padding,
without adding to what you're actually looking for.

So you'd have:

while
(ereg("%ial\([:blank:]*([^[:blank:])]+)[:blank:]*,[:blank:]*([^[:blank:])]+)
[:blank:]*\)",$text,$temp))
{
if (is_numeric($temp[2]))
    $num = (integer) $temp[2];
else
    continue;
$text = str_replace($temp[0],ial_search($temp[1],$num),$text);
}

It's important to note that doing things this way, you cannot have _any_
right parentheses in the arguments of %ial.  You could add pieces to your
regex to match more parens, but there is actually no way to do arbitrary
nesting in regex.  You need a parser for that.

John

"Michael Reynolds" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have something in php, which goes through a line of
> text, replacing all occurences of %longip($a) with the
> long2ip/ip2long of whatever's in the perentheses.  I
> tried something similar with %ial($a,$b), to call
> ial_search($a,$b) and replace the %ial() with the
> result.  I have it so the longip can be stacked:
>   %longip(%longip(%longip($a)))
> and it would call the proper function(s) 3 times.  I'm
> trying to get it to do the same with %ial.  The %ial
> takes a string as the first arg, and a number as the
> second.  If the second is 0, it returns a number.
> What I have so far is:
>
> while
> (ereg("%ial\([^[:blank:]]{1,},[0-9]{1,}\)",$text,$temp))
> { $ialsearch =
> explode(",",right(left($temp['0'],-1),-5)); $text =
> str_replace($temp['0'],ial_search($ialsearch['0'],$ialsearch['1']),$text);
> }
>
> Any help will be greatly appreciated.
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/


--- End Message ---
--- Begin Message ---
How can I add Imap support on PHP 4 (latest build) on windows 2000?

Thanks,

Neil

--- End Message ---

Reply via email to