RE: [PHP] Forms and IE

2002-02-10 Thread Martin Towell

might be the header(location...);  bit - you might need to specify the
full address

-Original Message-
From: Sean Hurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms and IE



Please forgive me if this has been covered before. I have searched the list 
and could not find reference to a similar problem.

I am completetly new to PHP and I am stuck. I am creating a very simple 
form. Essentially the user agrees or disagrees to a message. If the user 
agrees, they are sent to another form. It they disagree they are sent home.

My script works with Netscape and Opera but not Internet Explorer (ver 
6.0.2) and I cannot figure out why. As I said it is very simple and the 
relevant parts are displayed as follows:
form method=post action=agree.php
..
I have read the terms and Agree input type=checkbox name=agree[] 
value=agree I Do Not Agree input type=checkbox name=disagree 
value=disagree
input type=submit name=submit value=Submit
...
agree.php
?
if ($agree)  /* (I have tried this also with ($isset = $agree))  */
{ header (location: ?link=form);
}
else
{ header (location: /LETS);
}
?

As I said, this works fine with Netscape and Opera but not IE.
Any suggestions and/or advice is appreciated.

Thanks.



_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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



Re: [PHP] Forms and IE

2002-02-10 Thread Jason Lotito

Answered below:

- Original Message -
From: Sean Hurley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 10, 2002 11:40 PM
Subject: [PHP] Forms and IE



 Please forgive me if this has been covered before. I have searched the
list
 and could not find reference to a similar problem.

 I am completetly new to PHP and I am stuck. I am creating a very simple
 form. Essentially the user agrees or disagrees to a message. If the user
 agrees, they are sent to another form. It they disagree they are sent
home.

 My script works with Netscape and Opera but not Internet Explorer (ver
 6.0.2) and I cannot figure out why. As I said it is very simple and the
 relevant parts are displayed as follows:
 form method=post action=agree.php
 ..
 I have read the terms and Agree input type=checkbox name=agree[]

agree[] is the problem here. For IE, it hands it to PHP, and so PHP see's it
as an array, or
$array[0]

So, take out the [] and you should be alright.

Jason Lotito
www.newbienetwork.net


 value=agree I Do Not Agree input type=checkbox name=disagree
 value=disagree
 input type=submit name=submit value=Submit
 ...
 agree.php
 ?
 if ($agree)  /* (I have tried this also with ($isset = $agree))  */
 { header (location: ?link=form);
 }
 else
 { header (location: /LETS);
 }
 ?

 As I said, this works fine with Netscape and Opera but not IE.
 Any suggestions and/or advice is appreciated.

 Thanks.



 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx


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



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




RE: [PHP] Forms and IE

2002-02-10 Thread Sean Hurley

Well, damn.
When I read your suggestion I didn't quite accept it. I thought
no, it would return an error if it couldn't find the page, but with nothing 
to lose I tried it. And it worked. Thank you. Thanks a lot.

From: Martin Towell [EMAIL PROTECTED]
To: 'Sean Hurley' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP] Forms and IE
Date: Mon, 11 Feb 2002 15:48:17 +1100

might be the header(location...);  bit - you might need to specify the
full address

-Original Message-
From: Sean Hurley [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms and IE



Please forgive me if this has been covered before. I have searched the list
and could not find reference to a similar problem.

I am completetly new to PHP and I am stuck. I am creating a very simple
form. Essentially the user agrees or disagrees to a message. If the user
agrees, they are sent to another form. It they disagree they are sent home.

My script works with Netscape and Opera but not Internet Explorer (ver
6.0.2) and I cannot figure out why. As I said it is very simple and the
relevant parts are displayed as follows:
form method=post action=agree.php
..
I have read the terms and Agree input type=checkbox name=agree[]
value=agree I Do Not Agree input type=checkbox name=disagree
value=disagree
input type=submit name=submit value=Submit
...
agree.php
?
if ($agree)  /* (I have tried this also with ($isset = $agree))  */
{ header (location: ?link=form);
}
else
{ header (location: /LETS);
}
?

As I said, this works fine with Netscape and Opera but not IE.
Any suggestions and/or advice is appreciated.

Thanks.



_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: [PHP] Forms and IE

2002-02-10 Thread Analysis and Solutions

Hi Sean:

Sean Hurley wrote:
 
 Agree input type=checkbox name=agree[] value=agree
 I Do Not Agree input type=checkbox name=disagree value=disagree

 if ($agree)  /* (I have tried this also with ($isset = $agree))  */
 { header (location: ?link=form);
 }
 else
 { header (location: /LETS);
 }

Several things here.  You're probably having problems because you defined
agree as an array (via the brackets in name=agree[]), but in your code
you're examining it as a regular variable.  By the way ($isset = $agree)
isn't real, at least in this context.  You mean if ( isset($agree) ) {...

Now, to do this job right...  First, use radio buttons.  Second, make
disagree the default.  Third examine the information in PHP.  Fourth, use a
full URL in the Location.  Fifth, write clean code, using indents to
demarcate nesting so your code is easier to read.

FORM:
   input type=radio name=Agree value=Y / I Agree
   input type=radio name=Agree value=N checked / I Do Not Agree


RECEIVING SCRIPT:
   if ($Agree == 'Y') {
  header('Location: http://foo.org/?link=form');
   } else {
  header('Location: http://foo.org/LETS/');
   }


Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409

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