Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Wyświetlenie maila...
-Kercsdf-
post
Post #1





Goście







Mam problem. Chcę zrobić coś takiego żeby zaraz pod formularzu wyświetlało mi nazwę obecnego maila jak to podobnie jest w IPB. Jak narazie to wyświetla mi tylko napis "Array". Jak to rozwiązać?. Chodzi tutaj dokładnie o linie: 28,29 i 30. Kod:

  1. <?php 
  2.  
  3.  
  4. if (!isset($_SESSION['user'])) {
  5.  
  6. header ("Location: login.html");
  7.  
  8. } 
  9.  
  10. else {
  11.  
  12. switch ($_GET['profile']) {
  13.  
  14. default: 
  15.  
  16. echo 'Yo, ' . $_SESSION['user'] . ' If you wanna <a href="logout.php">sign out</a>'
  17. . ' <a href="page.php?profile=edit">Settings</a>';
  18.  
  19. break;
  20.  
  21. case 'edit':
  22.  
  23. mysql_connect ('localhost','root','mentormiszcz1e');
  24.  
  25. include ("editprofile.php");
  26. $mail= mysql_query ("SELECT `email` FROM `base` WHERE `id`= '122'");
  27. $smail= mysql_fetch_assoc($mail);
  28. echo 'Your current E-mail: ' . $smail; 
  29.  
  30. $email= $_POST['email'];
  31. $pass= $_POST['pass'];
  32. $repass= $_POST['repass'];
  33.  
  34. if (!empty($pass) && !empty($repass)) {
  35.  
  36. if ($repass== $pass) {
  37. mysql_query ("UPDATE base SET 
  38. password= '".$pass."' WHERE user='".$_SESSION['user']."'");
  39.  
  40. echo 'Settings have been changed';
  41.  
  42. }
  43.  
  44. else {
  45. echo 'Type all information';
  46. }
  47.  
  48. } // end empty
  49.  
  50. } // end switch
  51.  
  52. } // end main else 
  53.  
  54. ?>


  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
  5. <meta http-equiv="Content-type" content="application/xhtml+xml; charset=iso-8859-2" />
  6. <meta name="Description" content="Something" />
  7. <meta name="Keywords" content="Something" />
  8. <meta name="Author" content="Author " />
  9. <link rel="Stylesheet" href="style.css" type="text/css" />
  10. <title>Title</title>
  11. </head>
  12. <form action="page.php?profile=edit" method="post">
  13. <div id="edit">
  14. New E-mail address: <input type="text" name="email" />
  15. New password: <input type="password" name="pass" />
  16. Retype password: <input type="password" name="repass" />
  17. <input type="submit" value="Send" />
  18. </div>
  19. </form>
  20.  
  21. </body>
  22. </html>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 17:45