Autor Zpráva
Michales
Profil
Zdravím,
zde: http://michales.comehere.cz/admincreatetables.phpkdyž vyplním vše správně tak mi to píše stejně
Warning: mysql_connect(): Access denied for user 'zakaznik'@'srv11.endora.cz' (using password: NO) in /home/users/michales/michales.comehere.cz/web/createdbase.php on line 28 Could not connect to

Jsem si jistý že zadávám vše správně:
Možná jen že v Database Host (URL) může být něco jiného zadávám tam https://sql1.endora.cz myslím ale že i to je správně.
Co to může způsobovat?
Na řádku 28 v createdbase je $link = mysql_connect($url, $username, $password)
Joker
Profil
Michales:
Jsem si jistý že zadávám vše správně
Tak to jste si jistý špatně :-)

using password: NO
Já si zase jsem prakticky jistý, že účet k databázi na veřejném hostingu bude mít nastavené heslo, takže ty přihlašovací údaje nejsou správně (buď chybí jen to heslo, nebo i něco dalšího).
Michales
Profil
Chyba byla v tom zpracujícím scriptu.
Bylo tam : $username = $HTTP_POST_VARS['USERNAME'];
Když jsem to zaměnil na $username = $_POST['USERNAME'];
tak už to jde.


Jestli se mohu ještě zeptat, tak při přihlášení mi to hází tuto chybu: Fatal error: Call to undefined function RegisterUser() in /home/users/michales/michales.comehere.cz/web/security.php on line 34
Na tom řádku je RegisterUser($User); o této chybě jsem nic na google nenašel.
Zechy
Profil
Zřejmě tu funkci nemáte nikdo vytvořenou, jinak by to chybu neházelo. A neni možný, že na googlu o tom nic neni, ptá se tu na to každej druhej :-)
Michales
Profil
Toto je celý obsah souboru security.php:
<?php 
/*********************************************************
 * Author: John Astill (c)
 * Date  : 9th December
 * File  : security.php
 * Desc  : usertypes:
 *       :     1 - Normal User
 *       :     2 - Priveleged User
 *       :     4 - Admin User
 *       :     8 - Root User
 *
 ********************************************************/

  require "encryptionclass.php";
  
  function login($username, $pwd) {
    global $SID;
    $location = "showmypredictions.php?sid=$SID"; 
    loginwithtarget($username,$pwd,$location);
  }
  
  function loginwithtarget($username, $pwd, $location) {
    global $User, $SID;

    // If the user login has timed out, forward to the
    // index.
    if (CheckUserLogin($username, $pwd) == FALSE) {
      /* Redirect browser to Prediction Index web site */
      ErrorRedir("Username or password invalid","index.php"); 
      /* Make sure that code below does not get executed when we redirect. */
      exit; 
    }

    RegisterUser($User);

    /* Redirect browser to user predictions web site */
    header("Location: $location"); 
    /* Make sure that code below does not get executed when we redirect. */
    exit; 
  }

 /********************************************************
  * Check if the given user has admin priveleges.
  * @param perms the users current permissions.
  *******************************************************/
  function CheckAdmin($perms) {
    global $dbaseUserData;

    $NormalUser = 1;
    $PrivelegedUser = 2;
    $AdminUser = 4;
    $RootUser = 8;
    
    return $perms >= $AdminUser;
  }

 /********************************************************
  * Check if the given user is logged in.
  * @param user the user to check.
  * @param pwd the password of the user to check.
  *******************************************************/
  function CheckUserLogin($username, $pwd) {
    // Needs global include SystemVars.php
    global $dbaseUserData, $User,$leagueID;

    // if encryption enabled encrypt the password
    $encr = new Encryption($pwd);
    $pwd = $encr->Encrypt($pwd);

    // Default the login to false.
    $User = new User;
    $User->loggedIn = FALSE;
    $User->usertype = 1;

    $link = OpenConnection();
    if ($link == FALSE) {
      return FALSE;
    }

    $userquery = "SELECT * FROM $dbaseUserData where username = \"$username\" and lid='$leagueID'";
    $userresult = mysql_query($userquery)
        or die("Query failed: $userquery");
    if ($userline = mysql_fetch_array($userresult, MYSQL_ASSOC)) {
      if ($pwd == $userline["password"]) {
        // The passwords are equal. Log the user in, and update the 
        // data.
        $User->userid =  $userline["userid"];
        $User->username = stripslashes($username);
        $User->emailaddr = $userline["email"];
        $User->icon = $userline["icon"];
        $User->usertype = $userline["usertype"];
        $User->createdate = $userline["since"];
        $User->lang = $userline["lang"];
        $User->dflths = $userline["dflths"];
        $User->dfltas = $userline["dfltas"];
        $User->lang = $userline["lang"];
        $User->auto = $userline["auto"];
        $User->loggedIn = TRUE;

        return TRUE;
      }
    }
    CloseConnection($link);
    return FALSE;
  }
?>
A opravdu jsem nic nenašel o této funkci, možná bych řekl že jde o nějakou starší funkci. Nevím moc tomu nerozumím.
jrm
Profil
A není definovaná v souboru encryptionclass.php? Viz 14. řádek...
Zechy
Profil
jrm:
Skript by skončil varováním, že soubor nemůže najít, pokud tam ten soubor neni, ta funkce neni nikde definovaná, jinak by to chybou nekončilo.

Michales:
Nejedná se o žádnou PHP funkci, prostě ta funkce neni nikde vytvořená/napsaná jako je třeba "function login(...){...}". To je to, co vám PHP řiká, žádnou takou funkci nezná a nikdo ji v těch souborech nevytvořil.
Michales
Profil
Aha, takže mám smůlu, nejsem schopný si to dopsat.

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

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

0