php-windows Digest 25 Aug 2002 23:01:48 -0000 Issue 1307

Topics (messages 15492 through 15500):

browser bug?
        15492 by: arch
        15493 by: Ross Fleming

Always getting a parse error
        15494 by: Dennis Hoffmann
        15495 by: Rich Gray

array way....
        15496 by: crizz
        15497 by: Rich Gray
        15499 by: Ross Fleming

accessing the regisry with php
        15498 by: Kevin Fonner

re-initiating a sesion
        15500 by: Kieran Hall

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 ---
Hi,

I'm running PHP 4.2.1 as a module of Apache 2.0.39 on XP. Everything works
fine, except in the case of certain output from my scripts, which a certain
browser--which shall remain anonymous (but it's initials are IE6)--can't
seem to handle, and responds by having the browser equivalent of an
epileptic seizure.

The PHP script isn't doing anything special. It just checks if some session
vars are set, and the rest is just plain HTML, with tables. Netscape 6.2
handles it perfectly. I even installed Microsoft's latest IE patches, with
no luck.

I'm wondering if anyone else has encountered the same bug, or whether I
should take this personally.

Thanks!
(sorry if you've seen this before)




--- End Message ---
--- Begin Message ---
You haven't really told us the bug...  Tell us the output and it would also
be handy if you could provide an example of code which causes the error.

Ross

> -----Original Message-----
> From: arch [mailto:[EMAIL PROTECTED]]
> Sent: 25 August 2002 13:34
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] browser bug?
>
>
> Hi,
>
> I'm running PHP 4.2.1 as a module of Apache 2.0.39 on XP. Everything works
> fine, except in the case of certain output from my scripts, which
> a certain
> browser--which shall remain anonymous (but it's initials are IE6)--can't
> seem to handle, and responds by having the browser equivalent of an
> epileptic seizure.
>
> The PHP script isn't doing anything special. It just checks if
> some session
> vars are set, and the rest is just plain HTML, with tables. Netscape 6.2
> handles it perfectly. I even installed Microsoft's latest IE patches, with
> no luck.
>
> I'm wondering if anyone else has encountered the same bug, or whether I
> should take this personally.
>
> Thanks!
> (sorry if you've seen this before)
>
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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

I'm a newbie (you guessed, right?) :-)
My problem is: I'm trying to set a cookie.
There are 2 pages involved, the first of which containing a form:

<form action=setcookie.php method=GET>
<input type=text name=name>NAME<br>
<input type=text name=email>Email<br>
<input type=submit name=submit value=SEND>
</form>
.
.
.
The 2nd file is setcookie.php, and so far I have the following code:

if (!empty($name) && !empty($email) && !empty($submit)
{ $content = array("name"=>$name, "email"=>$email);
    setcookie("testcookie", $content, time()+3600);    }
else
{    echo "There was a mistake!";    }

The error I receive is a "parsing error in line 7" which is exactly the
else-command.

Which mistake have I made, and how can I set that cookie?

Greets, Mr. Hatch.




--- End Message ---
--- Begin Message ---
You're missing a closing ')' on the if statement

i.e.

if (!empty($name) && !empty($email) && !empty($submit)

should be ...

if (!empty($name) && !empty($email) && !empty($submit))  <- extra closing
bracket

HTH
Rich
-----Original Message-----
From: Dennis Hoffmann [mailto:[EMAIL PROTECTED]]
Sent: 25 August 2002 07:26
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Always getting a parse error


Hi,

I'm a newbie (you guessed, right?) :-)
My problem is: I'm trying to set a cookie.
There are 2 pages involved, the first of which containing a form:

<form action=setcookie.php method=GET>
<input type=text name=name>NAME<br>
<input type=text name=email>Email<br>
<input type=submit name=submit value=SEND>
</form>
.
.
.
The 2nd file is setcookie.php, and so far I have the following code:

if (!empty($name) && !empty($email) && !empty($submit)
{ $content = array("name"=>$name, "email"=>$email);
    setcookie("testcookie", $content, time()+3600);    }
else
{    echo "There was a mistake!";    }

The error I receive is a "parsing error in line 7" which is exactly the
else-command.

Which mistake have I made, and how can I set that cookie?

Greets, Mr. Hatch.





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

--- End Message ---
--- Begin Message ---
Can you helpme  with that?
I have some variables with names like: $myvar1, $myvar2, $myvar3... and so
on... and I want to put them in an array. Ofcourse I need a Loop because I
don't know the number of the variables.
It will probably be like that:

$myarray= range(1,NumberOfVars);
$i=1
while ($ i <= NumberOfvars) {
$myarray[$i]= $myvar.$i;    #  <----here is the problem right?
}

To be honest, the $myvar1... variables come with "post" method from a form
and because I don't know how to send the directly as arrays I need this. So
if someone knows how to send them directly from the form as arrays (if
possible) it would be great

thanks for advance,
just started with php, crizz :D



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

use myvar[] in the form and PHP will generate an array for you

<input type="text" name="myvar[]">
<input type="text" name="myvar[]">

HTH
Rich
-----Original Message-----
From: crizz [mailto:[EMAIL PROTECTED]]
Sent: 25 August 2002 09:21
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] array way....


Can you helpme  with that?
I have some variables with names like: $myvar1, $myvar2, $myvar3... and so
on... and I want to put them in an array. Ofcourse I need a Loop because I
don't know the number of the variables.
It will probably be like that:

$myarray= range(1,NumberOfVars);
$i=1
while ($ i <= NumberOfvars) {
$myarray[$i]= $myvar.$i;    #  <----here is the problem right?
}

To be honest, the $myvar1... variables come with "post" method from a form
and because I don't know how to send the directly as arrays I need this. So
if someone knows how to send them directly from the form as arrays (if
possible) it would be great

thanks for advance,
just started with php, crizz :D




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

--- End Message ---
--- Begin Message ---
You are indeed correct in your assumption as to the line which causes the
problems.

Replace the line $myarray[$i]= $myvar.$i; with

$myarray[$i] = ${"myvar".$i};

It should solve your problems.  You might want to do an isset(${"myvar".$i})
and an !empty(${"myvar".$i}) check before assigning them however, in case
you only get $myvar1, $myvar3, $myvar4 etc.  Always program defensively, it
saves hassle in the long run.

Hope that helps

Ross

> -----Original Message-----
> From: crizz [mailto:[EMAIL PROTECTED]]
> Sent: 25 August 2002 17:21
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] array way....
>
>
> Can you helpme  with that?
> I have some variables with names like: $myvar1, $myvar2, $myvar3... and so
> on... and I want to put them in an array. Ofcourse I need a Loop because I
> don't know the number of the variables.
> It will probably be like that:
>
> $myarray= range(1,NumberOfVars);
> $i=1
> while ($ i <= NumberOfvars) {
> $myarray[$i]= $myvar.$i;    #  <----here is the problem right?
> }
>
> To be honest, the $myvar1... variables come with "post" method from a form
> and because I don't know how to send the directly as arrays I
> need this. So
> if someone knows how to send them directly from the form as arrays (if
> possible) it would be great
>
> thanks for advance,
> just started with php, crizz :D
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Anybody know what a good way to access the windows registry with PHP?

Thanks,
Kevin


--- End Message ---
--- Begin Message ---
I have been playing with sessions on my web site and have tried to
reinitiate a session by saving the session Id in a cookie and checking
for it at the top of the page.  However, this seems to fail.  I
discovered also, that by refreshing the browser the sessions starts
(from the Id in the cookie).  Any thoughts on the most effective way to
do this?
 
Kieran Hall 
--- End Message ---

Reply via email to