Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-25-2007, 06:07 PM   PM User | #1
phill_ridout
Regular Coder

 
Join Date: Mar 2006
Posts: 187
Thanks: 5
Thanked 0 Times in 0 Posts
phill_ridout is an unknown quantity at this point
Error: Notice: Undefined index

Im new to this PHP stuff, i've been trying it since monday and its 50 times easier than i thought it would be :-). I understand why im getting the following errors, but how can i iliminate it?

Code:
Notice: Undefined index: UsrEml in C:\Program Files\EasyPHP 2.0b1\www\login.php on line 8

Notice: Undefined index: UsrPwd in C:\Program Files\EasyPHP 2.0b1\www\login.php on line 8

PHP Code:
<?php

if ($_POST["UsrEml"] || $_POST["UsrPwd"])
{    
       echo 
"Processing Page"
}
else
{
    
?>
    <form action='login.php' method='post'>
    <label for='UsrNme'>Email Address: </label><input id='UsrEml' name='UsrEml' type='text'>
    <label for='Pwd'>Password: </label><input id='UsrPwd' name='UsrPwd' type='password'>
    <input type='submit'>
    </form>
<?php
}
    
?>

Thanks in advance!
phill_ridout is offline   Reply With Quote
Old 07-25-2007, 06:13 PM   PM User | #2
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
try

if(!empty($_POST['submit']))
{
//Processing page
}
else
{
//Show form
}


To do that, you also have to add name="submit" to your submit button .

HTH
Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.
whizard is offline   Reply With Quote
Old 07-25-2007, 07:05 PM   PM User | #3
phill_ridout
Regular Coder

 
Join Date: Mar 2006
Posts: 187
Thanks: 5
Thanked 0 Times in 0 Posts
phill_ridout is an unknown quantity at this point
thanks, its so easy, i dunno why i even dreaded trying php and mysql, its so easy! :-D
phill_ridout is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:43 AM.


Advertisement
Log in to turn off these ads.