Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

OT: Trapping empty password input in PHP?

LEGEND ,
Oct 10, 2006 Oct 10, 2006
I am trying to do that with this markup -

$colname_rsPassword = "-1";
if (isset($_POST['password'])) {
$colname_rsPassword = $_POST['password'];
if ($colname_rsPassword=='') {
$error=0;
header("Location: failure.php?type=0"); }

But it's not working. Any ideas?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



TOPICS
Server side applications
333
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2006 Oct 10, 2006
I assume you need the bit about colname_rsPassword to keep DW happy, but I'd
probably put the check for empty or non-existing field before that:

if(!isset($_POST["password"]) || $_POST["password"] == "") {
header("Location: failure.php?type=0");
exit();
}


$colname_rsPassword = "-1";
if (isset($_POST['password'])) {
$colname_rsPassword = $_POST['password'];
}

--
--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Cartweaver Development Team
http://www.cartweaver.com

Extending Knowledge Daily
http://www.communitymx.com/


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:eggbb4$5ea$1@forums.macromedia.com...
>I am trying to do that with this markup -
>
> $colname_rsPassword = "-1";
> if (isset($_POST['password'])) {
> $colname_rsPassword = $_POST['password'];
> if ($colname_rsPassword=='') {
> $error=0;
> header("Location: failure.php?type=0"); }
>
> But it's not working. Any ideas?
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2006 Oct 10, 2006
Thanks, Tom. Funny - it was the exit that made the difference. I thought a
header would redirect immediately?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:eggd7b$7ph$1@forums.macromedia.com...
>I assume you need the bit about colname_rsPassword to keep DW happy, but
>I'd probably put the check for empty or non-existing field before that:
>
> if(!isset($_POST["password"]) || $_POST["password"] == "") {
> header("Location: failure.php?type=0");
> exit();
> }
>
>
> $colname_rsPassword = "-1";
> if (isset($_POST['password'])) {
> $colname_rsPassword = $_POST['password'];
> }
>
> --
> --
> Tom Muck
> co-author Dreamweaver MX 2004: The Complete Reference
> http://www.tom-muck.com/
>
> Cartweaver Development Team
> http://www.cartweaver.com
>
> Extending Knowledge Daily
> http://www.communitymx.com/
>
>
> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:eggbb4$5ea$1@forums.macromedia.com...
>>I am trying to do that with this markup -
>>
>> $colname_rsPassword = "-1";
>> if (isset($_POST['password'])) {
>> $colname_rsPassword = $_POST['password'];
>> if ($colname_rsPassword=='') {
>> $error=0;
>> header("Location: failure.php?type=0"); }
>>
>> But it's not working. Any ideas?
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> http://www.dreamweavermx-templates.com - Template Triage!
>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>> ==================
>>
>>
>>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2006 Oct 10, 2006
Murray *ACE* wrote:
> Thanks, Tom. Funny - it was the exit that made the difference. I thought a
> header would redirect immediately?

No. The script continues running until it gets to something that tells
it to stop, and your header gets lost in the rest of the output.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2006 Oct 10, 2006
As far as I know it is a requirement.

Tom

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:egge6u$92i$1@forums.macromedia.com...
> Thanks, Tom. Funny - it was the exit that made the difference. I thought
> a header would redirect immediately?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2006 Oct 10, 2006
LATEST
Yes, that's exactly what was happening.

Thanks!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"David Powers" <david@example.com> wrote in message
news:egghlt$d2h$2@forums.macromedia.com...
> Murray *ACE* wrote:
>> Thanks, Tom. Funny - it was the exit that made the difference. I
>> thought a header would redirect immediately?
>
> No. The script continues running until it gets to something that tells it
> to stop, and your header gets lost in the rest of the output.
>
> --
> David Powers
> Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> http://foundationphp.com/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines