Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by rootKID

  1. why the damn (')?

    ok fail i have fixed the problem haha Thx a lot guys!
  2. why the damn (')?

    hey W3S! Been a while! Anyhow, i have a question regarding my SQL... not sure, since it's been a while. So i am running latest version of WinginX with PHP 7.1 and PhpMyAdmin latest version all... i tried to run this SQL, which usually works: SELECT p1_c_c_id AS id, p1_c_c_name AS name, p1_c_c_level AS level, p1_c_c_order AS order FROM plugin1_class_categories ORDER BY order ASC and i got the error below: Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in <path> Stack trace: #0 {main} thrown in <path> on line 131 so then i went nuts and went to the PhpMyAdmin sql builder and it builded this for me: SELECT `p1_c_c_id` AS `id`, `p1_c_c_name` AS `name`, `p1_c_c_level` AS `level`, `p1_c_c_order` AS `order` FROM `plugin1_class_categories` ORDER BY `p1_c_c_order` ASC and that works? Only difference is the plinges... the (')... why? The other one usually works also right? Or am i remembering wrong? Tried to read a little bit about it but gave no sence since it's been a while with everything hehe Well thanks if you can help me anyways! Thanks in advance!
  3. why the damn (')?

    hmm... i tried to remove to ORDER from the SQL also but didn't work for some reason, which is why i'm kinda confused.. should be working. Or at least that is what i remember that it should :/...
  4. login dosent work, code correct?

    Hi W3S I am trying to make a login PHP code with MySQLI and it won't work for some reason, not sure what i have done wrong, can someone see what i did wrong? This is the code: //////////////////////////////////////////////////////////////////////////////////////////////////////// // Login //////////////////////////////////////////////////////////////////////////////////////////////////////// $SUBMIT_FORM_ACTION___TakeLoginForm = (isset($_GET["SUBMIT_FORM_ACTION"]) ? $_GET["SUBMIT_FORM_ACTION"] : ""); if( $SUBMIT_FORM_ACTION___TakeLoginForm == "TakeLogin" ) { $query_1 = "SELECT u_id, u_username, u_password, u_email FROM users WHERE u_email=? AND u_password=?"; if ( $stmt = $mysqli->prepare($query_1) ) { $FORM_email = $_POST['email']; $FORM_password = $_POST['password']; $stmt->bind_param('ss', $FORM_email, $FORM_password); $stmt->execute(); $stmt->bind_result($id, $username, $password, $email); $stmt->fetch(); // SECURITY! CHECK & COMPARE! if($FORM_password !== $password) { die(" <center><b>(Form) Login ErrMSG #1</b></center> <br /> <center>Password incorrect/wrong! Try again!</center> "); } // Make Sessions Needed! $_SESSION['user'] = array(); $_SESSION['user']['id'] = $id; $_SESSION['user']['username'] = $username; $_SESSION['user']['password'] = $password; $_SESSION['user']['email'] = $email; $stmt->close(); //header("location: index.php"); } } okay so lets see if i get this straight. In the bind_result part, this does not matter what kind of variable it is right? In the naming part... or does the names actual HAS to be like the ones in the Database Columns? I somehow think its the part there but correct me if i am wrong... Hoping someone can help me a little bit. Thanks in advance
  5. login dosent work, code correct?

    Thanks for the answer, but really cannot figure out what is wrong with my code? I have started both session_start() and ob_start() with gzip... i am checking if the user is already logged in and yet no action (this is a function a little bit earlier in the code, nothing wrong, used it many other places before).. Any ideas? And ohh, thanks for the correction btw.. still a little new to the mysqli part haha And for future notice, the password checking was really only an example.. gonna remove it when done with all code hehe, but thanks for the info
  6. crypt() is NOT an encryption function

    okay i know it's been a while, but thanks lol hehe, just seen this today "2 years from now", lol haha
  7. Hello W3S! Been a while, as always I am sure i have asked of this before, but since my USB-Flash has been stolen in the school by someone, i am about to re-do a lot of projects and i cannot find the other posts on this website for some reason (my past post), so here i "probably" ask again in the hopes of you guys helping me a little bit. I know how to make a simple <select> filled with values, but i want some content (div-box with class content) to be shown AFTER a specific thing has been selected from the select-form. What do i need to use here? I could imagine some sort of JS/jQuery code combined with PHP? And if so, can someone guide me to the right path of where to look? Been trying to google but without luck :/ Anyhow, hoping you all good, and good to be back again
  8. Content appear AFTER selection of <select>?

    okay thanks, i think i got it now ^^
  9. Hello fellow W3S Users. I have need of your hints and guides yet again. I have no code as such yet, but i was wondering if anyone could tell me how to make a PHP Query code that will count the menu items in my database and if the menu items are over lets say "8" or "9", then at the end of the menu there will be a "+" sign, which will become a drop-down menu for all the rest of my menu items? I have about 15 menu items so to make it look a little more pretty i thought that would be a great idea? Now i have a specific width "800px" for the menu, however my idea is that i either give the menu items "using ul/li for menu items" a specific width, orr give them an automatic width and then somehow say that if the menu items goes "outside the div-box", THEN make the plus sign with the drop-down menus? Is this possible? The last idea i mean? Because some of the menu items i have will have some long names (well sorts of, but still... considering for the feature...) Hoping you guys understands what i mean and will/can help me? Yet again thanks a lot and hoping you have some solution to my problem Thanks in advance, and best regards, rootKID.
  10. Hmm, ok thanks i will try to do this If it dosen't help, ill try to come back yet again ... Thanks again!
  11. i knew that, somehow... lol.. not sure why i posted this on PHP now haha Anyhow, question is how? Do i measure the width or?... And then what? Like after 800px width add a drop-down "+ sign" to the end and add the rest of menu in there?... just throwing in ideas, feel free to jump in.. lol x)).. thanks in advance
  12. Hello W3Schools! Its been a while I am trying to help a friend setting up he's webshop. It is already online but trying to make it look more nice according to webdesign template - this is hes website shop (www.thai-online.dk) i have already changed A LOT on this design, now i mostly need the menu... as you see the menu navigation has a lot of categories, and he told me that he wanted to add a lot more in the future if this shop could run online, so i am trying to figure out a solution for this. I already like the design myself, except the menu, so i have come to a solution that i am working on and hopefully you can help me out, work with me. As you see i currently have added 13 Categories, now my idea is to code some PHP into the menu on OpenCart so that if the menu design is ABOVE "1100px" in width AND has more than 7-8 categories on the menu, it will only show the 7-8 categories and at the end of it all show a little plus sign "+", when clicked on the plus sign a little side-menu will appear out from that little plus sign. The reason for using the 1100px width thing is to know if its on a pc orr on a mobile (if you know a better way please tell me, this is just to show you what i want) i know for sure the "plus sign" already has been made somewhere, but how to actually do it? We are using opencart version or something like that... this is the code i found on the .tbl file: <?php foreach ($categories as $category) { ?> <?php if ($category['children']) { ?><li class="dropdown"><a href="<?php echo $category['href']; ?>" class="dropdown-toggle" data-toggle="dropdown"><span><?php echo $category['name']; ?></span> <img width="8" height="8" class="menu-close" src="catalog/view/theme/atr374opc2101/image/menu_close.gif" /><img width="8" height="8" class="menu-open" src="catalog/view/theme/atr374opc2101/image/menu_open.gif" /></a> <div class="dropdown-menu"> <div class="dropdown-inner"> <?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?> <ul class="list-unstyled"> <?php foreach ($children as $child) { ?><!-- --><li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li><!-- --><?php } ?> </ul> <?php } ?> </div> <a href="<?php echo $category['href']; ?>" class="see-all"><span><?php echo $text_all; ?> <?php echo $category['name']; ?></span></a></div> </li><?php } else { ?><!-- --><li><a href="<?php echo $category['href']; ?>"><span><?php echo $category['name']; ?></span></a></li><?php } ?> <?php } ?> On another note, we are also using BootStrap (latest version) to make the design responsive. And the reason why i use the 1100px width, like i said before is because of knowing if the screen is that wide AND to tell if i should be adding the category addon... if the screen however is less than 1100px (or so...), the menu should be normal. Reason why i do this is because i already like the responsive design, i only need to edit the PC-Screen design a little bit so the menu can fit without problems. Hope you all can help out one way or another, still struggling with this little thing Thanks in advance and again, its been a while, so..... HELLO // rootKID
  13. OpenCart webshop menu coding (recoding menu for design)

    i know this, but the problem is that we have "bought" a new design, and the design was not designed to handle stuff like this (that i am aware off). What other menus are you talking about? If you have some ideas that could help or a guideline that would be great Thanks for the answer tho
  14. Hello W3S! Yet again here with a question. I was wondering if it would be possible to run a script/javascript/jQuery that will update a page/element of a page (( IF )) there is any new item in the database? I have seen this in chats online over the internet. The chat wont change what is already there, and if there is being written anything to the database, the new item/chat message in the database will automaticly (( Fade )) into the chat via jQuery. Is this possible? If so, where to look? Possible to guide me to a place where i can find some details? Would be much appreciated! Thanks in advance W3S!
  15. update page when anything new...

    Hmm... thanks for the answers guys, will check it out ^^...
  16. slide show

    Hmm... i will take a look at this when i get home, but like dsonesuk says... you only define 1 class to all of them, that is how i understand this anyhow ... i will take a look at the code when i get home. Possible for you to share the code? The whole website code from the "information.html" file? Just hit "ctrl + c" and "ctrl + v" on a Windows machine to copy and paste the whole code into code-tags so we actually can see what is going on ^^ Seeing the code on website and on here is 2 different things, depending on how you have coded the website Will take a look if you share the code LaTeRz
  17. Google Maps?

    Hello W3S! Been a while ^^ I have a question related to Google Maps. I dont know if anyone in here knows about the app/website named "TooGoodToGo"? Well, it is a company based on a varies of restaurants in the Nordic/West side of the world... that i am aware off anyways... they have this google map that shows the location(s) of each restaurant, showing the location, information, etc about it and prices. I would like to make something similar... That i already know is that i need longtitude and latitude, correct me if i am wrong. My question is, how do i make it like the TGTG website so that i can show Multiple locations in the map? With links to them as well as information & details about the prices? The idea is to let restaurants know that they can sell their "left overs" to less prices to those people that almost no money have... it is actually a greater deal in the Nordic/West, you can get a lot from it.. instead of wasting good food in the trash.. Hopefully you know what i am talking about and my english dont scare you away Thanks in advance if you can help me solve this puzzle... PS: I am going to store the long and latitude in my database... Hope you can help me out where i fail, as usual Thanks again!
  18. Google Maps?

    Thanks for the support! I think i got the idea now, i will test the code and return again if i fail.. which i most likely will hehehe ... Thanks anyways!
  19. Google Maps?

    Thanks dude, will take a look at it. All i am looking for really is something that has already been done by the "toogoodtogo" food website service when you look at their map :/ They show which restaurants their services applies on the map, that is why i want it integrated...
  20. Hello W3S, yet Again i need some answers/tips on some ideas i have been wondering about? First off, i am trying to make an "FTP" connection to my server online, from another server "that is also online". The idea is that when a user on my PortFolio uploads a Picture to he's And/or her's account on the forum i have made, that specific Picture will be used as an avatar BUT! I want that specific image/Picture to be uploaded to the other server online so the images/Pictures that is being uploaded will not be stored at the actual server where the website server-files are at. My question is now, which way is best to do this? Am i to be correct/assuming that i need to make an FTP connection to my other server BEFORE the image is being uploaded? Or is it after? The main reason/idea of me asking is simple, i dont want the Space of the server-files to be used on Things that will just fill up over time, and since i already had a server online at the same time as the other one, i thought it would be useful to use the Space at that server instead? Correct me if i am wrong "yet Again" please, but i could use some help with this "if anybody" had ever had the same idea etc? Thanks in advance! // rootKID
  21. FTP Connect Trouble "Online file-execution"?

    sorry for the delayed respond. It is half-exam week in my school, long story. Anyhow, yeah it was... and worked perfectly! Thanks for the help!
  22. I think it depends, i mean surely you can use both but is you use direct download "URL/photo.png", the user will have a direct access download-link to download by himself while a PHP download would use more performance in first reading the code and THEN the user would be able to download the image. There are many areas to take into consideration if you ask me, things like how many people are gonna use you website etc, it all depends on how many times the PHP script has to be run compared to the easier way of just giving a direct link to the image-download-link to the user? If you would ask me i would probably give a Direct link? Hope this helps. Regards, rootKID
  23. Proper MySQLI Database Connection...

    Hello, quick question... i have been told by a friend if i use the "ping" function in php, people would be able to make a "POD - Ping Of Death (DOS/DDOS)" to the server? This is my php function: function main_database_connection () { global $DB; $db_verify = mysqli_connect( $DB['host'], $DB['user'], $DB['password'], $DB['database'] ); // Database Alive? (Check by ping PHP function!) if ( mysqli_ping( $db_verify ) ) { $mysqli = new mysqli ( $DB['host'], $DB['user'], $DB['password'], $DB['database'] ); // Error check if ( mysqli_connect_errno() ) { echo "<b><u>"."An unexpected error happened when we tried to connect to the (MAIN) database server!"."</u></b>"; echo "<br />"; echo mysqli_connect_error(); exit(); } // change database characters (collation) $mysqli -> set_charset( $DB['charset'] ); // (query_connection) MAKER // ---------------------------------------------------------------- //$GLOBALS["dbconn"] = $mysqli; $GLOBALS["{$DB['globals']}"] = $mysqli; // ---------------------------------------------------------------- //////////////////////////////////////////////////////////// // Loaders / Updaters //////////////////////////////////////////////////////////// // Connection Type: // MySQLI = Secured MySQLI Database Connection //////////////////////////////////////////////////////////// // $connection = $mysqli; // Not used yet // LOADERS GO FROM HERE AND BELOW! // Example: // curuser_loader(); // Just add the function like that as you would usually and you are good to go... } else { die("<br /><br />Main Database server not alive for some reason, come back later! Or check the host-service!"); } } // End "main_database_connection" Function Can anyone confirm with me if this is correct etc? I just wonna make sure it is connecting the proper way x) Thanks!
  24. crypt() is NOT an encryption function

    I dont know, i am using _hash and functions like that also. I am just adding "more" to the password line, you could call it a random shake of already very well protected and encrypted password makers. I am just rolling the dice so it is even more protected. Like i said, i dont use one, i use ALOT of different encryption methods, that is what i ment anyways in case you misinterpated what i said Oo? So it is not "all" custom made, just added a few things to some PHP encryption methods that was pre-added in the beginning ^^...
  25. crypt() is NOT an encryption function

    Lol, i use Crypt() on my websites? However i use that one amongst with SHA1, MD5 and 4-5 different custom-made salt functions that will randomly throw the letters and numbers and signs around to make sure they are very well shaken and ready to be used as an password. Also known to be "Encrypted" .... still working on it tho, but working at the moment perfectly fine