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:
<?php
if (!isset($_SESSION['user'])) {
header ("Location: login.html");
}
else {
switch ($_GET['profile']) {
default:
echo 'Yo, ' . $_SESSION['user'] . ' If you wanna <a href="logout.php">sign out</a>' . ' <a href="page.php?profile=edit">Settings</a>';
break;
case 'edit':
include ("editprofile.php");
$mail= mysql_query ("SELECT `email` FROM `base` WHERE `id`= '122'"); echo 'Your current E-mail: ' . $smail;
$email= $_POST['email'];
$pass= $_POST['pass'];
$repass= $_POST['repass'];
if ($repass== $pass) {
password= '".$pass."' WHERE user='".$_SESSION['user']."'");
echo 'Settings have been changed';
}
else {
echo 'Type all information'; }
} // end empty
} // end switch
} // end main else
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <meta http-equiv="Content-type" content="application/xhtml+xml; charset=iso-8859-2" /> <meta name="Description" content="Something" /> <meta name="Keywords" content="Something" /> <meta name="Author" content="Author " /> <link rel="Stylesheet" href="style.css" type="text/css" /> <form action="page.php?profile=edit" method="post"> New E-mail address:
<input type="text" name="email" />New password:
<input type="password" name="pass" />Retype password:
<input type="password" name="repass" /><input type="submit" value="Send" />