Hello,
We have just decided to switch to a new server and I have been trying to get everything working on the new host. I have been able to get our forums, blogs etc. working without too much hassle but surprisingly I haven't been able to get the little presentation script working. I have been reading through webpages and forums but because my knowledge of PHP is limited I don't know what could make the script work on our old host but not on the new on.
My guess is that it has something to do with different PHP & MySQL versions.
My old host was using following PHP and MySQL versions:
PHP VERSION: 4.4.0, mySQL VERSION: 3.23.58
New host is using the following versions:
PHP VERSION: 4.3.10, mySQL VERSION: 4.0.25
When trying to login to the presentation editing pages I get the same form back without any error message. Also the forgotten username/password form doesn't work anymore. The access control script looks like following.
Code for the username and password retrieval.
Session register code looks like following which to my knowledge should let me edit my presentation.:Code:<? $showform = "no"; if (!isset($email)) $showform = "yes"; else { // validate email address if ( ( !ereg ("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email ) ) || ( $email == "" ) ){ echo "Sähköpostiosoite ei kelpaa. <br>"; $showform = "yes"; } } // end else if ($showform == "yes"){ echo "<FORM name=\"thisform\" method=\"POST\" action=\"$PHP_SELF\"> <input type=\"text\" class=\"forminput\" name=\"email\" style='width:65%' maxlength=50 value=\"$email\" > <INPUT type=\"hidden\" class=\"forminput\" name=\"showform\" value=\"no\"><br>"; ?> <INPUT class="forminput" TYPE="submit" NAME="submit" VALUE="Lähetä"> <? echo "</form> "; } else { // retrieve login data from database dbConnect("database"); $nimimerkitdat = @mysql_query("select nimimerkit from profiles where email='$email'"); if(mysql_num_rows($nimimerkitdat) == 0) { echo "<BR><BR>Valitamme, antamaasi sähköpostiosoitetta ei löydy tietokannastamme.<BR><A HREF='http://www.kotichat.com/esittelyt/editprofile.php'>Palaa</A> takaisin ja yritä uudelleen."; die(); } $nimimerkitfound = @mysql_result($nimimerkitdat, 0, 0); $passworddat = @mysql_query("select password from profiles where email='$email'"); $passwordfound = @mysql_result($passworddat, 0, 0); $message = "Hei,\nSait tämän sähköpostin, koska pyysit saada salasanasi KotiChat.com sivustolta löytyvään esittelyysi.\nPyytämäsi tiedot:\nNimimerkki: $nimimerkitfound\nSalasana: $passwordfound\n\n--\n Terveisin,\n Ylläpito KotiChat.com\n palaute@kotichat.com\n http://www.kotichat.com\n "; mail( $email, "KotiChat esittelyyn kirjautuminen", $message, "From: asiakaspalvelu@kotichat.com" ); echo "<BR><BR>Kiitos.<BR>Nimimerkkisi ja salasanasi on lähetetty antamaasi sähköpostiosoitteeseen."; } ?>
Any help would be appreciated. I have only this week to verify that everything we need works on the new server.Code:<?php exit; } session_register("nimimerkit"); session_register("password"); dbConnect("kotichat_db"); $sql = "select * from profiles where nimimerkit = '$nimimerkit' and password = '$password'"; $result = mysql_query($sql); if (!$result) { error("A database error occurred while checking your login details."); } if (mysql_num_rows($result) == 0) { session_unregister("nimimerkit"); session_unregister("password"); ?>




Bookmarks