RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Undifined Index in PHP code

Join Date: Mar 2007
Posts: 3
Reputation: Manawyddan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Manawyddan Manawyddan is offline Offline
Newbie Poster

Undifined Index in PHP code

  #1  
May 1st, 2007
Hi everyone.
i'm having the following problem with the PHP code that i'm writing:

Notice: Undefined index: email in c:\program files\easyphp1-8\www\gestao_perfil.php on line 15

Notice: Undefined index: password in c:\program files\easyphp1-8\www\gestao_perfil.php on line 22


Here is the code:


  1. <?php
  2. parse_str ($_SERVER['QUERY_STRING']);
  3. //Tenta estabelecer uma ligação ao servidor MySQL
  4. @mysql_connect("localhost","root","")
  5. or die("Não foi estabelecida uma ligação ao servidor MySQL!");
  6. //Tenta celeccionar a base de dados 12in
  7. @mysql_select_db("12in")
  8. or die("Não foi possivel seleccionar uma base de dados");
  9. // declaração de variáveis, query á base de dados, resultado da query atribuidos ás variáveis $mail $passwd
  10.  
  11. if (isset ($_POST['email'])) $email = $_POST['email'];
  12. {
  13. $email = $_POST['email'];
  14. $query = "SELECT mail FROM utilizador WHERE mail='$email'";
  15. $result = mysql_query($query);
  16. $mail= @MYSQL_RESULT($result,0,"email");
  17. }
  18. if (isset ($_POST['password'])) $password = $_POST['password'];
  19. {
  20. $password = $_POST['password'];
  21. $query = "SELECT password FROM utilizador WHERE password='$password'";
  22. $result = mysql_query($query);
  23. $passwd = @MYSQL_RESULT($result,0,"password");
  24. }
  25. ?>

The idea is to fetch values from a database and in the end update the database with new ones(i know that the last part isn't finnish yet). Why am i getting these messages on my web browser?
Can someone help me to find waht's wrong with the code?
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:10 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC