php-windows Digest 16 Feb 2004 00:39:01 -0000 Issue 2123
Topics (messages 22815 through 22825):
test
22815 by: ritter
Re: Apache 1.3.29 crashes with PHP-extensions added
22816 by: Svensson, B.A.T. (HKG)
22817 by: Torsten Schabdach
22820 by: Svensson, B.A.T. (HKG)
test post
22818 by: ritter
isset() question
22819 by: ritter
22821 by: Svensson, B.A.T. (HKG)
22822 by: Svensson, B.A.T. (HKG)
22823 by: ritter
22824 by: Svensson, B.A.T. (HKG)
22825 by: Meteorlet
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 ---
test
--- End Message ---
--- Begin Message ---
> It doesnt seem to matter, which extension I uncomment.
This sounds like a problem with apache it self(?).
--- End Message ---
--- Begin Message ---
This sounds like a problem with apache it self(?).
I thought this first too. The problem was solved by getting a new snap
(and the great help of Cyruss).
*AND*:
I always put the php4ts.dll near the sapi/php4apache.dll as stated as a
possibility in the install.txt. But this doesn't seem to work anymore in
PHP5. I moved it to the Apache-Dir and everything works fine.
--
Torsten
--- End Message ---
--- Begin Message ---
>> This sounds like a problem with apache it self(?).
[...]
> I moved it to the Apache-Dir and everything works fine.
So it was an apache related problem(?).
--- End Message ---
--- Begin Message ---
test
--- End Message ---
--- Begin Message ---
The following script is from Kevin Yank's book (Sitepoint).
When I test it _without_ entering a name in the text box and hit submit, the
_next_ page
loads - however the same page should load beacuse of the conditional
........
if (!isset($name) ):
.....
If I replace
!isset()
with
empty()
like
if (empty($name)):
and do not enter a name then the _same_ page loads which is what is supposed
to happen.
Why doesn't the call to !isset() with the negation mark loads the next page
when a name is not entered?
The script predates globals being turned off and it is below.
Thank you.
TR
.................
<html>
<head>
<title> Sample Page </title>
</head>
<body>
<?php if (!isset($name) ): ?>
<!-- No name has been provided, so we
prompt the user for one. -->
<form action="<?=$PHP_SELF?>" method="get">
Please enter your name: <input type="text" name="name" />
<input type="submit" value="GO" />
</form>
<?php else: ?>
<p>Your name: <?=$name?></p>
<p>This paragraph contains a <a
href="newpage.php?name=<?=urlencode($name)?>">link</a> that passes the name
variable on to the next document.</p>
<?php endif; ?>
</body>
</html>
--- End Message ---
--- Begin Message ---
> Why doesn't the call to !isset() with the negation
> mark loads the nextpage when a name is not entered?
What do you get if you do:
if (isset($a)) {
print '$a is set';
} else {
print '$a is not set';
}
$a = "";
if (isset($a)) {
print '$a is set';
} else {
print '$a is not set';
}
You get:
F:\>c:\PHP\php -f test.php
$a is not set
$a is set
F:\>
Why? Becasue pointing to an empty string
is not the same as having no pointer at all.
Does this solve your problem?
--- End Message ---
--- Begin Message ---
By the way, it might be interresting to see what this does:
if (strlen($a)) {
print '$a is set';
} else {
print '$a is not set' . "\n";
}
$a= "";
if (strlen($a)) {
print '$a is set';
} else {
print '$a is not set' . "\n";
}
-----Original Message-----
From: Svensson, B.A.T. (HKG)
To: '[EMAIL PROTECTED] '
Sent: 2004-02-15 17:51
Subject: RE: [PHP-WIN] isset() question
> Why doesn't the call to !isset() with the negation
> mark loads the nextpage when a name is not entered?
What do you get if you do:
if (isset($a)) {
print '$a is set';
} else {
print '$a is not set';
}
$a = "";
if (isset($a)) {
print '$a is set';
} else {
print '$a is not set';
}
You get:
F:\>c:\PHP\php -f test.php
$a is not set
$a is set
F:\>
Why? Becasue pointing to an empty string
is not the same as having no pointer at all.
Does this solve your problem?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
If you get a chance please run the following script _without_ entering a
name in the textbox.
Does the same page load after you hit submit or does a different page load?
Thank you.
TR
...................
<html>
<head>
<title> Sample Page </title>
</head>
<body>
<?php if (!isset($name) ): ?>
<!-- No name has been provided, so we
prompt the user for one. -->
<form action="<?=$PHP_SELF?>" method="get">
Please enter your name: <input type="text" name="name" />
<input type="submit" value="GO" />
</form>
<?php else: ?>
<p>Your name: <?=$name?></p>
<p>This paragraph contains a <a
href="newpage.php?name=<?=urlencode($name)?>">link</a> that passes the name
variable on to the next document.</p>
<?php endif; ?>
</body>
</html>
--- End Message ---
--- Begin Message ---
Are you globas set to on or off?
-----Original Message-----
From: Anthony Ritter
To: [EMAIL PROTECTED]
Sent: 2004-02-15 18:21
Subject: Re: [PHP-WIN] isset() question
If you get a chance please run the following script _without_ entering
a name in the textbox.
Does the same page load after you hit submit or does a different page
load?
Thank you.
TR
...................
<html>
<head>
<title> Sample Page </title>
</head>
<body>
<?php if (!isset($name) ): ?>
<!-- No name has been provided, so we
prompt the user for one. -->
<form action="<?=$PHP_SELF?>" method="get">
Please enter your name: <input type="text" name="name" />
<input type="submit" value="GO" />
</form>
<?php else: ?>
<p>Your name: <?=$name?></p>
<p>This paragraph contains a <a
href="newpage.php?name=<?=urlencode($name)?>">link</a> that passes the
name
variable on to the next document.</p>
<?php endif; ?>
</body>
</html>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Anthony Ritter,Hello!
Here is my test result:
<html>
<head>
<title> Sample Page </title>
</head>
<body>
<p>Your name: </p>
<p>This paragraph contains a <a
href="newpage.php?name=">link</a> that passes the name
variable on to the next document.</p>
</body>
</html>
It's all right under Apache/2.0.44 (Win32) & PHP/4.3.1.what problem you met
is that you turn off the globals_register.If that,you will never get the name
varibles by $name,but $_POST['name'] or $_GET['name'] or $_REQUEST['name'].
Mend your code like this:
<?php if (!isset($_REQUEST['name']) ): ?>
May this helps you,
Yong Woody
======= 2004-02-16 01:21:20 =======
>If you get a chance please run the following script _without_ entering a
>name in the textbox.
>
>Does the same page load after you hit submit or does a different page load?
>
>Thank you.
>TR
>...................
>
><html>
><head>
><title> Sample Page </title>
></head>
><body>
>
><?php if (!isset($name) ): ?>
>
> <!-- No name has been provided, so we
> prompt the user for one. -->
>
> <form action="<?=$PHP_SELF?>" method="get">
> Please enter your name: <input type="text" name="name" />
> <input type="submit" value="GO" />
> </form>
>
><?php else: ?>
>
> <p>Your name: <?=$name?></p>
>
> <p>This paragraph contains a <a
>href="newpage.php?name=<?=urlencode($name)?>">link</a> that passes the name
>variable on to the next document.</p>
>
><?php endif; ?>
>
></body>
></html>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
= = = = = = = = = = = = = = = = = = = =
Meteorlet
[EMAIL PROTECTED]
2004-02-16
--- End Message ---