Current location: Hot Scripts Forums » Programming Languages » PHP » Undefined Error Again Lol


Undefined Error Again Lol

Reply
  #1 (permalink)  
Old 12-15-08, 08:26 AM
Kev0121 Kev0121 is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Undefined Error Again Lol

Well basically heres my error

Notice: Undefined index: submit in C:\wamp\www\Website\register.php_phpd_tmp14.php on line 5

and heres my code i have no idea whats wrong with it

PHP Code:

<?php

include "functions.php";
connect();

if(!
$_POST['submit'])
{
            echo 
"<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n";
    echo 
"<form method=\"post\" action=\"register.php\">\n";
    echo 
"<tr><td colspan=\"2\" align=\"center\">Registration Form</td></tr>\n";
    echo 
"<tr><td>Username</td><td><input type=\"text\" name=\"username\"></td></tr>\n";
    echo 
"<tr><td>Password</td><td><input type=\"password\" name=\"password\"></td></tr>\n";
    echo 
"<tr><td>Confirm</td><td><input type=\"password\" name=\"passconf\"></td></tr>\n";
    echo 
"<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Register\"></td></tr>\n";
    echo 
"</form></table>\n";
} else
{
    
$user protect($_POST['username']);
    
$pass protect($_POST['password']);
    
$confirm protect($_POST['passconf']);
}


?>
Reply With Quote
  #2 (permalink)  
Old 12-15-08, 09:07 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Take a look at the isset() manual page.
Reply With Quote
  #3 (permalink)  
Old 12-16-08, 10:32 AM
priti solanki priti solanki is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
print $_POST using print_r() and see what data is posted by form.??

if(!$_POST['submit']) it is logically correct but developers prefer as follow

if(!isset($_POST['submit']))


Thanks
Reply With Quote
  #4 (permalink)  
Old 12-16-08, 10:43 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
I was wondering what the extension ".php_phpd_tmp14.php" was? Can you actually have a 2 dot extension? Is this dreamweavers doing or something?

hmmm

Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No page no error? Hamed PHP 11 07-19-08 12:39 AM
How to modify flash so it pulls php url every 15 seconds method Flash & ActionScript 7 03-05-07 06:39 AM
No error message... stormshadow PHP 3 12-11-06 06:31 PM
Problems getting PHP-Nuke setup correctly TravisT PHP 2 12-17-05 07:54 PM
Include problem in C bkbenson C/C++ 4 02-08-05 04:24 AM


All times are GMT -5. The time now is 08:25 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.