Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 64 van 286

Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
er bestaat al een user kev
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
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)
0
Berichten
1.684
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet er iemand tutorials voor professioneel, maar toch simpel te leren designen?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
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]
Na de while kun je zetten:
[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.
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nvm
0
Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
er bestaat al een user kev
onmogelijk want ik reinstalleerde het script op een nieuwe mysql database
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jacmob schreef:
Eerdere citaten tonen
Aarclay schreef:
er bestaat al een user kev
onmogelijk want ik reinstalleerde het script op een nieuwe mysql database
Blijkbaar doe je dus wat fout.
0
Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
kan een ervaren scripter niet even naar me script kijken confused?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jacmob schreef:
kan een ervaren scripter niet even naar me script kijken confused?
Welk script ?
0
Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
naar mijn script van xenforo custom login krijg error etc die ik hierboven als ij
0
Ewan

Lid

Berichten
8.302
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jacmob schreef:
naar mijn script van xenforo custom login krijg error etc die ik hierboven als ij
Als je het script post
0
Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[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]
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Foutenafhandeling is gewoon prut.
Je controleert met if(!$iets), maar je doet toch die(). Dan kan je evengoed direct die() doen emo
0
Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik heb dat script niet gemaakt emo
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jacmob schreef:
ik heb dat script niet gemaakt emo
Maar dan kun je er nog wel iets aan doen. emo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren