er bestaat al een user kev
Kleine Vragen Topic #1
Ik heb een script die weergeeft de nieuwste 5 leden, maar nu wil ik dus een button en als je er op klikt krijg je nog 5 resultaten (in totaal 10 dus)
Weet er iemand tutorials voor professioneel, maar toch simpel te leren designen?
Nickjexx schreef:Na de while kun je zetten:Ik heb een script die weergeeft de nieuwste 5 leden, maar nu wil ik dus een button en als je er op klikt krijg je nog 5 resultaten (in totaal 10 dus)
Haal er in je query gewoon 10 op (ORDER BY id DESC o.i.d.)
Voor de [func]while[/func] zet je dan iets als $i = 0;
In de while kun je dan doen[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++ ==[/COLOR] [COLOR= #0000BB]5[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="verborgen" style="display: none;">[/COLOR][COLOR= #007700]; }[/COLOR]
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</div><input type="submit" onclick="document.getElementById(verborgen).style.display = block"/>[/COLOR][COLOR= #007700];[/COLOR] En dan heb je het zon beetje.
nvm
Aarclay schreef:onmogelijk want ik reinstalleerde het script op een nieuwe mysql databaseer bestaat al een user kev
Jacmob schreef:Blijkbaar doe je dus wat fout.onmogelijk want ik reinstalleerde het script op een nieuwe mysql databaseEerdere citaten tonen
Aarclay schreef:er bestaat al een user kev
kan een ervaren scripter niet even naar me script kijken
?
?Jacmob schreef:Welk script ?kan een ervaren scripter niet even naar me script kijken?
naar mijn script van xenforo custom login krijg error etc die ik hierboven als ij
Jacmob schreef:Als je het script postnaar mijn script van xenforo custom login krijg error etc die ik hierboven als ij
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]library/config.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$link[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]localhost[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$config[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$config[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$link[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Could not connect: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
[COLOR= #0000BB]$db_selected[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$config[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]db[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]dbname[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$link[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$db_selected[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]Cant use foo : [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
addusers[COLOR= #007700]();
function[/COLOR] addusers[COLOR= #007700](){[/COLOR]
[COLOR= #FF8000]//Retrieve the users from your database[/COLOR]
[COLOR= #0000BB]$getuser[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM xf_user"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getuser[/COLOR][COLOR= #007700])){[/COLOR]
[COLOR= #0000BB]$username[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"username"[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$email[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"email"[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$gjinia[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"sex"[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$dt[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"birthday"[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$dtarr[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"-"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dt[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$gjinia[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700])[/COLOR]
[COLOR= #0000BB]$gjinia[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]male[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #0000BB]$gjinia[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]female[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$data[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/serialize"]serialize[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]=>[/COLOR][COLOR= #0000BB]$user[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"perdoruesFjala"[/COLOR][COLOR= #007700]],[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]=>[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$krk[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO xf_user (username,email,gender,language_id,timezone,visible,user_group_id,display_style_group_id,permission_combination_id,user_state,register_date) VALUES
($username,$email,$gjinia,1,Europe/Berlin,1,2,2,2,valid,1289127598)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krk[/COLOR][COLOR= #007700])){[/COLOR]
[COLOR= #0000BB]$userid[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_insert_id"]mysql_insert_id[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$krkauth[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO `xf_user_authenticate` (user_id,scheme_class,data,remember_key) VALUES ($userid,XenForo_Authentication_shqiperia,$data,)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krkauth[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$krkprofile[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO xf_user_profile (user_id,dob_day,dob_month,dob_year) VALUES ($userid,$dtarr[2],$dtarr[1],$dtarr[0])"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krkprofile[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$krkoptions[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO xf_user_option (user_id,show_dob_year,show_dob_date,email_on_conversation) VALUES ($userid,1,1,1)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krkoptions[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$krkprivacy[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO xf_user_privacy (user_id,allow_view_profile,allow_post_profile,allow_send_personal_conversation,allow_view_identities,allow_receive_news_feed) VALUES ($userid,everyone,everyone,everyone,everyone,everyone)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krkprivacy[/COLOR][COLOR= #007700]);
}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$error[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$krk2[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"INSERT INTO `errors` (`id` ,`errori`) VALUES (NULL , $error)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$krk2[/COLOR][COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]//printf("Last inserted record has id %dn", mysql_insert_id());[/COLOR]
[COLOR= #007700]}
}[/COLOR]
[URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$link[/COLOR][COLOR= #007700]);[/COLOR] Foutenafhandeling is gewoon prut.
Je controleert met if(!$iets), maar je doet toch die(). Dan kan je evengoed direct die() doen
Je controleert met if(!$iets), maar je doet toch die(). Dan kan je evengoed direct die() doen

ik heb dat script niet gemaakt 

Jacmob schreef:Maar dan kun je er nog wel iets aan doen.ik heb dat script niet gemaakt
