Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

18 Good

About rootKID

  • Rank
  • Birthday 11/08/1992

Previous Fields

  • Languages
    PHP, CSS, HTML, JavaScript, jQuery, MySQL, MySQLI

Profile Information

  • Gender
  • Location
  • Interests
    HTML, CSS, Photoshop, PHP, jQuery, JavaScript, Ajax, MySQL, MySQLI, Movies, Gaming, Music, American Football, Homework

Recent Profile Visitors

11,046 profile views
  1. so, me and a friend have this website: https://pizza1.pizzabix.dk/pizzaer/62-117-9-italiano.html#/29-storrelse-almindelig Currently, im adding CUSTOM JS to the PrestaShop via this file here: https://pizza1.pizzabix.dk/themes/classic/assets/js/custom.js At the very bottom of the file, beneath the comment (Product Normal/Family Size on Product Details Page - Show/Hide on change) i have this code here: $(function () { // "29" == (Normal Size) // #an_productfields_1_id == (Normal Size) // "30" == (Family Size) // #an_productfields_2_id == (Family Size) // #group_6 == SELECTION/DropDown Form Box //$("#an_productfields_1_id").hide(); // Normal Size (hide instantly) //$("#an_productfields_2_id").hide(); // Family Size (hide instantly) $("#group_6").change(function () { if ($("#group_6").val() == "29") { // Normal Size $("#an_productfields_1_id").show(); } else { $("#an_productfields_1_id").hide(); } if ($("#group_6").val() == "30") { // Family Size $("#an_productfields_2_id").show(); } else { $("#an_productfields_2_id").hide(); } }); }); and i almost got it working, however! As u try it on the website, and i for example take the (Almindelig) value from the select box, it dosent shows the very first time... but when i change to Family Size, nothing happens on the second choise! And same goes for the other way around. When i select (Familie) on first try, it works, hides the "normal sizes / almindelig", and shows family... any ideas as to why it does this? I should have used the propper code i think... i got a peace of the code form this linke by searching google: http://jsfiddle.net/Y3pW9/ https://stackoverflow.com/questions/18572401/jquery-select-change-show-hide-div-event If you could possibly tell me what im doing wrong and what i could do in future cases, i would be very happy! Also, i did consider using "toggle" from jQuery, but not sure hos to use that just yet so i went with this option since i got the most experience (so to speak) with this one... in anyways, i hope you guys can help me out, as always! :D Thanks in advance! Looking foreword for a reply... very... VERY... patiently ;)
  2. Hi sry for late reply as always. Actually the API part sounds like a good idea, but in case i cant find any with theese services, where should i look as to how to implement IMAP services? Done this through CPanel b4 but never by php code? Is this not done to server only? Or is it possible to actually use IMAP to do this stuff on something like front-end on a server and to interact like the way i intended? thx in advance
  3. Good option, problem is that i've never personaly created API's before. I know it is one option, and a popular one at best, so would maybe need help for the beginning. Can you refer me to a guide somewhere online possibly? Thanks in advance!
  4. Hello, been a while. This is as much a hyperthetical question as it is a general question for how to do this best, security wise. So me and a friend is soon to launch a project we wonna sell out to people, however, we have 2 databases to take into consideration. Our customers localhost database, and our database at our own domain name (not online yet! will soon!). The idea is that whenever, on a customers website, a person orders say a pizza, that pizza order will be placed in their database. HOWEVER! That order will also be counted into our database as a sort of receipt. We sell our website based on how much that specific website gets of orders and we get x-% amount of those orders and so on. My questions is. What to take into consideration and how to do this best? Because right now we have: index.php (one file to rule them all............ basically we only have one file :P) up_order.php (upload order to database"s") Now, from what im thinking, the up_order.php file would contain the database to OUR domain (of course)! But since all of these files are gonna be placed on our customers localhost service online on their own website domain and so on, we of course don't want our PERSONAL database login information being on their website!? So what do take into consideration when doing this, and what ways to best protect ourselves from any attacks and other stuff? One thing i have already considered, are to have 2 seperated database logins somehow. One main-login for our database we use for whatever reason, and another that can ONLY INSERT and MAYBE also UPDATE... but we are afraid if we put the "UPDATE" part into the secondary user login we would use for user customers, they (or any hackers for that matter) are still able to use that somehow to change whatever they want inside our database, should they get access? The reason we also consider the UPDATE part, is that if the specific restaurant wants to make changes to a customers order, we should also be able to see this so whenever we bill those customers, we dont send them bills based on some order they maybe did not deliver for some weird reason (of course... would not make sense) In any ways, if you guys knows what type of approaches to take the best and what to take into consideration, i would LOVE you for these information! Maybe considering encrypted information somehow to be used in a database connection? In either way, hoping you can guide me with both information, tutorials or just in general information of what i should read up upon. Thanks in advance! PS: Not sure if this is the right place for me to post this, but hoping it is. If not, then please [ADMIN's], move it to the right location. Again. Thanks! ❤️
  5. Hi, this is a quick one. Is it somehow possible to "show" the mails i GET on my mails on my server/domain? I know some ppl do this... but never seen any code for this out there Oo? Asking bcoz i would like to try and insert this into my project portfolio somehow :D thanks in advanse! :D
  6. ok got it, thanks for information ^^'
  7. Hi W3S! Been a while! So, i have a question in relation to an if/else statement. It has been a while since ive build websites and want back in the game. i came across a cms system last night, relatively new, it's one of my friends local build im checking out. In an if/else statement, he is putting something like this down: !@( $GLOBALS["{$DB['globals']}"] = mysqli_connect( $DB['host'], $DB['user'], $DB['password'] ) ) Now i know everything inside of the if/else statement, but why the "!@" in the if statement in front of it? Is it just not enough with the "!" sign? Thanks in advance for clarification Regards, rootKID.
  8. just the thing is that when i tried that... to find a link to edit my post... i could not find the link... is it because the posts are wayyy too outdated orr? Because i could find no link at all 😕
  9. Well i have gotten the normal naming to work now, but it still won't for some reason add in the array 😕 This is my current code... ## BETA STAGE OF FUNCTIONS - DO NOT USE YET PUBLIC! - V1 // Cookie Setup $SETTINGS['cookie_prefix'] = ''; // This allows you to have multiple trackers, eg for demos, testing etc. $SETTINGS['cookie_path'] = ''; // ATTENTION: You should never need this unless the above applies eg: /projectname $SETTINGS['cookie_domain'] = ''; // set to eg: .somedomain.com or is subdomain set to: .sub.somedomain.com //========================================================================================================== // (COOKIE LOGIN) // -> User Data Flow (FUNCTION NAME: "LOGIN_COOKIE_user_data_flow_v1") // makes & creates $CURUSER! and created db flow with user information! ////////////////////////////////////////////////////////////////////////////////////////////////////////// // Also Known As: (COOKIE_BASED_LOGIN_) // Also Known As: (LOGIN_COOKIE_) //========================================================================================================== function LOGIN_COOKIE_user_data_flow_v1(){ global $dblink, $SETTINGS; unset($GLOBALS["CURUSER"]); if( !LOGIN_COOKIE_get_cookie_v1('id') && !LOGIN_COOKIE_get_cookie_v1('username') && !LOGIN_COOKIE_get_cookie_v1('email') && !LOGIN_COOKIE_get_cookie_v1('password') ){ return FALSE; } $id = 0 + LOGIN_COOKIE_get_cookie_v1('id'); $sql_1 = " SELECT user.id, user.username, user.email, user.password, user.FK_user_details_id FROM user WHERE user.id = '$id' "; $result_1 = $dblink->query($sql_1) or die($dblink->error); $row_1 = $result_1->fetch_assoc(); if(!$row_1){ return FALSE; } $GLOBALS["CURUSER"] = $row_1; return TRUE; } //========================================================================================================== // (COOKIE LOGIN) // -> Set Cookie (FUNCTION NAME: "LOGIN_COOKIE_set_cookie_v1") ////////////////////////////////////////////////////////////////////////////////////////////////////////// // Also Known As: (COOKIE_BASED_LOGIN_) // Also Known As: (LOGIN_COOKIE_) //========================================================================================================== function LOGIN_COOKIE_set_cookie_v1( $name, $value, $expires = 0, $sticky = 1 ){ global $SETTINGS; if($sticky == 1){ $expire_time = time() + 60*60*24*365; } else if($expires){ $expire_time = time() + ($expires*86400); } else { $expire_time = FALSE; } $SETTINGS['cookie_domain'] = $SETTINGS['cookie_domain'] == "" ? "" : $SETTINGS['cookie_domain']; $SETTINGS['cookie_path'] = $SETTINGS['cookie_path'] == "" ? "/" : $SETTINGS['cookie_path']; if(PHP_VERSION < 5.2){ if ($SETTINGS['cookie_domain']){ @setcookie( // ['USER_COOKIE_LOGIN']['USER_DATA_FLOW'][$SETTINGS['cookie_prefix'].$name], // '[USER_COOKIE_LOGIN][USER_DATA_FLOW]'.$SETTINGS['cookie_prefix'].$name, //"[USER_COOKIE_LOGIN][USER_DATA_FLOW]".$SETTINGS['cookie_prefix'].$name, $SETTINGS['cookie_prefix'].$name, $value, $expire_time, $SETTINGS['cookie_path'], $SETTINGS['cookie_domain'].'; HttpOnly' ); } else { @setcookie( // ['USER_COOKIE_LOGIN']['USER_DATA_FLOW'][$SETTINGS['cookie_prefix'].$name], // '[USER_COOKIE_LOGIN][USER_DATA_FLOW]'.$SETTINGS['cookie_prefix'].$name, //"[USER_COOKIE_LOGIN][USER_DATA_FLOW]".$SETTINGS['cookie_prefix'].$name, $SETTINGS['cookie_prefix'].$name, $value, $expire_time, $SETTINGS['cookie_path'] ); } } else { @setcookie( // ['USER_COOKIE_LOGIN']['USER_DATA_FLOW'][$SETTINGS['cookie_prefix'].$name], // '[USER_COOKIE_LOGIN][USER_DATA_FLOW]'.$SETTINGS['cookie_prefix'].$name, //"[USER_COOKIE_LOGIN][USER_DATA_FLOW]".$SETTINGS['cookie_prefix'].$name, $SETTINGS['cookie_prefix'].$name, $value, $expire_time, $SETTINGS['cookie_path'], $SETTINGS['cookie_domain'], NULL, TRUE ); } } //========================================================================================================== // (COOKIE LOGIN) // -> Get Cookie (FUNCTION NAME: "LOGIN_COOKIE_get_cookie_v1") ////////////////////////////////////////////////////////////////////////////////////////////////////////// // Also Known As: (COOKIE_BASED_LOGIN_) // Also Known As: (LOGIN_COOKIE_) //========================================================================================================== function LOGIN_COOKIE_get_cookie_v1( $name ){ global $SETTINGS; // $SETTINGS['cookie_prefix'].$name // $_COOKIE[] // $_COOKIE[ "[USER_COOKIE_LOGIN][USER_DATA_FLOW]" . $SETTINGS['cookie_prefix'].$name ] // $_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] if( isset( $_COOKIE[ $SETTINGS['cookie_prefix'].$name ] //$_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ) AND !empty( $_COOKIE[ $SETTINGS['cookie_prefix'].$name ] //$_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ) ){ return urldecode( $_COOKIE[ $SETTINGS['cookie_prefix'].$name ] //$_COOKIE[ '[USER_COOKIE_LOGIN][USER_DATA_FLOW]' . $SETTINGS['cookie_prefix'].$name ] ); } else { return FALSE; } } //========================================================================================================== // (COOKIE LOGIN) // -> Logout Cookie (FUNCTION NAME: "LOGIN_COOKIE_logout_cookie_v1") ////////////////////////////////////////////////////////////////////////////////////////////////////////// // Also Known As: (COOKIE_BASED_LOGIN_) // Also Known As: (LOGIN_COOKIE_) //========================================================================================================== function LOGIN_COOKIE_logout_cookie_v1( $name ){ LOGIN_COOKIE_set_cookie_v1($name, '-1'); } Any ideas on what i can do to change this?
  10. 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... 😕
  11. 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!
  12. 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!
  13. 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!
  14. 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?
  15. 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!
  • Create New...