MārisL Posted December 14, 2007 Report Share Posted December 14, 2007 http://paste.php.lv/6586 Kādēļ viņš netiek līdz labošanai? Link to comment Share on other sites More sharing options...
andrisp Posted December 14, 2007 Report Share Posted December 14, 2007 (edited) Točna zini, ka $logged_in ir definēts vispār ? Ja tas ir viss kods (nav nekādu inklūžu sākumā etc), tad skaidri redzams, ka tur arī vaina. Kā arī - nefetcho lietotāja datus 3 reizes. Fetcho vienu un pēc tam visur izmanto vienu un to pašu masīvu. Edited December 14, 2007 by andrisp Link to comment Share on other sites More sharing options...
MārisL Posted December 14, 2007 Author Report Share Posted December 14, 2007 (edited) http://paste.php.lv/6588 (login.php) $logged_in ir definēts. Edited December 14, 2007 by MārisL Link to comment Share on other sites More sharing options...
andrisp Posted December 14, 2007 Report Share Posted December 14, 2007 Nu tad debugo: Pirms tā if ($logged_in) uztaisi var_dump($logged_in) . Ja ir null, tad skaidri zināms, ka nav definēts (vai arī tiešām null). Ja ir viss kedās, tad skaties nākamo if kontrukciju vai tā izpildā pareizi. Ja jā, tad atkal nākamo. Ja tomēr tas $logged_in bija false vai null, tad ej uz augšu un skaties, kur tas izveidots. Kā redzams, tas notie checkLogin() funkcijā. Skaties un debugo to. Link to comment Share on other sites More sharing options...
MārisL Posted December 14, 2007 Author Report Share Posted December 14, 2007 (edited) Nu pirms tam viss gāja un kopš tā laika login.php failā nekas nav mainīts. Tātad vaina ir profila lapā. Mēģinu var_dump bool(true) Edited December 14, 2007 by MārisL Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 (edited) profils.php Profils tiek labots tikai tad, ja ir aizpildīti visi lauciņi. Kā būtu iespējams izveidot, lai nav obligāti jaaizpilda visus lauciņus? Edited December 15, 2007 by MārisL Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2007 Report Share Posted December 15, 2007 Vai ku daudz nevajadzīgu kveriju... Veic apdeitu tikai vienu reizi un visas vērtības liec iekš viena UPDATE kverija. Un attiecībā uz to obligātumu. Izņem no ifiem to otro pārbaudi. Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 (edited) Sākumā man bija visi kveriji zem viena updat'a, bet domāju, ka tas ir pie vainas. Turpinu darbu... isset($_POST['dzivesvieta_labots']) &&) { blabla } ar šo tu domāji izņemt to pārbaudi? Edited December 15, 2007 by MārisL Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2007 Report Share Posted December 15, 2007 Parādi kā bija sākumā. Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 (edited) if(isset($_POST['avatars_labots']) && $_POST['avatars_labots'] and isset($_POST['epasts_labots']) && $_POST['epasts_labots'] and isset($_POST['vards_labots']) && $_POST['vards_labots'] and isset($_POST['dzivesvieta_labots']) && $_POST['dzivesvieta_labots'] and isset($_POST['majaslapa_labots']) && $_POST['majaslapa_labots'] and isset($_POST['vecums_labots']) && $_POST['vecums_labots'] and isset($_POST['klans_labots']) && $_POST['klans_labots'] and isset($_POST['irc_labots']) && $_POST['irc_labots'] and isset($_POST['sensitivity_labots']) && $_POST['sensitivity_labots'] ) Edited December 15, 2007 by MārisL Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2007 Report Share Posted December 15, 2007 Ņem ārā visus tos && $_POST['avatars_labots']. Un esi konsistents - ja izmanto &&, tad izmanto &&, nevis 'and' vēl jauc iekšā. Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 tenkjū. Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 Notice: Undefined index: avatars in /home/www/yoyo_maza_faka_LATVIJA_RULEEEE/profils.php on line 41 $stalys = $HTTP_POST_FILES['avatars']['name']; Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2007 Report Share Posted December 15, 2007 Nu ? Tev taču formā nemaz <input type="file"> nav. Kā arī pašai formai enctype pareizs jānorāda. Meklē infu šeit: http://lv.php.net/features.file-upload Link to comment Share on other sites More sharing options...
MārisL Posted December 15, 2007 Author Report Share Posted December 15, 2007 <form method="post" action="profils.php" enctype="multipart/form-data"> Avatars: </td><td><input type="file" name="avatars" /></td></tr> Kods strādā, tikai ir šis errors. Link to comment Share on other sites More sharing options...
Recommended Posts