You are here: Re: interesting problem « PHP SQL « IT news, forums, messages
Re: interesting problem

Posted by Tyrone Slothrop on 07/13/05 17:21

On Wed, 13 Jul 2005 07:42:33 +0000 (UTC), "sentinel"
<postmaster@elma.hr> wrote:

>where could be the problem?
>
>thakns.
>
>Tom

I could not find the problem in all of that code. Try something
simpler:

<?php
function updatePassword ()
{
if (md5 ($_POST['nova1'];) != md5 ($_POST['nova2'])) {
return ("Nova lozinka nije dobro ponovljena.);
}

$dbh = mysql_connect($hostname, $username, $password) or die("Unable
to connect to MySQL");
$selected = mysql_select_db("interni",$dbh) or die("Could not select
interni");

$rs = mysql_query("SELECT * FROM users where id='{$_GET['ui']}' AND
password=\"".md5($_POST['stara'])."\"");
if (mysql_num_rows($rs) < 1) {
return("Greška prilikom unosa izmjenjene lozinke u bazu.");
}

mysql_query ("UPDATE users SET password='".md5($_POST['nova1']."'
WHERE id='{$_GET['ui']}'";);
if (mysql_affected_rows () == 1) {
return ("Stara lozinka nije toèna.");
}
return ("Lozinka nije uspješno promjenjena.");
}
?>

<font face="Trebuchet MS"><?=updatePassword()?></font>
<?mysql_close()?>

Why reassign variables and make all of those queries when and if..then
statements? This should work.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация