Autor Zpráva
lissa
Profil
mam taky to problem ze nech robim co robm takto nefunguje jedno alebo druhe
potrebujem editnut kod tak aby fungovalo vsetko ..
v tomto pripade sa da menit len heslo ,
potrebujem aby sa dalo zadavat:
Realne meno
Vek- tu keby sa dalo od 18 rokov a viac aby sa dalo vybrat
mesto- napisu sami
Znamenie -to si napisu sami
Orientacia - na vyber z : Hetero, Bi, lesbicka, GAy, Metrosexual, nepoviem .
Vaha : sami
Stav- Zadany, slobodny,zasnubeny, zenaty ,vydata, neriesim . na love.
Farba oci: sami
Farba vlasov: sami
zamestananie : sami
hoby: sami

[code]<?php
session_start();

if (!isset($_SESSION['user']))
{
header("Location: login.php");
}

include ('dbc.php');

if ($_POST['Submit']=='Change')
{
$rsPwd = mysql_query("select user_pwd from users where user_email='$_SESSION[user]'") or die(mysql_error());
list ($oldpwd) = mysql_fetch_row($rsPwd);

if ($oldpwd == md5($_POST['oldpwd']))
{
$newpasswd = md5($_POST['newpwd']);

mysql_query("Update users
SET user_pwd = '$newpasswd'
WHERE user_email = '$_SESSION[user]'
") or die(mysql_error());
header("Location: settings.php?msg=Password updated...");
} else
{ header("Location: settings.php?msg=ERROR: Password does not match..."); }
}

?>
<h1>Settings</h1>
<p>
<?php if (isset($_GET['msg'])) { echo "<div class=\"msg\"> $_GET[msg] </div>"; } ?>
</p>
<h2>Change Password</h2>
<form action="settings.php" method="post" name="form3" id="form3">
<p>Old Password
<input name="oldpwd" type="password" id="oldpwd">
</p>
<p>New Password:
<input name="newpwd" type="password" id="newpwd">
</p>
<p>
<input name="Submit" type="submit" id="Submit" value="Change">
</p>
</form>[/code]


[code]CREATE TABLE `users` (
`id` int(20) NOT NULL auto_increment,
`full_name` varchar(200) collate latin1_general_ci NOT NULL default '',
`user_name` varchar(200) collate latin1_general_ci NOT NULL default '',
`user_pwd` varchar(200) collate latin1_general_ci NOT NULL default '',
`user_email` varchar(200) collate latin1_general_ci NOT NULL default '',
`activation_code` int(10) NOT NULL default '0',
`joined` date NOT NULL default '0000-00-00',
`country` varchar(100) collate latin1_general_ci NOT NULL default '',
`real_meno` varchar(200) collate latin1_general_ci NOT NULL default '',
`vek` varchar(200) collate latin1_general_ci NOT NULL default '',
`mesto` varchar(200) collate latin1_general_ci NOT NULL default '',
`znamenie` varchar(200) collate latin1_general_ci NOT NULL default '',
`orientacia` varchar(200) collate latin1_general_ci NOT NULL default '',
`vaha` varchar(200) collate latin1_general_ci NOT NULL default '',
`stav` varchar(200) collate latin1_general_ci NOT NULL default '',
`farbao` varchar(200) collate latin1_general_ci NOT NULL default '',
`farbav` varchar(200) collate latin1_general_ci NOT NULL default '',
`zamestnanie` varchar(200) collate latin1_general_ci NOT NULL default '',
`hoby` varchar(200) collate latin1_general_ci NOT NULL default '',
`user_activated` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
)[/code]

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: