Re: PHP scripts and IE
From: Geoff Berrow (blthecat_at_ckdog.co.uk)
Date: 01/30/05
- Next message: Ashmodai: "Re: Need some ideas"
- Previous message: Ashmodai: "Re: Table / php problem"
- In reply to: Tony Wainwright: "Re: PHP scripts and IE"
- Next in thread: Ashmodai: "Re: PHP scripts and IE"
- Reply: Ashmodai: "Re: PHP scripts and IE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Jan 2005 01:31:28 +0000
I noticed that Message-ID: <cthahu$7gm$1@sparta.btinternet.com> from
Tony Wainwright contained the following:
>Sorry Geoff, just learning - if you could point out what is wrong with the
>code I would appreciate it. And perhaps suggest a better book (I am using
>PHP, MySQL and Apache All in One, published by Sams)
Actually it's not bad enough to cause the error but I think it could
lead you into bad habits. I find it easier to be consistent in my use
of superglobals and use them like so :- $_POST['user']
If you tried to do
echo $_POST[user];
You would get a warning notice. It only works in your case because it
is contained within double quotes. I find it simpler to use just one
way. Unfortunately this means you have to write the lines as:-
echo "<p>Welcome <b>".$_POST['user']."</b>!</p>";
echo "<p>Your message is:<br><b>".$_POST['message']."</b></p>";
But it saves you having to think of whether to use single quotes or not.
Also, it's a good idea to check if variables exist before using them. I
know this script won't get called unless the POST variables exist, but
again it's all about good habits.
As for your original problem. Sorry, can't recreate it - it works fine
in IE here.
-- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/
- Next message: Ashmodai: "Re: Need some ideas"
- Previous message: Ashmodai: "Re: Table / php problem"
- In reply to: Tony Wainwright: "Re: PHP scripts and IE"
- Next in thread: Ashmodai: "Re: PHP scripts and IE"
- Reply: Ashmodai: "Re: PHP scripts and IE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|