Jump to content

rootKID

Members
  • Posts

    467
  • Joined

  • Last visited

Everything posted by rootKID

  1. but that is the thing, i have done so and it sends either nothing or just the name as normal. Any ideas on how to do this? Maybe add in a sample? Because im kinda in a square box of no ideas at the moment... 😕
  2. ohh ok, that makes more sence, i also knew that sessions were server based, just not the difference in security tho. Also i did knew that i needed to use the setcookie function, however, how to i use it so that is will be like the session in the array shown? Because i am using it this way to see the difference... This is what i have tried to far... to set function: @setcookie( "[USER_COOKIE_LOGIN][USER_DATA_FLOW]".$SETTINGS['cookie_prefix'].$name, $value, $expire_time, $SETTINGS['cookie_path'], $SETTINGS['cookie_domain'].'; HttpOnly' ); and to read/get the cookie: function LOGIN_COOKIE_get_cookie_v1( $name ){ global $SETTINGS; if( isset( $_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ) AND !empty( $_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ) ){ return urldecode( $_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ); } else { return FALSE; } } ideas on how to set them? If this helps a bit? Thanks a lot in advance!
  3. Hi all, been a while, as always. So, new project. I am trying to (finally) make a cookie login for my portfolio website, which is not online yet, but will soon. I am using sessions so far, which are great to organize when it comes to using them. Look at picture attached for sample. So, for cookies, i am trying to achieve the same thing here but with not luck so far. I am using functions (not oop or anything like this, just normal psedual php...) to create the cookies... however i do know that cookies are also arrays (am i wrong? Oo?) So my questions is, when setting a cookie, how do i do as shown in the picture and how to i fetch them? The reason i do this is because i use LOGS to see the difference for each user and arrays and... well just about anything really, also for stats purposes, which will make my life much more easier (my own opinion, not sure if there are another way?) Anyways, hope you guys can give me a hint as to how to make the cookie go down a level or 2 in an/the array? Also, i did look on google and found serializing and unserializing? But i read on PHP.NET that it was a bad idea since attackers could use this for their advantage? Is this also correct understood? Thanks a lot in advance! Been struggling with this one for quite a while now Picture can be seen here: (note that i dont ave space for a new attachment at the moment and i dont know how to clear it out either, waiting for someone else to answer my other topic :P) Thanks a lot in advance!
  4. Hello, so one thing... trying to make a new topic... how do i erase a file i have uploaded in here before Oo? I tried to see "My Files"... no erase button? Thanks!
  5. Im going to try this yes, or tho i must say i am still learning FLEX-CSS and what it is about 😕 What is the difference from you are writing to mine? Can you tell?
  6. Hello W3S! Not sure if the title fits but it was the only one i could think of that would maybe even come close to what i am trying ^^' So the background of what i am trying to do, is to re-code my portfolio and this time i have a link on my navigationbar that, when clicked, a sidebar will open on the users right side of the screen. I have set the sidebar to 100vh i height to make sure the container of sidebar would appear 100% to the users screen (this is how i understood it, please tell me if i got this vh thing wrong!) - now the idea is at one point to have the sidebar to be dynamic with many many MANY sub-navs! So what i am trying to do here is to say if all the item links i am adding in, goes OVER the wrapper i have set around the items, there will appear a scroll on the left side of the users browser - however when so, it messes up at the bottom of my page since there is this white gap when i try to scroll down - almost like it won't detect that there are no items added yet. This is my CSS code so far: * { font-size: 8pt; font-family: Arial, Helvetica, sans-serif; } html, body { margin: 0; padding: 0; background-color: #ecdecd; } .wrapper { margin: 0 auto; width: 1080px; background-color: #ffffff; } .navbar { width: 100%; height: 35px; background-color: #cdcdcd; } .navbar-left { float: left; text-align: left; width: 540px; } .navbar-left-links { float: left; margin: 0 0 0 10px; width: 100px; height: 35px; line-height: 35px; text-align: center; display: block; background: #333333; color: #ffffff; text-decoration: none; opacity: 0.6; transition: 0.3s; } .navbar-left-links:hover { opacity: 1; } .navbar-right { float: right; text-align: right; width: 540px; } .navbar-right-links { float: right; margin: 0 10px 0 0; width: 100px; height: 35px; line-height: 35px; text-align: center; background: #333333; color: #ffffff; text-decoration: none; display: block; opacity: 0.6; /* OBS! Read the long comment below here and on the right side of transition in this class! Important! */ transition: 0.3s; /*if i put it here instead on the "on hover" part, it will have a weird load on page load! consider the pros/cons by doing this! (this is only theory! Because when i re-started the browser and hit refresh a coble of times it did not do the error!)*/ } .navbar-right-links:hover { opacity: 1; } .footer { width: 100%; height: 150px; border-top: 3px solid #444444; background-color: #666666; color: #cdcdcd; } .sidebar { position: absolute; display: none; top: 0; right: 0; height: 100vh; width: 250px; border-left: 3px solid #cc6600; background-color: #000000; color: #ffffff; /*opacity: 0.9;*/ } .sidebar-top-div-link-close { width: 100%; text-align: center; } .sidebar-top-div-link-close a { display: block; color: #ffffff; background-color: #111111; padding: 10px 0 10px 0; } /*consider how to make the height 100% without the scrolls take up width/height etc at the bottom of the page!*/ /*Also consider how to make the height 100% and if a overflow happens, then scroll on x-axis and NOT! y-axis!*/ .sidebar-wrapper-1 { width: 100%; overflow-y: scroll; overflow-x: hidden; height: 100%; } This is my HTML for now: <!DOCTYPE html> <html lang="da"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Portfolio :: Daniel Ugleholt Pedersen</title> <link rel="shortcut icon" type="image/ico" href="/favicon.ico" /> <link rel="stylesheet" type="text/css" media="screen" href="include/css/main_default.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <div class="wrapper"> <nav class="navbar"> <div class="navbar-left"> <a class="navbar-left-links" href="index.php" title="Forside">Forside</a> <a class="navbar-left-links" href="#" title="Kontakt">Kontakt</a> </div> <div class="navbar-right"> <a id="navbar-open_sidebar_navigation_1" class="navbar-right-links" href="#" title="Mere">Mere</a> <a class="navbar-right-links" href="#" target="_blank" title="Login (åbner i nyt vindue/tab!)">Login</a> </div> </nav> <div class="content_wrapper"> Wrapper </div> <footer class="footer"> Navn, Mail (til website ikke private!), Site Map, Om Mig/Os, Privacy Policy (privatliv og privatheds politik), Terms & Conditions (regler for brug af siden), Nyhedsbrev, Disclaimer, Copyright/Trademark (none, just a portfolio), Terms of Usage (samme som Terms and Conditions?), GDPR (hvordan jeg bruger logins, cookies, sessions, osv i forhold til sikkerhed på sitet! Husk at informerer om at jeg bruger krypteringer. Ikke hvilke slags krypteringer men at der bliver krypteret så brugeren ved dette!), Husk at lave en notifikations pop-up der siger jeg enten bruger cookies eller sessions på siden! </footer> </div> <div class="sidebar"> <div class="sidebar-top-div-link-close"> <a id="sidebar-link-close" href="#">Luk Sidebar</a> </div> <div class="sidebar-wrapper-1"> Wrapper 1 </div> </div> </body> </html> <script> $(document).ready(function(){ // Sample URLs // https://api.jquery.com/click/ // https://stackoverflow.com/questions/5059596/jquery-css-remove-add-displaynone $( "#navbar-open_sidebar_navigation_1" ).click(function() { // to see if the script is called at all and correctly! //alert( "Handler for .click() called." ); // Testing $('.sidebar').css('display','block'); }); $( "#sidebar-link-close" ).click(function() { // to see if the script is called at all and correctly! //alert( "Handler for .click() called." ); // Testing $('.sidebar').css('display','none'); }); }); </script> What can i do to rectify this? Thanks a lot in advance!
  7. hi. So i have been strugging a little bit with some jQuery. My original code, of which was working perfectly for my navbar is: $(document).ready(function(){ $('ul.navbar-nav li.dropdown').mouseenter(function(){ $(this).find('.dropdown-menu').delay(200).fadeIn(500); }); $('ul.navbar-nav li.dropdown').mouseleave(function(){ $(this).find('.dropdown-menu').delay(200).fadeOut(500); }); }); Now i would like to achieve a little more. Saying if it already has the class "show", it should NOT run the code saying when mouse hovers in/out, to show the menu. However, if the class does not appear, make the menu hover.. if that makes sence? I am using "BootStrap v.4.3.1" as CSS framework. My original idea is to run the code when a mouse if hovering over the navbar etc so that the menu can show. However, when the menu shows on hover, and the user clicks the element, it gives the class ".show" on the element! Of which brings me to the point saying that if the user does that, nothing else should happen, the menu shall still be there, even if the user removes the mouse. But if the user just hovers in/out, it fades in and out of course. Also, this shall only happen on screens like laptops etc and above... so not on smaller devices. In such case, i have been thinking of using the width of the screen as a guideline to check pixelwise if my javascript code should run or not, but i am a bit un-sure on how to put it. I how my explanation gives you an idea of what i am trying to accomplish. Thanks a lot if you have ideas and tips!
  8. how about that.. it worked. Feeling like a rookie still... after so long It was because i needed "root" in front. I have placed my project in a sub-folder called root. lol Thanks a lot! Working now as i can see it!
  9. ahh, ok i will test it and get back to you! Thanks! One question. If i use the PHP_SELF... does it give the "index.php" or just the "index" name? Thanks in advance tho! EDIT: Okay so i tested it and it does not work properly, maybe me doing it wrong. I am including the file "navbar.php" from location "include/html/GLOBAL/navbar/navbar.php" How should i put it in? If that is the problem that is? Thanks!
  10. ahh, ok i will test it and get back to you! Thanks! One question. If i use the PHP_SELF... does it give the "index.php" or just the "index" name? Thanks in advance tho! :D
  11. Hmm hello. I am not sure if this is helpful? Mostly because i dont use CRON jobs (yet). But what about using "defines"? Say in index.php you put in top of the file "define("derp")" and then in the file.php you are including, put: if(defined("derp")) {RUN YOUR CODE IN HERE TO SHOW ON INDEX PAGE!}else{die() "or just send back to index.php with header..."} I am using this, but i am not so sure this will work if you are using CRON jobs since defines dosent really do anything except checking if something is defined, and if so then execute.. it cannot differentiate from URL execution to CRON execution - so this should happen on all executions. Again, not sure if this is helpful at all but i know for sure this is working for me - without the cron jobs. however, if cron jobs are needed, then you should be able to do another thing that might work (i think). You can still use the define method, however, only wrap the define method around the places you wish to show in index.php. So say you got 1 peace of code you wanna execute to index.php and you still have running CRON jobs, and you already know that the CRON job is just executing and not with the defined definer... then in the if statement, put all the things you would like to show on index.php and in the else part, only put the things you would like for the CRON to run. Because the index.php has the defined string, and CRON does not, it should work. In that way you can include the file BUT seperate the 2 actions... again... i think. This was just a quick thinking solution, not sure it actually works, since i am still playing with CRON jobs myself. Test it and come back if it does not work. Good info before doing this, take a backup/copy of the original file if you have a lot of data - to make sure you still have the original - just in case
  12. Hello W3S. It has been a while :) I remember i once asked about this and one of you came up with a solution i could try. I have this file "navbar.php" which is included to all my page files, it is a global navbar. How ever i have forgotten how to do this and i lost my previous work on one of my HDD. I would like to know how to add the class ".active" when viewing index.php and when seeing blog.php of course, that is the one active and not index, and so on. I remember last time, you guys told me that i could check if i was on a specific file, and if so, i could add it and if not, nothing would happen, any ideas? I remember this was done with if/else statements... and yes i know i can make use of the url with variables, passing it through there but i am trying to avoid this so the url are... well.. pretty without it :P Hope you can help me out! Thanks a lot in advance! :)
  13. Hey W3! :D So my next big project is to make a carousel via latest bootstrap version (4.1), a CSS CMS Framework. Working great, only i would like to "try" and see if it is possible to me to edit it a bit. So for starters, it has a normal carousel that shows images, which is just fine.... only i would like to try an edit it a bit so that you see as usual the current image at the middle of the carousel, and then at each side (left/right), you can see the edges of each image next/previous in line. Currently trying to make use of selectors, or tho without luck :/ This is my current CSS (sorry for the mess... still a beta, so working on it :P): /*carousel_v1*/ #carouselExample { background-color: transparent; margin-top: 0px; margin-bottom: 10px; width: 100%; } #carouselExample img { max-height: 350px; } .carousel-indicators { /*margin-bottom: 2px;*/ /*bottom: 1px;*/ } .carousel-indicators li { /*background-color: #000;*/ /*Not Transparent Color*/ /*background: rgba(255, 255, 255, 0.5);*/ /*White Transparent*/ background: rgba(0, 0, 0, 0.4); /*Black Transparent*/ } .carousel-indicators li.active { /*background-color: #000;*/ /*Not Transparent Color*/ /*background: rgba(255, 255, 255, 0.5);*/ /*White Transparent*/ background: rgba(0, 0, 0, 0.7); /*Black Transparent*/ } .carousel-caption { bottom: 0; width: 100%; left: 0; /*Left:0; -> not needed at all in the css code if the width:100%; is not here! This is only to make it look good, smooth & nice!*/ background: rgba(0, 0, 0, 0.5); /*Black Transparent*/ } .carousel-control-next { /*color: #000000; background-color: #000000;*/ } .carousel-control-next-icon { /*background-color: #000; color: #000;*/ background: url(images/carousel_index/arrow-next.png) repeat; width: 30px; height: 45px; } .carousel-control-prev { /*color: #000000; background-color: #000000;*/ } .carousel-control-prev-icon { background: url(images/carousel_index/arrow-prev.png) repeat; width: 30px; height: 45px; /*background-color: #000; color: #000;*/ } /* Ideen er at jeg skal via "CSS-Selectors" selecte de billeder der er EFTER og FØR det aktive billede, så jeg kan give plus/minus de 5% pixels (eller what not), så jeg kan se de næste billeder og billederne før der. Jeg tænker jeg prøver til at starte med følgene: (+) (~) eller (>) */ /* // alle efter! .carousel-item active ~ .carousel-item .CUSTOM_CSS_CLASS_carousel_img { width: calc(-100px); } */ /* // første direkte efter! .carousel-item active + .carousel-item { width: calc(-100px); } */ This is my PHP/HTML so far: <?php DB_open_connection_another( "dblink_carousel", "localhost", "xXx_root_xXx", "xxx", "localhost_mod_carousel_v1", "utf8" ); // $dblink_carousel $HTMLOUT .= '<div class="container-fluid">'; $HTMLOUT .= '<div class="row">'; $HTMLOUT .= '<div id="carouselExample" class="carousel slide" data-ride="carousel">'; /* $query = "SELECT * FROM mod_carousel ORDER BY mod_carousel_id DESC"; $result = mysqli_query($dblink_carousel, $query) or die(mysqli_error($dblink_carousel)); $count = 0; $HTMLOUT .= '<ol class="carousel-indicators">'; while($row = mysqli_fetch_array($result)) { # Setup $active = (!$count) ? ' active' : ''; # Output area $HTMLOUT .= '<li data-target="#carouselExample" data-slide-to="'.$count.'" class="'.$active.'"></li>'; $count++; } $HTMLOUT .= '</ol>'; */ $HTMLOUT .= '<div class="carousel-inner" role="listbox">'; $query = "SELECT * FROM mod_carousel ORDER BY mod_carousel_id DESC"; $result = mysqli_query($dblink_carousel, $query) or die(mysqli_error($dblink_carousel)); $count = 0; while($row = mysqli_fetch_array($result)) { # Setup $active = (!$count) ? ' active' : ''; # Output area $HTMLOUT .= '<div class="carousel-item'.$active.'">'; $HTMLOUT .= '<center><img class="img-fluid CUSTOM_CSS_CLASS_carousel_img" src="https://dummyimage.com/1920x1080/fff/0011ff.png&text=Dummy+Image+(1920x1080)" title="Carousel Image" alt="Carousel Image"></center>'; /* $HTMLOUT .= '<div class="carousel-caption">'; $HTMLOUT .= '<h5>'.$row['mod_carousel_title'].'</h5>'; $HTMLOUT .= '<p>'.$row['mod_carousel_description'].'</p>'; $HTMLOUT .= '</div>'; */ $HTMLOUT .= '</div>'; $count++; } $HTMLOUT .= '</div>'; $HTMLOUT .= '<a class="carousel-control-prev" href="#carouselExample" role="button" data-slide="prev">'; $HTMLOUT .= '<span class="carousel-control-prev-icon" aria-hidden="true"></span>'; $HTMLOUT .= '<span class="sr-only">Previous / Forrige</span>'; $HTMLOUT .= '</a>'; $HTMLOUT .= '<a class="carousel-control-next" href="#carouselExample" role="button" data-slide="next">'; $HTMLOUT .= '<span class="carousel-control-next-icon" aria-hidden="true"></span>'; $HTMLOUT .= '<span class="sr-only">Next / Næste</span>'; $HTMLOUT .= '</a>'; $HTMLOUT .= '</div>'; $HTMLOUT .= '</div>'; $HTMLOUT .= '</div>'; ?> If you guys have any ideas on how to proceed from here, i would really appreciate it :) And again, sorry for the messy code, just the way i code :P Thanks in advance! :D
  14. Perfect.. it was the exactly answer i wanted
  15. Hello. Stupid question here. So when i write sql code inside variable, do i need to change it (the variable) everytime or will php be able to see to difference? Lile this: $sql = "select * from users" $result = execute sqk here... $row = output here.. fetch data... $sql = "select * from stars" ... And so forth? Or do i need to change the variable everytime so php can know each different sql code and fetches everytime? Thx in advance.. Ps: writing from a cellphone, sorry if i dont deliver perfect info, so hope you understand the question If not, ask and ill retype the question when home later tonight at my laptop Thanks a lot
  16. ohh sorry, i just thought to be... well... as much info as needed so you guys would not need anything I think i have come up with a new way, i posted a new topic about it in the SQL section. Only problem i have now is that i cannot output anything... but will keep that info in mind next time :P.. Will write again if i need the help Thanks!
  17. Hello W3S - me again... So i have this little peace of code: if( isset($_POST['FORMNAME_submit_search']) ) { $qur = ""; @$SearchKeywords = mysqli_real_escape_string($dblink, $_POST['FORMNAME_SogProfilBar_Keywords']); // Search Bar Profil Keywords @$MinAlder = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinAlder']); // Minimum Alder @$MaxAlder = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxAlder']); // Maximum Alder @$Landsdel = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Landsdel']); // Landsdel @$Kon = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Kon']); // Køn @$MinHojde = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinHojde']); // Minimum Højde @$MaxHojde = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxHojde']); // Maximum Højde @$Etnicitet = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Etnicitet']); // Etnicitet @$Sprog = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Sprog']); // Sprog @$MinVaegt = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinVaegt']); // Minimum Vægt @$MaxVaegt = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxVaegt']); // Maximum Vægt @$Tatoveringer = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Tatoveringer']); // Tatoveringer @$Kategorier = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Kategorier']); // Kategorier // Søgning af ALT starter her. $query = " SELECT users.users_id, any_value(users.users_fornavn), any_value(users.users_mellemnavn), any_value(users.users_efternavn), any_value(users.users_email), any_value(users.users_city), any_value(users.users_zipcode), any_value(users.users_birthday_date), any_value(users.users_address), any_value(users.users_tlf_telefon), any_value(users.users_tlf_mobil), users_info.usersinfo_FK_users_id, any_value(users_info.usersinfo_id), any_value(users_info.usersinfo_profilesearch_viewable), any_value(users_info.usersinfo_hojde_cm), any_value(users_info.usersinfo_vaegt_kg), any_value(users_info.usersinfo_ErfaringKvalifikationer), any_value(users_info.usersinfo_beskaeftigelse), any_value(users_info.usersinfo_FK_usersinfoHairColor_id), any_value(users_info.usersinfo_FK_usersinfoEyeColor_id), any_value(users_info.usersinfo_FK_usersinfoBukseBredde_id), any_value(users_info.usersinfo_FK_usersinfoBukseLaengde_id), any_value(users_info.usersinfo_FK_usersinfoBluseStorrelse_id), any_value(users_info.usersinfo_FK_usersinfoSkoStorrelse_id), any_value(users_info.usersinfo_FK_usersinfoLandsdel_id), any_value(users_info.usersinfo_FK_usersinfoEtnicitet_id), any_value(users_info.usersinfo_FK_usersinfoTatoveringer_id), any_value(users_info.usersinfo_FK_usersinfoKategorier_id), any_value(users_info.usersinfo_FK_usersinfoSprog_id) FROM users INNER JOIN users_info ON users.users_id = users_info.usersinfo_FK_users_id "; // Search patterns - needs editing! from old-original to my version so it fits! include_once("index.search_patterns_setup.php"); // fortsætter herunder $query .= " GROUP BY users_id, usersinfo_FK_users_id"; $result = mysqli_query($dblink, $query) or die(mysqli_error($dblink)); if( mysqli_num_rows($result) > 0 ) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { //echo '<p>her er jeg!</p>'; // indsæt søge resultater her! (DET ING VIIIIRKER!) $output = '<p>'.$query.'</p>'; echo $output; echo '<p>'.$row['users_fornavn'].'</p>'; } } else { $row = '<p>Der var desværre ingen resultater på din søgning. Prøv igen.</p>'; echo $row; $output = '<p>'.$query.'</p>'; echo $output; die(); } } else { include_once("index.no_search_show_cards_profiles.php"); } The small code above is the main file. This code here is where i check for patterns and what has been checked in the form for searching etc... /////////////////////////// ALDER /////////////////////////// if( $MinAlder > 0 ) { echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; // dob = Date Of Birth $time = new DateTime('now'); $newtime = $time->modify('-'.$MinAlder.' year')->format('Y-m-d'); $query .= $clause." users_birthday_date <= '$newtime' "; } if( $MaxAlder > 0 ) { //echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; // dob = Date Of Birth $time = new DateTime('now'); $newtime = $time->modify('-'.$MaxAlder.' year')->format('Y-m-d'); $query .= $clause." users_birthday_date >= '$newtime' "; } /////////////////////////// KØN /////////////////////////// if( !empty($Kon) ) { echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersGender_id = '$Kon' "; } /////////////////////////// LANDSDEL /////////////////////////// if( !empty($Landsdel) ) { echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoLandsdel_id = '$Landsdel' "; } /////////////////////////// ETNICITET /////////////////////////// if( !empty($Etnicitet) ) { echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoEtnicitet_id = '$Etnicitet' "; } /////////////////////////// TATOVERINGER /////////////////////////// if( !empty($Tatoveringer) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoTatoveringer_id = '$Tatoveringer' "; } /////////////////////////// SPROG /////////////////////////// if( !empty($Sprog) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoSprog_id = '$Sprog' "; } /////////////////////////// KATEGORIER /////////////////////////// if( !empty($Kategorier) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoKategorier_id = '$Kategorier' "; } /////////////////////////// VÆGT /////////////////////////// if( $MinVaegt>0 && $MaxVaegt<1 ) { $reg_vaegt_max="999"; } if( $MaxVaegt>0 && $MinVaegt<1 ) { $reg_vaegt_min="1"; } if( $MinVaegt>0 || $MinVaegt>0 ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause."userinfo_vaegt_kg BETWEEN $MinVaegt AND $MaxVaegt "; $clause = " OR "; } /////////////////////////// HØJDE /////////////////////////// if( $MinHojde>0 && $MaxHojde<1 ) { $reg_hoejde_max="999"; } if( $MaxHojde>0 && $MinHojde<1 ) { $reg_hoejde_min="1"; } if( $MinHojde>0 || $MinHojde>0 ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! echo clauseCHECK_AND(); //echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause."usersinfo_hojde_cm BETWEEN $MinHojde AND $MaxHojde "; $clause = " OR "; } /////////////////////////// KEYWORDS /////////////////////////// //if keyword set, goes here if( !$SearchKeywords=="" ) { echo clauseCHECK_AND(); // Initial clause //echo "<p>".clauseCHECK_AND()."</p>"; // Initial clause // search query $c = " users_id LIKE '%$SearchKeywords%' OR users_fornavn LIKE '%$SearchKeywords%' OR users_mellemnavn LIKE '%$SearchKeywords%' OR users_efternavn LIKE '%$SearchKeywords%' "; $query .= $clause." $c"; } Now, i have a little trouble with the latest version of MySQL installed, i always keep getting the error: Expression #12 of SELECT list is not in GROUP BY clause and contains nonaggregated column (...) which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by So i had to change my main SQL a little, which is why i added "any_value()" to my main sql as a temporary solution, and seems to work, only whenever i get an output, i cannot actually row out any output Oo? Whenever i try to output say "users_fornavn", which is Danish for first name... i get index undefined error... any ideas? I can only assume it it the sql that has the error? Hope you guys can help out a little. PS: Note that the "any_value()" part, was only supposed to be a temporary solution for a customer that want's the website up and running somewhere by next week, so i thought to add the any_value() sql function for now and at a later point be more specific about the code. I just need the rough ways for now so i am able to change that at a later point. Thanks in advance! Really hope you peepz can help me out!
  18. at the mysqli queries in the end, see the $conn part... the middle mysqli_query needs an "n" to the $con+n... just to help a bit
  19. Hello W3S! So i have some problems again, hoping you can help me clear it out. I am currently trying to make a search page where a user can search for profiles with different profiles information such as tattoos, height, etc. And i have some difficulties making it work, hoping you can spot some sort of errors that i cannot. Please note that it's been a while since i've been making a fully working searcher with php and sql, so sorry for the messed up code, if so hehe Okay. So i have 6 files, follows as such: 1. index.php (being the main file) - (LOCATION: ROOT/FILE_HERE.php), 2. PAGE_searchprofiles.php (being where the search coding begins AND output is coming) - (LOCATION: ROOT/include/files/www-files/FILE_HERE.php), 3. functions.pagination.class.php (being my pagination class, used on file PAGE_searchprofiles.php) - (LOCATION: ROOT/FILE_HERE.php), 4. functions.php (my php functions into 1 file) - location is root 5. index.search_patterns_setup.php (being used on file PAGE_searchprofiles.php, being where i use if/else statements to compile a proper sql) - location root 6. index.no_search_show_cards_profiles.php (being used on file PAGE_searchprofiles.php, showing ALL profiles if no search has been done so far.) - location root ------------------------------------------- okay, those are file names and locations. the idea is that when there is a search, the searched profiles should be shown, else, show all files. I got that part working perfectly, but now comes the actual search query where i get a little lost (i think). And please take note that this is a search query from a past coder, doing this for a company and this coder has done some terrible coding... i think... i have a hard time seeing what he has done and not. At some places he has done a quite good job, but the search part, not so much. So, i will share the code below here for ALL files, and after that coding, i will write about the problem at hand again. -------------------------------------- index.php <?php ob_start(); session_start(); define("DEFINED_FILE:DEFINES_1", TRUE); require_once("include/files/www-files/random_uncategorized_useful_files/defines.php"); // Defines require_once("include/files/www-files/random_uncategorized_useful_files/report_methods.php"); // Reportings require_once("database/connection.php"); DB_open_main_connection(); // $dblink ?> <!DOCTYPE html> <html lang="da"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Release 1 - Version 1</title> <!-- Bootstrap V.4.0.0 CSS files --> <link rel="stylesheet" href="include/css/bootstrap.min.css" /> <!-- My Custom CSS Files --> <link rel="stylesheet" href="include/css/global_custom_css_design.css" /> <link rel="stylesheet" href="include/css/5.css" /> <link rel="stylesheet" href="include/css/navigation_menu_5.css" /> <!-- other css files --> <link rel="stylesheet" href="include/css/fontawesome-all.min.css"> <!-- Jquery (necessary for Bootstrap's JavaScript plugins) and Bootstrap V.4.0.0 JS Script files --> <script src="include/js/jquery-3.2.1.js"></script> <script src="include/js/bootstrap.min.js"></script> <script src="include/js/bootstrap.bundle.js"></script> <script src="include/js/5.js"></script> </head> <body> <?php # Require Navigation Menu require_once("include/files/www-files/nav-menu.php"); # Including PAGE_signup1.php include_once("include/files/www-files/PAGE_searchprofiles.php"); ?> <div class="mt-3"></div> <?php # Require Footer require_once("include/files/www-files/footer.php"); // close connection $dblink->close(); // MAIN Connection ?> </body> </html> PAGE_searchprofiles.php <?php require_once("functions.php"); //////////////////////////////////////////////////////////////////////////////////////////////////// // Notes //////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------ // comma separeret DB output for ALLE checkboxes (Tatovering & Kategori - vi bruger explode!) //------------------------------------------------------------------------------------------------ /* I DB (users_info) laver jeg en "text" for både kategori og tatovering checkboxes da jeg skal bruge string til comma (sådan forstår jeg det!). Jeg indsætter komma sepereret tal, og bruger php funktionen explode til at sepererer tallene. Jeg bruger senere tallene til at "selecte" ud fra ID hos diverse tabeller, senere hen vise diverse som er blevet vist/valgt/osv. */ //////////////////////////////////////////////////////////////////////////////////////////////////// // Lists //////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------ // FORM - names //------------------------------------------------------------------------------------------------ // my notes: maybe add "multiple" to the select? Style it to be a normale dropdown... look into alternatives! // FORMNAME_SogProfilBar_Keywords (Søg Profil Bar) // FORMNAME_MinAlder (Alder :: Minimum) // FORMNAME_MaxAlder (Alder :: Maximum) // FORMNAME_Landsdel (Landsdel "SelectOption") // FORMNAME_Kon (Køn "SelectOption") // FORMNAME_MinHojde (Højde :: Minimum) // FORMNAME_MaxHojde (Højde :: Maximum) // FORMNAME_Etnicitet (Etnicitet "SelectOption") // FORMNAME_Sprog (Sprog "SelectOption") // FORMNAME_MinVaegt (Vægt :: Minimum) // FORMNAME_MaxVaegt (Vægt :: Maximum) // FORMNAME_Tatoveringer (Tatoveringer "SelectOption") // FORMNAME_Kategorier (Kategorier "SelectOption") // FORMNAME_submit_search (Søg "Submit Button") //------------------------------------------------------------------------------------------------ // Queries - already being used //------------------------------------------------------------------------------------------------ // $query_1 (selecting all data from DB-Table users_info) // $query_2 (Landsdel -> SelectOption) // $query_3 (Køn -> SelectOption) // $query_4 (Etnicitet -> SelectOption) // $query_5 (Sprog -> SelectOption) // $query_6 (Tatoveringer -> SelectOption) // $query_7 (Kategori -> SelectOption) // $query_100 (outputting all cards/profiles to the "profiles" area) //------------------------------------------------------------------------------------------------ // Queries //------------------------------------------------------------------------------------------------ $query_1 = "SELECT * FROM users_info"; $result_1 = mysqli_query($dblink, $query_1) or die ( mysqli_error($dblink) ); $row_1 = mysqli_fetch_array($result_1); ?> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <br /> <h1 class="text-muted text-center">Søg Profiler</h1> </div> </div> </div> <div class="container"> <form method="post" action="index.php"> <div class="row mb-3"> <!-- Søg Profil Bar --> <div class="input-group"> <input type="text" class="form-control" placeholder="Søg Profil" name="FORMNAME_SogProfilBar_Keywords"> <div class="input-group-append"> <button type="submit" class="btn btn-outline-secondary" name="FORMNAME_submit_search">Søg</button> <button type="button" class="btn btn-outline-secondary JQUERY_ACTION_expand_search">Udvid Søgning</button> </div> </div> </div><!-- //.row --> <div class="row"> <div class="container"> <div class="row"> <!-- Min.Alder --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Min.Alder</span> <span class="input-group-text">ÅR</span> </div> <input type="number" class="form-control" placeholder="Min.Alder" min="0" name="FORMNAME_MinAlder"> </div> </div> <!-- Max.Alder --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Max.Alder</span> <span class="input-group-text">ÅR</span> </div> <input type="number" class="form-control" placeholder="Max.Alder" min="0" name="FORMNAME_MaxAlder"> </div> </div> <!-- Landsdel --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_LANDSDEL">Landsdel</label> </div> <select class="custom-select" id="inputGroupSelect_LANDSDEL" name="FORMNAME_Landsdel"> <option selected disabled hidden>Landsdel</option> <?php $query_2 = "SELECT * FROM users_info_landsdel"; $result_2 = mysqli_query($dblink, $query_2) or die ( mysqli_error($dblink) ); while( $row_2 = mysqli_fetch_array($result_2) ) { $selected = ($row_2['usersinfoLandsdel_id'] == $row_1['usersinfo_FK_usersinfoLandsdel_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_2['usersinfoLandsdel_id'].'" '.$selected.'>'.$row_2['usersinfoLandsdel_name'].'</option>'; } ?> </select> </div> </div> <!-- Køn --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_KØN">Køn</label> </div> <select class="custom-select" id="inputGroupSelect_KØN" name="FORMNAME_Kon"> <option selected disabled hidden>Køn</option> <?php $query_3 = "SELECT * FROM users_gender"; $result_3 = mysqli_query($dblink, $query_3) or die ( mysqli_error($dblink) ); while( $row_3 = mysqli_fetch_array($result_3) ) { $selected = ($row_3['usersGender_id'] == $row_1['users_FK_usersGender_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_3['usersGender_id'].'" '.$selected.'>'.$row_3['usersGender_name'].'</option>'; } ?> </select> </div> </div> </div><!-- //.row --> </div><!-- //.container --> </div><!-- //.row --> <div class="row" style="display: none;"> <div class="container mt-3 mb-3"> <div class="row mb-3"> <div class="col-md-3"> &nbsp; </div> <div class="col-md-3"> &nbsp; </div> <div class="col-md-3"> &nbsp; </div> <div class="col-md-3"> <button type="button" class="btn JQUERY_ACTION_minimize_search">Minimer Søgning</button> </div> </div><!-- //.row --> <div class="row mb-3"> <!-- Min.Højde --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Min.Højde</span> <span class="input-group-text">CM</span> </div> <input type="number" class="form-control" placeholder="Min.Højde" min="0" name="FORMNAME_MinHojde"> </div> </div> <!-- Max.Højde --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Max.Højde</span> <span class="input-group-text">CM</span> </div> <input type="number" class="form-control" placeholder="Max.Højde" min="0" name="FORMNAME_MaxHojde"> </div> </div> <!-- Etnicitet --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_ETNICITET">Etnicitet</label> </div> <select class="custom-select" id="inputGroupSelect_ETNICITET" name="FORMNAME_Etnicitet"> <option selected disabled hidden>Etnicitet</option> <?php $query_4 = "SELECT * FROM users_gender"; $result_4 = mysqli_query($dblink, $query_4) or die ( mysqli_error($dblink) ); while( $row_4 = mysqli_fetch_array($result_4) ) { $selected = ($row_4['usersinfoEtnicitet_id'] == $row_1['usersinfo_FK_usersinfoEtnicitet_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_4['usersinfoEtnicitet_id'].'" '.$selected.'>'.$row_4['usersinfoEtnicitet_name'].'</option>'; } ?> </select> </div> </div> <!-- Sprog --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_SPROG">Sprog</label> </div> <select class="custom-select" id="inputGroupSelect_SPROG" name="FORMNAME_Sprog"> <option selected disabled hidden>Sprog</option> <?php $query_5 = "SELECT * FROM users_info_sprog"; $result_5 = mysqli_query($dblink, $query_5) or die ( mysqli_error($dblink) ); while( $row_5 = mysqli_fetch_array($result_5) ) { $selected = ($row_5['usersinfoSprog_id'] == $row_1['usersinfo_FK_usersinfoSprog_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_5['usersinfoSprog_id'].'" '.$selected.'>'.$row_5['usersinfoSprog_name'].'</option>'; } ?> </select> </div> </div> </div><!-- //.row --> <div class="row"> <!-- Min.Vægt --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Min.Vægt</span> <span class="input-group-text">KG</span> </div> <input type="number" class="form-control" placeholder="Min.Vægt" min="0" name="FORMNAME_MinVaegt"> </div> </div> <!-- Max.Vægt --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">Max.Vægt</span> <span class="input-group-text">KG</span> </div> <input type="number" class="form-control" placeholder="Max.Vægt" min="0" name="FORMNAME_MaxVaegt"> </div> </div> <!-- Tatoveringer --> <div class="col-md-3"> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_TATOVERINGER">Tatoveringer</label> </div> <select class="custom-select" id="inputGroupSelect_TATOVERINGER" name="FORMNAME_Tatoveringer"> <option selected disabled hidden>Tatoveringer</option> <?php $query_6 = "SELECT * FROM users_info_tatoveringer"; $result_6 = mysqli_query($dblink, $query_6) or die ( mysqli_error($dblink) ); while( $row_6 = mysqli_fetch_array($result_6) ) { $selected = ($row_6['usersinfoTatoveringer_id'] == $row_1['usersinfo_FK_usersinfoTatoveringer_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_6['usersinfoTatoveringer_id'].'" '.$selected.'>'.$row_6['usersinfoTatoveringer_name'].'</option>'; } ?> </select> </div> </div> <!-- Kategorier --> <div class="col-md-3"> <?php //include_once("include/files/www-files/form_parts/searchprofiles_multiselect/multiselect_kategori.php"); ?> <div class="input-group"> <div class="input-group-prepend"> <label class="input-group-text" for="inputGroupSelect_KATEGORI">Kategorier</label> </div> <select class="custom-select" id="inputGroupSelect_KATEGORI" name="FORMNAME_Kategorier"> <option selected disabled hidden>Kategorier</option> <?php $query_7 = "SELECT * FROM users_info_kategorier"; $result_7 = mysqli_query($dblink, $query_7) or die ( mysqli_error($dblink) ); while( $row_7 = mysqli_fetch_array($result_7) ) { $selected = ($row_7['usersinfoKategorier_id'] == $row_1['usersinfo_FK_usersinfoKategorier_id']) ? 'selected="selected"' : ''; echo '<option value="'.$row_7['usersinfoKategorier_id'].'" '.$selected.'>'.$row_7['usersinfoKategorier_name'].'</option>'; } ?> </select> </div> </div> </div><!-- //.row --> </div><!-- //.container --> </div><!-- //.row (udvidet søgning) --> </form> </div> <div class="mt-3"></div> <div class="container"> <?php if( isset($_POST['FORMNAME_submit_search']) ) { //include_once("functions.pagination.class.php"); // include pagination $qur = ""; @$SearchKeywords = mysqli_real_escape_string($dblink, $_POST['FORMNAME_SogProfilBar_Keywords']); // Search Bar Profil Keywords @$MinAlder = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinAlder']); // Minimum Alder @$MaxAlder = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxAlder']); // Maximum Alder @$Landsdel = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Landsdel']); // Landsdel @$Kon = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Kon']); // Køn @$MinHojde = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinHojde']); // Minimum Højde @$MaxHojde = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxHojde']); // Maximum Højde @$Etnicitet = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Etnicitet']); // Etnicitet @$Sprog = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Sprog']); // Sprog @$MinVaegt = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MinVaegt']); // Minimum Vægt @$MaxVaegt = mysqli_real_escape_string($dblink, $_POST['FORMNAME_MaxVaegt']); // Maximum Vægt @$Tatoveringer = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Tatoveringer']); // Tatoveringer @$Kategorier = mysqli_real_escape_string($dblink, $_POST['FORMNAME_Kategorier']); // Kategorier // Søgning af ALT starter her. $query = "SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'"; $result = mysqli_query($dblink, $query) or die(mysqli_error($dblink)); $query = htmlentities(" SELECT DISTINCT users_id, users_fornavn, users_mellemnavn, users_efternavn, users_email, users_city, users_zipcode, users_birthday_date, users_address, users_tlf_telefon, users_tlf_mobil, usersinfo_profilesearch_viewable, usersinfo_hojde_cm, usersinfo_vaegt_kg, usersinfo_ErfaringKvalifikationer, usersinfo_beskaeftigelse, usersinfo_FK_usersinfoHairColor_id, usersinfo_FK_usersinfoEyeColor_id, usersinfo_FK_usersinfoBukseBredde_id, usersinfo_FK_usersinfoBukseLaengde_id, usersinfo_FK_usersinfoBluseStorrelse_id, usersinfo_FK_usersinfoSkoStorrelse_id, usersinfo_FK_usersinfoLandsdel_id, usersinfo_FK_usersinfoEtnicitet_id, usersinfo_FK_usersinfoTatoveringer_id, usersinfo_FK_usersinfoKategorier_id, usersinfo_FK_usersinfoSprog_id, usersGender_id, usersGender_name, usersinfoLandsdel_id, usersinfoLandsdel_name, usersinfoEtnicitet_id, usersinfoEtnicitet_name, usersinfoTatoveringer_id, usersinfoTatoveringer_name, usersinfoSprog_id, usersinfoSprog_name, usersinfoKategorier_id, usersinfoKategorier_name FROM users INNER JOIN users_info ON users.users_id = users_info.usersinfo_FK_users_id INNER JOIN users_gender ON users.users_FK_usersGender_id = users_gender.usersGender_id INNER JOIN users_info_landsdel ON users_info.usersinfo_FK_usersinfoLandsdel_id = users_info_landsdel.usersinfoLandsdel_id INNER JOIN users_info_etnicitet ON users_info.usersinfo_FK_usersinfoEtnicitet_id = users_info_etnicitet.usersinfoEtnicitet_id INNER JOIN users_info_tatoveringer ON users_info.usersinfo_FK_usersinfoTatoveringer_id = users_info_tatoveringer.usersinfoTatoveringer_id INNER JOIN users_info_sprog ON users_info.usersinfo_FK_usersinfoSprog_id = users_info_sprog.usersinfoSprog_id INNER JOIN users_info_kategorier ON users_info.usersinfo_FK_usersinfoKategorier_id = users_info_kategorier.usersinfoKategorier_id "); // Search patterns - needs editing! from old-original to my version so it fits! include_once("index.search_patterns_setup.php"); // fortsætter herunder $query .= " GROUP BY users_id, usersinfo_FK_users_id"; $result = mysqli_query($dblink, $query) or die(mysqli_error($dblink)); // hvis der ikke er EN række i udtrækket, vises en fejlbesked (??? på search eller ???) //$searchCount=mysqli_num_rows($result); // Behøver jeg denne del (???) // OG START PÅ "<?PHP ?\>" - HTML KOMMER HER IFØLGE TIDLIGERE KODE! (tror jeg skipper den del!) if( mysqli_num_rows($result) > 0 ) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo '<p>her er jeg!</p>'; // indsæt søge resultater her! } } else { $row = '<p>Der var desværre ingen resultater på din søgning. Prøv igen.</p>'; echo '<h3>'.$row.'</h3>'; die(); } } else { //include_once("functions.pagination.class.php"); // include pagination include_once("index.no_search_show_cards_profiles.php"); } ?> </div> <script> $('.JQUERY_ACTION_expand_search').on('click', function () { $(this).parent().parent().parent().next().next().show(1000); }); $('.JQUERY_ACTION_minimize_search').on('click', function () { $(this).parent().parent().parent().parent().hide(1000); }); </script> functions.pagination.class.php <?php class pagination { /* Properties array @var array @access private */ private $_properties = array(); /* Default configurations @var array @access public */ public $_defaults = array( 'page' => 1, 'perPage' => 10 ); /* Constructor @param array $array Array of results to be paginated @param int $curPage The current page interger that should used @param int $perPage The amount of items that should be show per page @return void @access public */ public function __construct($array, $curPage = null, $perPage = null) { $this->array = $array; $this->curPage = ($curPage == null ? $this->defaults['page'] : $curPage); $this->perPage = ($perPage == null ? $this->defaults['perPage'] : $perPage); } /* Global setter Utilises the properties array @param string $name The name of the property to set @param string $value The value that the property is assigned @return void @access public */ public function __set($name, $value) { $this->_properties[$name] = $value; } /* Global getter Takes a param from the properties array if it exists @param string $name The name of the property to get @return mixed Either the property from the internal properties array or false if isn't set @access public */ public function __get($name) { if (array_key_exists($name, $this->_properties)) { return $this->_properties[$name]; } return false; } /* Set the show first and last configuration This will enable the "<< first" and "last >>" style links @param boolean $showFirstAndLast True to show, false to hide. @return void @access public */ public function setShowFirstAndLast($showFirstAndLast) { $this->_showFirstAndLast = $showFirstAndLast; } /* Set the main seperator character By default this will implode an empty string @param string $mainSeperator The seperator between the page numbers @return void @access public */ public function setMainSeperator($mainSeperator) { $this->mainSeperator = $mainSeperator; } /* Get the result portion from the provided array @return array Reduced array with correct calculated offset @access public */ public function getResults() { // Assign the page variable if (empty($this->curPage) !== false) { $this->page = $this->curPage; // using the get method } else { $this->page = 1; // if we don't have a page number then assume we are on the first page } // Take the length of the array $this->length = count($this->array); // Get the number of pages $this->pages = ceil($this->length / $this->perPage); // Calculate the starting point $this->start = ceil(($this->page - 1) * $this->perPage); // return the portion of results return array_slice($this->array, $this->start, $this->perPage); } /* Get the html links for the generated page offset @param array $params A list of parameters (probably get/post) to pass around with each request @return mixed Return description (if any)... @access public */ public function getLinks($params = array()) { // Initiate the links array $plinks = array(); $links = array(); $slinks = array(); // Concatenate the get variables to add to the page numbering string $queryUrl = ''; if (!empty($params) === true ) { unset($params['page']); $queryUrl = '&amp;'.http_build_query($params); } // If we have more then one pages if (($this->pages) > 1) { // Assign the 'previous page' link into the array if we are not on the first page if ($this->page != 1) { if ($this->_showFirstAndLast) { $plinks[] = ' <a href="?page=1'.$queryUrl.'">&laquo;&laquo; First </a> '; } $plinks[] = ' <a href="?page='.($this->page - 1).$queryUrl.'">&laquo; Prev</a> '; } // Assign all the page numbers & links to the array for ($j = 1; $j < ($this->pages + 1); $j++) { if ($this->page == $j) { $links[] = ' <a class="selected">'.$j.'</a> '; // If we are on the same page as the current item } else { $links[] = ' <a href="?page='.$j.$queryUrl.'">'.$j.'</a> '; // add the link to the array } } // Assign the 'next page' if we are not on the last page if ($this->page < $this->pages) { $slinks[] = ' <a href="?page='.($this->page + 1).$queryUrl.'"> Next &raquo; </a> '; if ($this->_showFirstAndLast) { $slinks[] = ' <a href="?page='.($this->pages).$queryUrl.'"> Last &raquo;&raquo; </a> '; } } // Push the array into a string using any some glue return implode(' ', $plinks).implode($this->mainSeperator, $links).implode(' ', $slinks); } return; } } functions.php <?php // clause CHECK AND function // function clauseCHECK_AND () { global $clause; if( isset($clause) ) { $clause = " AND "; //echo "CLAUSE ER WHERE:"; } else { $clause = " WHERE "; } } // clause CHECK OR function // function clauseCHECK_OR () { global $clause; if( isset($clause) ) { $clause = " OR "; //echo "CLAUSE ER WHERE:"; } else { $clause = " WHERE "; } } ?> index.no_search_show_cards_profiles.php <div class="container"> <div class="card-columns"> <?php $query_100 = "SELECT * FROM users ORDER BY users_id DESC"; $result_100 = mysqli_query($dblink, $query_100) or die(mysqli_error($dblink)); if( mysqli_num_rows($result_100) > 0 ) { if( mysqli_num_rows($result_100) > 0 ) { while( $row_100 = mysqli_fetch_array($result_100) ) { $user_id = $row_100['users_id']; $user_fornavn = $row_100['users_fornavn']; $dateOfBirth = $row_100['users_birthday_date']; // output: Y-m-d (Year-Month-Day) $today = date("Y-m-d"); // current date today $diff = date_diff(date_create($dateOfBirth), date_create($today)); // difference between the two dates ?> <div class="card"> <a href="#" title="Profil"> <img class="card-img-top img-responsive img-rounded" src="https://dummyimage.com/250x330/000/fff.jpg" alt="Billede"> </a> <div class="card-body"> <h5 class="card-title"><b><?php echo $user_fornavn.',&nbsp;'.$diff->format('%y'); ?></b></h5> <p class="card-text">#<?php echo $user_id; ?></p> </div><!-- //.card-body --> </div><!-- //.card --> <?php } } } else { echo 'Intet at vise lige nu.'; } ?> </div> </div> index.search_patterns_setup.php <?php /////////////////////////// ALDER /////////////////////////// // ORIGINAL /* if( $minAlder > 0 ) { $time = new DateTime('now'); $newtime = $time->modify('-'.$minAlder.' year')->format('Y-m-d'); //echo $newtime; echo clauseCHECK(); $query .= $clause." user_dob <= '$newtime' "; //$clause .= " OR ";//Change to OR after 1st WHERE } if( $maxAlder > 0 ) { echo clauseCHECK(); $time = new DateTime('now'); $newtime = $time->modify('-'.$maxAlder.' year')->format('Y-m-d'); //echo $newtime; $query .= $clause." user_dob >= '$newtime' "; //$clause .= " OR ";//Change to OR after 1st WHERE } */ // MY VERSION if( $MinAlder > 0 ) { //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; // dob = Date Of Birth $time = new DateTime('now'); $newtime = $time->modify('-'.$MinAlder.' year')->format('Y-m-d'); $query .= $clause." users_birthday_date <= '$newtime' "; } if( $MaxAlder > 0 ) { //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; // dob = Date Of Birth $time = new DateTime('now'); $newtime = $time->modify('-'.$MaxAlder.' year')->format('Y-m-d'); $query .= $clause." users_birthday_date >= '$newtime' "; } /////////////////////////// KØN /////////////////////////// // ORIGINAL /* if( !empty($reg_koen) ) { echo clauseCHECK(); $query .= $clause." user_koen = '$reg_koen' "; //$clause .= " OR ";//Change to OR after 1st WHERE } */ // MY VERSION if( !empty($Kon) ) { //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersGender_id = '$Kon' "; } /////////////////////////// LANDSDEL /////////////////////////// // ORIGINAL /* if( !empty($reg_Landsdel) ) { echo clauseCHECK(); $query .= $clause." user_landsdel = '$reg_Landsdel' "; //$clause .= " OR ";//Change to OR after 1st WHERE } */ // MY VERSION if( !empty($Landsdel) ) { //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoLandsdel_id = '$Landsdel' "; } /////////////////////////// ETNICITET /////////////////////////// // ORIGINAL /* if( !empty($reg_etnic) ) { echo clauseCHECK(); $query .= $clause." user_etnicitet = '$reg_etnic' "; //$clause .= " OR ";//Change to OR after 1st WHERE } */ // MY VERSION if( !empty($Etnicitet) ) { //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoEtnicitet_id = '$Etnicitet' "; } /////////////////////////// TATOVERINGER /////////////////////////// // ORIGINAL /* if( !empty($_POST['check_listTat']) ) { // Loop to store and display values of individual checked checkbox. foreach($_POST['check_listTat'] as $c) { if( !empty($c) ) { echo clauseCHECKor(); $qur = "userPers_fk_tat_id"; $query .= $clause."".$qur." LIKE '%{$c}%'"; //$clause = " OR ";//Change to OR after 1st WHERE } } } */ // MY VERSION if( !empty($Tatoveringer) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoTatoveringer_id = '$Tatoveringer' "; } /////////////////////////// SPROG /////////////////////////// // ORIGINAL /* if( !empty($_POST['check_listSprog']) ) { // Loop to store and display values of individual checked checkbox. foreach($_POST['check_listSprog'] as $c) { if( !empty($c) ) { echo clauseCHECKor(); $qur = "userPers_fk_sprog_id"; $query .= $clause."".$qur." LIKE '%{$c}%'"; $clause = " OR "; //Change to OR after 1st WHERE } } //echo $query;//Remove after testing } */ // MY VERSION if( !empty($Sprog) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoSprog_id = '$Sprog' "; } /////////////////////////// KATEGORIER /////////////////////////// // ORIGINAL /* if( !empty($_POST['check_listKat']) ) { // Loop to store and display values of individual checked checkbox. // Loop to store and display values of individual checked checkbox. foreach($_POST['check_listKat'] as $c) { if( !empty($c) ) { echo clauseCHECKor(); $qur = "userPers_fk_kat_id"; $query .= $clause."".$qur." LIKE '%{$c}%'"; $clause = " OR ";//Change to OR after 1st WHERE } } } */ // MY VERSION if( !empty($Kategorier) ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause." usersinfoKategorier_id = '$Kategorier' "; } /////////////////////////// VÆGT /////////////////////////// // ORIGINAL /* if( $reg_vaegt_min>0 && $reg_vaegt_max<1 ) { $reg_vaegt_max="999"; } if( $reg_vaegt_max>0 && $reg_vaegt_min<1 ) { $reg_vaegt_min="1"; } if( $reg_vaegt_min>0 || $reg_vaegt_min>0 ) { echo clauseCHECK(); //echo "<br><hr><br>HER er vægt.<br><br>"; $query .= $clause."user_vaegt BETWEEN $reg_vaegt_min AND $reg_vaegt_max "; $clause = " OR "; } */ // MY VERSION if( $MinVaegt>0 && $MaxVaegt<1 ) { $reg_vaegt_max="999"; } if( $MaxVaegt>0 && $MinVaegt<1 ) { $reg_vaegt_min="1"; } if( $MinVaegt>0 || $MinVaegt>0 ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause."userinfo_vaegt_kg BETWEEN $MinVaegt AND $MaxVaegt "; $clause = " OR "; } /////////////////////////// HØJDE /////////////////////////// // ORIGINAL /* if( $reg_hoejde_min>0 && $reg_hoejde_max<1 ) { $reg_hoejde_max="999"; } if( $reg_hoejde_max>0 && $reg_hoejde_min<1 ) { $reg_hoejde_min="1"; } if( $reg_hoejde_min>0 || $reg_hoejde_min>0 ) { echo clauseCHECK(); //echo "<br><hr><br>HER er vægt.<br><br>"; $query .= $clause."user_hoejde BETWEEN $reg_hoejde_min AND $reg_hoejde_max "; $clause = " OR "; } */ // MY VERSION if( $MinHojde>0 && $MaxHojde<1 ) { $reg_hoejde_max="999"; } if( $MaxHojde>0 && $MinHojde<1 ) { $reg_hoejde_min="1"; } if( $MinHojde>0 || $MinHojde>0 ) { // når jeg skifter til checkboxes, bruger jeg clauseCHECK_OR()! Som den bruges i de originale! Tjek for eksempler! //echo clauseCHECK_AND(); echo "<p>".clauseCHECK_AND()."</p>"; $query .= $clause."usersinfo_hojde_cm BETWEEN $MinHojde AND $MaxHojde "; $clause = " OR "; } /////////////////////////// KEYWORDS /////////////////////////// // ORIGINAL /* //if keyword set, goes here if( !$keyword=="" ) { echo clauseCHECK();//Initial clause $c=" user_unikID LIKE '%$keyword%' OR user_fornavn LIKE '%$keyword%' OR user_efternavn LIKE '%$keyword%' OR user_faerdigheder LIKE '%$keyword%' OR user_etnicitet LIKE '%$keyword%' OR user_haarfarve LIKE '%$keyword%' OR user_haartype LIKE '%$keyword%' OR user_ojenfarve LIKE '%$keyword%' "; $query .= $clause." $c"; } */ // MY VERSION //if keyword set, goes here if( !$SearchKeywords=="" ) { //echo clauseCHECK_AND(); // Initial clause echo "<p>".clauseCHECK_AND()."</p>"; // Initial clause // unikID = old wwww-files :: ROOT/call/reg_sessioncall.php :: line ~290+ (cirka) // search query /* $c = " user_unikID LIKE '%$SearchKeywords%' OR users_fornavn LIKE '%$SearchKeywords%' OR users_mellemnavn LIKE '%$SearchKeywords%' OR users_efternavn LIKE '%$SearchKeywords%' OR users_faerdigheder LIKE '%$SearchKeywords%' OR user_etnicitet LIKE '%$SearchKeywords%' OR user_haarfarve LIKE '%$SearchKeywords%' OR user_haartype LIKE '%$SearchKeywords%' OR user_ojenfarve LIKE '%$SearchKeywords%' "; */ $c = " user_unikID LIKE '%$SearchKeywords%' OR users_fornavn LIKE '%$SearchKeywords%' OR users_mellemnavn LIKE '%$SearchKeywords%' OR users_efternavn LIKE '%$SearchKeywords%' "; $query .= $clause." $c"; } ?> ----------------------------------------------------------------- Okay, as you might have guessed, the code is a little long. (yay). Okay, so i have "tried" to clean up the past coding the best i could, BUT, here is where i get lost a bit. In the main query on PAGE_searchprofiles.php - am i supposed to make a lot of inner joins? I did that one myself, but wonna make sure BECAUSE! I have a LOT of tables and rows in the DB. I have a main table, users, where basic info is like firstname, etc. Then i have another called users_info, having a lot of integers with 1ns and zeros... those numbers are supposed to go to another table, for each table with Foreign Keys (FK), containing names, etc of forms and so on. I thought it would be better this way for the select at the time, and it was, but also worse for the search query because i have no idea if i am doing that part correct. Also with the file (index.search_patterns_setup.php) - not sure if i do the if/else's correct, since i just reused the old coders parameters and just changed the variables and queries to my database and variable names so they would look perfectly, and they do, only not sure if it's working or not :/ Mostly because whenever i make a search, nothing comes out, no errors either, just no rows. Not sure if i pinpoint the whole thing at different ways with id's etc with inner joins at the main query and the parameters if/else's statements. This is my current DB (query a little bit, but if you can check it out, go for it, just remember, it is in Danish some of it and some in English... combined the 2 languages for some text hehe): -- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Mar 10, 2018 at 10:35 AM -- Server version: 5.7.18 -- PHP Version: 7.1.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `u1d4zzx` -- -- -------------------------------------------------------- -- -- Table structure for table `carousel1` -- CREATE TABLE `carousel1` ( `carousel1_id` int(11) NOT NULL, `carousel1_img_url` text NOT NULL, `carousel1_title` text NOT NULL, `carousel1_description` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `carousel1` -- INSERT INTO `carousel1` (`carousel1_id`, `carousel1_img_url`, `carousel1_title`, `carousel1_description`) VALUES (1, '1.PNG', 'No Title 1', 'No Description 1'), (2, '2.jpg', 'No Title 2', 'No Description 2'), (3, '3.jpg', 'No Title 3', 'No Description 3'), (4, '4.jpeg', 'No Title 4', 'No Description 4'); -- -------------------------------------------------------- -- -- Table structure for table `page_work1_videos` -- CREATE TABLE `page_work1_videos` ( `pw1videos_id` int(11) NOT NULL, `pw1videos_link` text NOT NULL, `pw1videos_director` text NOT NULL, `pw1videos_title` text NOT NULL, `pw1videos_text` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `page_work1_videos` -- INSERT INTO `page_work1_videos` (`pw1videos_id`, `pw1videos_link`, `pw1videos_director`, `pw1videos_title`, `pw1videos_text`) VALUES (6, 'DxiOVmuZyw4', 'Simon Bonde', 'Tuborg Classic', 'All Cast'), (7, 'BDhC7DU0yYE', ' ', 'Hi-Fi Klubben', 'Extras'), (8, 'nN1GLigSw40', 'Jannik Vestmar', 'Krifa', 'All Cast'), (9, 'wBC1WWO9AUc', 'Stevan Treshow', 'Oddset', 'All Cast'), (10, 'FH5cw-n00T8', 'Stevan Treshow', 'Oddset', 'All Cast'), (11, 'L7D1G8vgkEQ', 'Stevan Treshow', 'Oddset', 'All Cast'), (12, '_kASjW_aPbQ', 'Nadia Marquard', 'Emelie Sandé Wonder', 'Cast & Extras'), (14, '0rbA2qBDn8A', ' ', 'Ikano Bank', 'Cast '), (15, 'NYndyqp1gDU', ' ', 'Just Eat', 'All Cast'), (16, 't9diF_GKImA', ' ', 'Just Eat', 'All Cast'), (17, 'zvK8WL43kdY', 'Jonas Elmer', 'Betsafe', 'Cast '), (18, '0bPWGoTRFc0', 'Michael Langhoff', 'Øresundsbroen', 'Extras'), (19, 'MBcU7VCh_MM', 'Michael Langhoff', 'Øresundsbroen', 'Extras'), (20, '_m_KUK6QFS0', 'Michael Langhoff', 'Øresundsbroen', 'Extras'), (21, 'p7QrsVAEwIU', 'Michael Langhoff', 'Øresundsbroen', 'Extras'), (23, 'hmdlCmLrD8A', 'Simon Bonde & Michael Spooner', 'Ladbrokes', 'Cast & Extras'), (29, 'TjHSXd0CcNI', 'Fredrik Callinggard', 'Ofir', 'All Cast'), (30, 'CfAyPqhbeCM', 'Mats Stenberg', 'Casino.dk', 'Ekstra'), (31, 'Aml0d-e6czg', 'Michael Langhoff', 'DayDose', 'Extras'), (32, '5AdMpkKrlDE', '', 'Unibet ', 'Extras'), (33, 'jY-PZ4tMwXU', '', 'Unibet', 'Extras'), (38, '7Cd3UbueGzM', 'Fredrik Callinggard', 'Ofir', 'All Cast'), (42, 'R3JqzsNuer8', 'Gaute Hesthagen ', 'Telenor', 'All Cast'), (46, 'mmHpWlTZEk4', 'Gaute Hesthagen ', 'Telenor', 'All Cast'), (47, 'W3p0yzLc_js', 'Gaute Hesthagen ', 'Telenor', 'All Cast'), (49, '8IIGUBV-jqo', ' ', 'Mobilepay', 'All Cast'), (50, 'MQ_uMGxRvH8', '', 'Bygma', 'Extras'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `users_id` int(11) NOT NULL, `users_ActiveState` int(11) NOT NULL DEFAULT '0', `users_fornavn` varchar(255) NOT NULL, `users_mellemnavn` varchar(255) NOT NULL, `users_efternavn` varchar(255) NOT NULL, `users_email` text NOT NULL, `users_password` text NOT NULL, `users_FK_usersGender_id` int(11) NOT NULL DEFAULT '0', `users_city` varchar(255) NOT NULL, `users_zipcode` int(11) NOT NULL, `users_birthday_date` date DEFAULT NULL, `users_address` text NOT NULL, `users_tlf_telefon` int(11) NOT NULL DEFAULT '0', `users_tlf_mobil` int(11) NOT NULL DEFAULT '0', `users_FK_usersSubscription_id` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users` -- INSERT INTO `users` (`users_id`, `users_ActiveState`, `users_fornavn`, `users_mellemnavn`, `users_efternavn`, `users_email`, `users_password`, `users_FK_usersGender_id`, `users_city`, `users_zipcode`, `users_birthday_date`, `users_address`, `users_tlf_telefon`, `users_tlf_mobil`, `users_FK_usersSubscription_id`) VALUES (2, 1, 'd', 'd', 'd', 'd@yahoo.co.uk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 2, 'FREDERIKSBERG C', 1851, '1992-11-08', 'Nyvej 16, 2TV', 44444444, 44444444, 3), (3, 0, 'dwjioj', 'odj', 'woidjo', 'derp@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 2, 'd C', 1851, '1992-11-08', 'diwjdo, 2TV', 44444444, 44444444, 2), (4, 0, 'Danie', ' ', 'Pedersen', 'd@yahoo.com', '4c65f054573c27e35eefcdd5d6b31091516827fa', 2, 'd C', 1851, '1992-11-08', ' ', 44444444, 44444444, 1), (5, 0, 'Uglen', ' ', 'Elsker', 'demo1@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 1, 'd C', 6666, '1992-11-08', ' ', 44444444, 44444444, 1), (6, 0, 'Ugleerne', ' ', 'Elskerne', 'demo2@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 1, 'd C', 6666, '1992-11-08', ' ', 44444444, 44444444, 1), (7, 0, 'derpy', ' ', 'derp', 'demo3@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 1, 'd C', 2000, '1992-11-08', ' ', 44444444, 51444379, 3), (8, 0, 'wdwe', '', 'dwad', 'demo4@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 1, 'd C', 5151, '2018-12-31', '', 51444379, 44444444, 1), (9, 0, 'wdwe', '', 'dwad', 'demo5@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 1, 'd C', 5151, '2018-12-31', '', 44444444, 51444379, 1), (10, 0, 'Karsten', '', 'Larsen', 'demo7@yahoo.dk', '4c65f054573c27e35eefcdd5d6b31091516827fa', 2, 'd C', 1851, '1992-11-08', '', 51444379, 44444444, 1); -- -------------------------------------------------------- -- -- Table structure for table `users_files` -- CREATE TABLE `users_files` ( `usersFiles_id` int(11) NOT NULL, `usersFiles_FK_users_id` int(11) NOT NULL DEFAULT '0', `usersFiles_avatar_1` text NOT NULL, `usersFiles_image_1` text NOT NULL, `usersFiles_image_2` text NOT NULL, `usersFiles_image_3` text NOT NULL, `usersFiles_image_4` text NOT NULL, `usersFiles_image_5` text NOT NULL, `usersFiles_image_6` text NOT NULL, `usersFiles_image_7` text NOT NULL, `usersFiles_image_8` text NOT NULL, `usersFiles_image_9` text NOT NULL, `usersFiles_image_10` text NOT NULL, `usersFiles_video_1` text NOT NULL, `usersFiles_video_2` text NOT NULL, `usersFiles_video_3` text NOT NULL, `usersFiles_video_4` text NOT NULL, `usersFiles_video_5` text NOT NULL, `usersFiles_video_6` text NOT NULL, `usersFiles_video_7` text NOT NULL, `usersFiles_video_8` text NOT NULL, `usersFiles_video_9` text NOT NULL, `usersFiles_video_10` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_files` -- INSERT INTO `users_files` (`usersFiles_id`, `usersFiles_FK_users_id`, `usersFiles_avatar_1`, `usersFiles_image_1`, `usersFiles_image_2`, `usersFiles_image_3`, `usersFiles_image_4`, `usersFiles_image_5`, `usersFiles_image_6`, `usersFiles_image_7`, `usersFiles_image_8`, `usersFiles_image_9`, `usersFiles_image_10`, `usersFiles_video_1`, `usersFiles_video_2`, `usersFiles_video_3`, `usersFiles_video_4`, `usersFiles_video_5`, `usersFiles_video_6`, `usersFiles_video_7`, `usersFiles_video_8`, `usersFiles_video_9`, `usersFiles_video_10`) VALUES (1, 2, '9e711fd22a826bf711a2f748692cf781.jpg', '', '', '', '', '', '', '', '', '', '16b72540e572da3f3ab5753e6034ab2d--rubber-catsuit-fetish-fashion.jpg', '', '', '', '', '', '', '', 'C3322_B_1.jpg', '', ''), (2, 10, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `users_gender` -- CREATE TABLE `users_gender` ( `usersGender_id` int(11) NOT NULL, `usersGender_name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_gender` -- INSERT INTO `users_gender` (`usersGender_id`, `usersGender_name`) VALUES (1, 'Andet'), (2, 'Mand'), (3, 'Kvinde'); -- -------------------------------------------------------- -- -- Table structure for table `users_info` -- CREATE TABLE `users_info` ( `usersinfo_id` int(11) NOT NULL, `usersinfo_FK_users_id` int(11) NOT NULL DEFAULT '0', `usersinfo_hojde_cm` int(11) NOT NULL DEFAULT '0', `usersinfo_vaegt_kg` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoHairColor_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoEyeColor_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoBukseBredde_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoBukseLaengde_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoBluseStorrelse_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoSkoStorrelse_id` int(11) NOT NULL DEFAULT '0', `usersinfo_ErfaringKvalifikationer` text NOT NULL, `usersinfo_beskaeftigelse` text NOT NULL, `usersinfo_profilesearch_viewable` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoTatoveringer_id` varchar(255) NOT NULL, `usersinfo_FK_usersinfoKategorier_id` varchar(255) NOT NULL, `usersinfo_FK_usersinfoSprog_id` varchar(255) NOT NULL, `usersinfo_FK_usersinfoLandsdel_id` int(11) NOT NULL DEFAULT '0', `usersinfo_FK_usersinfoEtnicitet_id` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info` -- INSERT INTO `users_info` (`usersinfo_id`, `usersinfo_FK_users_id`, `usersinfo_hojde_cm`, `usersinfo_vaegt_kg`, `usersinfo_FK_usersinfoHairColor_id`, `usersinfo_FK_usersinfoEyeColor_id`, `usersinfo_FK_usersinfoBukseBredde_id`, `usersinfo_FK_usersinfoBukseLaengde_id`, `usersinfo_FK_usersinfoBluseStorrelse_id`, `usersinfo_FK_usersinfoSkoStorrelse_id`, `usersinfo_ErfaringKvalifikationer`, `usersinfo_beskaeftigelse`, `usersinfo_profilesearch_viewable`, `usersinfo_FK_usersinfoTatoveringer_id`, `usersinfo_FK_usersinfoKategorier_id`, `usersinfo_FK_usersinfoSprog_id`, `usersinfo_FK_usersinfoLandsdel_id`, `usersinfo_FK_usersinfoEtnicitet_id`) VALUES (1, 2, 176, 130, 4, 1, 14, 21, 6, 29, ' Info tekst mangler. ', ' Info tekst mangler. ', 0, '', '', '', 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `users_info_bluse_storrelse` -- CREATE TABLE `users_info_bluse_storrelse` ( `usersinfoBluseStorrelse_id` int(11) NOT NULL, `usersinfoBluseStorrelse_storrelse` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_bluse_storrelse` -- INSERT INTO `users_info_bluse_storrelse` (`usersinfoBluseStorrelse_id`, `usersinfoBluseStorrelse_storrelse`) VALUES (1, 'X-Small'), (2, 'Small'), (3, 'Medium'), (4, 'Large'), (5, 'X-Large'), (6, 'XX-Large'), (7, 'XXX-Large'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_bukse_bredde` -- CREATE TABLE `users_info_bukse_bredde` ( `usersinfoBukseBredde_id` int(11) NOT NULL, `usersinfoBukseBredde_bredde` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_bukse_bredde` -- INSERT INTO `users_info_bukse_bredde` (`usersinfoBukseBredde_id`, `usersinfoBukseBredde_bredde`) VALUES (1, 24), (2, 25), (3, 26), (4, 27), (5, 28), (6, 29), (7, 30), (8, 31), (9, 32), (10, 33), (11, 34), (12, 35), (13, 36), (14, 37), (15, 38), (16, 39), (17, 40), (18, 41), (19, 42), (20, 43), (21, 44), (22, 45); -- -------------------------------------------------------- -- -- Table structure for table `users_info_bukse_laengde` -- CREATE TABLE `users_info_bukse_laengde` ( `usersinfoBukseLaengde_id` int(11) NOT NULL, `usersinfoBukseLaengde_laengde` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_bukse_laengde` -- INSERT INTO `users_info_bukse_laengde` (`usersinfoBukseLaengde_id`, `usersinfoBukseLaengde_laengde`) VALUES (1, 24), (2, 25), (3, 26), (4, 27), (5, 28), (6, 29), (7, 30), (8, 31), (9, 32), (10, 33), (11, 34), (12, 35), (13, 36), (14, 37), (15, 38), (16, 39), (17, 40), (18, 41), (19, 42), (20, 43), (21, 44), (22, 45), (23, 46), (24, 47), (25, 48); -- -------------------------------------------------------- -- -- Table structure for table `users_info_etnicitet` -- CREATE TABLE `users_info_etnicitet` ( `usersinfoEtnicitet_id` int(11) NOT NULL, `usersinfoEtnicitet_name` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `users_info_eye_color` -- CREATE TABLE `users_info_eye_color` ( `usersinfoEyeColor_id` int(11) NOT NULL, `usersinfoEyeColor_name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_eye_color` -- INSERT INTO `users_info_eye_color` (`usersinfoEyeColor_id`, `usersinfoEyeColor_name`) VALUES (1, 'Blå'), (2, 'Grønne'), (3, 'Brune'), (4, 'Grå'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_hair_color` -- CREATE TABLE `users_info_hair_color` ( `usersinfoHairColor_id` int(11) NOT NULL, `usersinfoHairColor_color` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_hair_color` -- INSERT INTO `users_info_hair_color` (`usersinfoHairColor_id`, `usersinfoHairColor_color`) VALUES (1, 'Hvidt'), (2, 'Platinblond'), (3, 'Lysblond'), (4, 'Mellemblond'), (5, 'Mørkeblond'), (6, 'Rødblond'), (7, 'Rød'), (8, 'Lysebrunt'), (9, 'Brunt'), (10, 'Mørkebrunt'), (11, 'Sort'), (12, 'Gråt'), (13, 'Grå stænk'), (14, 'Anden'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_kategorier` -- CREATE TABLE `users_info_kategorier` ( `usersinfoKategorier_id` int(11) NOT NULL, `usersinfoKategorier_name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_kategorier` -- INSERT INTO `users_info_kategorier` (`usersinfoKategorier_id`, `usersinfoKategorier_name`) VALUES (1, 'Uddannet skuespiller'), (2, 'Autodidakt skuespiller'), (3, 'Ingen erfaring (indenfor film, reklamer, TV)'), (4, 'Statist'), (5, 'Sanger'), (6, 'Danser'), (7, 'Tvilling'), (8, 'Mor til børn'), (9, 'Far til børn'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_landsdel` -- CREATE TABLE `users_info_landsdel` ( `usersinfoLandsdel_id` int(11) NOT NULL, `usersinfoLandsdel_name` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_landsdel` -- INSERT INTO `users_info_landsdel` (`usersinfoLandsdel_id`, `usersinfoLandsdel_name`) VALUES (1, 'Sjælland'), (2, 'Jylland'), (3, 'Odense'), (4, 'Bornholm'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_sko_storrelse` -- CREATE TABLE `users_info_sko_storrelse` ( `usersinfoSkoStorrelse_id` int(11) NOT NULL, `usersinfoSkoStorrelse_storrelse` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_sko_storrelse` -- INSERT INTO `users_info_sko_storrelse` (`usersinfoSkoStorrelse_id`, `usersinfoSkoStorrelse_storrelse`) VALUES (1, 17), (2, 18), (3, 19), (4, 20), (5, 21), (6, 22), (7, 23), (8, 24), (9, 25), (10, 26), (11, 27), (12, 28), (13, 29), (14, 30), (15, 31), (16, 32), (17, 33), (18, 34), (19, 35), (20, 36), (21, 37), (22, 38), (23, 39), (24, 40), (25, 41), (26, 42), (27, 43), (28, 44), (29, 45), (30, 46), (31, 47), (32, 48), (33, 49), (34, 50); -- -------------------------------------------------------- -- -- Table structure for table `users_info_sprog` -- CREATE TABLE `users_info_sprog` ( `usersinfoSprog_id` int(11) NOT NULL, `usersinfoSprog_name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_info_sprog` -- INSERT INTO `users_info_sprog` (`usersinfoSprog_id`, `usersinfoSprog_name`) VALUES (1, 'Dansk'), (2, 'Engelsk (US)'), (3, 'Engelsk (UK)'), (4, 'Norsk'), (5, 'Svensk'), (6, 'Tysk'), (7, 'Fransk'); -- -------------------------------------------------------- -- -- Table structure for table `users_info_tatoveringer` -- CREATE TABLE `users_info_tatoveringer` ( `usersinfoTatoveringer_id` int(11) NOT NULL, `usersinfoTatoveringer_name` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `users_subscription` -- CREATE TABLE `users_subscription` ( `usersSubscription_id` int(11) NOT NULL, `usersSubscription_name` varchar(255) NOT NULL, `usersSubscription_months` int(11) NOT NULL DEFAULT '0', `usersSubscription_price` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `users_subscription` -- INSERT INTO `users_subscription` (`usersSubscription_id`, `usersSubscription_name`, `usersSubscription_months`, `usersSubscription_price`) VALUES (1, '1 MDR 35,-', 1, 35), (2, '6 MDR 198,-', 6, 198), (3, '12 MDR 349,-', 12, 349); -- -- Indexes for dumped tables -- -- -- Indexes for table `carousel1` -- ALTER TABLE `carousel1` ADD PRIMARY KEY (`carousel1_id`); -- -- Indexes for table `page_work1_videos` -- ALTER TABLE `page_work1_videos` ADD PRIMARY KEY (`pw1videos_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`users_id`); -- -- Indexes for table `users_files` -- ALTER TABLE `users_files` ADD PRIMARY KEY (`usersFiles_id`); -- -- Indexes for table `users_gender` -- ALTER TABLE `users_gender` ADD PRIMARY KEY (`usersGender_id`); -- -- Indexes for table `users_info` -- ALTER TABLE `users_info` ADD PRIMARY KEY (`usersinfo_id`); -- -- Indexes for table `users_info_bluse_storrelse` -- ALTER TABLE `users_info_bluse_storrelse` ADD PRIMARY KEY (`usersinfoBluseStorrelse_id`); -- -- Indexes for table `users_info_bukse_bredde` -- ALTER TABLE `users_info_bukse_bredde` ADD PRIMARY KEY (`usersinfoBukseBredde_id`); -- -- Indexes for table `users_info_bukse_laengde` -- ALTER TABLE `users_info_bukse_laengde` ADD PRIMARY KEY (`usersinfoBukseLaengde_id`); -- -- Indexes for table `users_info_etnicitet` -- ALTER TABLE `users_info_etnicitet` ADD PRIMARY KEY (`usersinfoEtnicitet_id`); -- -- Indexes for table `users_info_eye_color` -- ALTER TABLE `users_info_eye_color` ADD PRIMARY KEY (`usersinfoEyeColor_id`); -- -- Indexes for table `users_info_hair_color` -- ALTER TABLE `users_info_hair_color` ADD PRIMARY KEY (`usersinfoHairColor_id`); -- -- Indexes for table `users_info_kategorier` -- ALTER TABLE `users_info_kategorier` ADD PRIMARY KEY (`usersinfoKategorier_id`); -- -- Indexes for table `users_info_landsdel` -- ALTER TABLE `users_info_landsdel` ADD PRIMARY KEY (`usersinfoLandsdel_id`); -- -- Indexes for table `users_info_sko_storrelse` -- ALTER TABLE `users_info_sko_storrelse` ADD PRIMARY KEY (`usersinfoSkoStorrelse_id`); -- -- Indexes for table `users_info_sprog` -- ALTER TABLE `users_info_sprog` ADD PRIMARY KEY (`usersinfoSprog_id`); -- -- Indexes for table `users_info_tatoveringer` -- ALTER TABLE `users_info_tatoveringer` ADD PRIMARY KEY (`usersinfoTatoveringer_id`); -- -- Indexes for table `users_subscription` -- ALTER TABLE `users_subscription` ADD PRIMARY KEY (`usersSubscription_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `carousel1` -- ALTER TABLE `carousel1` MODIFY `carousel1_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `page_work1_videos` -- ALTER TABLE `page_work1_videos` MODIFY `pw1videos_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `users_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `users_files` -- ALTER TABLE `users_files` MODIFY `usersFiles_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users_gender` -- ALTER TABLE `users_gender` MODIFY `usersGender_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users_info` -- ALTER TABLE `users_info` MODIFY `usersinfo_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `users_info_bluse_storrelse` -- ALTER TABLE `users_info_bluse_storrelse` MODIFY `usersinfoBluseStorrelse_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `users_info_bukse_bredde` -- ALTER TABLE `users_info_bukse_bredde` MODIFY `usersinfoBukseBredde_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -- -- AUTO_INCREMENT for table `users_info_bukse_laengde` -- ALTER TABLE `users_info_bukse_laengde` MODIFY `usersinfoBukseLaengde_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `users_info_etnicitet` -- ALTER TABLE `users_info_etnicitet` MODIFY `usersinfoEtnicitet_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_info_eye_color` -- ALTER TABLE `users_info_eye_color` MODIFY `usersinfoEyeColor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `users_info_hair_color` -- ALTER TABLE `users_info_hair_color` MODIFY `usersinfoHairColor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `users_info_kategorier` -- ALTER TABLE `users_info_kategorier` MODIFY `usersinfoKategorier_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `users_info_landsdel` -- ALTER TABLE `users_info_landsdel` MODIFY `usersinfoLandsdel_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `users_info_sko_storrelse` -- ALTER TABLE `users_info_sko_storrelse` MODIFY `usersinfoSkoStorrelse_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `users_info_sprog` -- ALTER TABLE `users_info_sprog` MODIFY `usersinfoSprog_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `users_info_tatoveringer` -- ALTER TABLE `users_info_tatoveringer` MODIFY `usersinfoTatoveringer_id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_subscription` -- ALTER TABLE `users_subscription` MODIFY `usersSubscription_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; please note with this SQL, i have removed some names pre-made But that is my SQL never the less. Hoping you can help. And it is to my believes that it is with the queries my problems are, mainly, unsure about the if/else's statements, they look good to my eye, it is mostly the SQL i am not the best at making when it comes to searchers. Hope you can help, as always, thanks, and sorry if i left any info out. Please ask if you need more information! Thanks again!
  20. SWEET MOTHER OF GOD! IT'S ALIVE! Thanks! One last question tho... whenever i close the modal, it won't stop playing unless i re-enter the modal... possible to stop the play on close? Also how to auto-play on modal showing? Thanks a lot!
  21. i have done now, still won't work :/ This is driving me nuts -.-'... tried to add the text after we spoke, just to see if anything... and i got nada
  22. in case you wanna see a live version, this is the website i'm currently working on (DEMO VERSION) https://callbackcasting.dk/demo/work.php if you can see something that i cannot, please tell Will write to you in the morning if i got something thanks for getting me this far.. talk tomorrow
  23. it is like this: Aml0d-e6czg okay will try on a normal html page. But i assume even if i try on a normal html/php page, the <script> code would be the same correct? Just to see if it actually acts dynamically And sorry for me being stupid... still not sure how to work on the jQuery hahaha But will try and if it won't work ill post either here or making a new thread tomorrow
  24. funny thing, tried to add your code and in the iframe src, it says "src(unknown)"... it's like it dosen't get the data. Is it possible i need to set the script somewhere else on the page?
  25. hmm... i am using bootstrap 4, looks the same to me, or just about anyways.. not sure how else to controle it :/
×
×
  • Create New...