Jump to content

LeonLatex

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. Woke up this morning and met this problem (as described on screen dump below). Everything was working last night before going to bed, but win11 had an update while I was sleeping and restarted. So far i have found out there could be a conflict because of User Account Control (UAC) and a problem due to permissions: Apache doesn't have permission to start or run. Does anyone know how to fix this? Reinstall doesent fix it because of the UAC problem.
  2. Look at both side of ROOT. Wich is the right one? #1: require_once(__ROOT__.'/includes/db_inc.php'); #2: require_once(_ROOT_.'/includes/db_inc.php');
  3. Hello Jimbo πŸ˜ŠπŸ‘
  4. If an extension is enabled/activated in Visual Studio Code, do I have to activate or turn on something for debugging different script types? Or can I just open the specific file in VSC? I mean, can I just open the file in VSC without thinking or doing something else to have VSC read through my script to run it or debug it? Eg. is it enough to just have different extensions installed and enabled? I am trying to debug an ajax script. When I try to debug an ajax script with VSC it tells me: This tool will work only if it has an API supporting it from a web server. I have a Laragon web server and need an API for my need. Suggestion for an API, please.
  5. Stupid things might happen when you have been awake for almost three days. In the category "things to avoid to do". This is NOT from the last 14 days problems. Find one problem πŸ˜‚πŸ˜‚πŸ˜‚πŸ‘πŸ‘πŸ‘ Cut out from the db_inc.php file: <?php require_once $ROOT.'db_inc.php'; try { $pdo = new PDO('mysql:host=**********; dbname=**********; charset=utf8' , '**********'); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $output = 'Database Connection Etablished.'; } catch (PDOException $e) { $output = 'Unable to connect to the databese server: ' . $e; } ?>
  6. This is the answer for inline: <div class="w3-bar w3-card w3-blue-gray w3-margin-bottom w3-padding" style="height:30px; margin-top:30px;"></div>
  7. Is it possible to place a w3-css in an external file and not only inline? What i want to do is align the <div> below 30px from the top. Is there a w3 margin? <div class="w3-bar w3-card w3-blue-gray w3-margin-bottom w3-padding margin-top: 0px margin-top:30px"></div> And is it necessary to have both "w3-bar and w3-card"? In my head they are the same with different value/purpose? w3-***** is the css framework to w3 schools.
  8. I see the possibilities and benefits of using that way to do it as well, but that is not what is directly done in the example I am referring to, or ....? I also got a tip from another that I can use CSS background property and I could use flexbox as well. But those answers were so short so I think there are a lot of not told, or information falling out. But as I see it, both three ways (😜) got their benefits. 'Maybe it depends on how I use them? I say both three ways (to be a little ironic) because I am sure there is more than one way to handle this, but what is the best way depending on whom told you to use which? OR am I totally wrong?
  9. Not sure if this fits here on CSS or under HTML, but chose to place it here as I reckon it is some CSS magic formula. If you go to www.koozai.com you will see the image at the top of the page (background image?). No matter what resolution I use, or what size browser it is, the image follows in scaling, is just as sharp and clear, is just as detailed and shows the same thing. How do they do it?
  10. I didn't say I can't. I said When i try to change back.... I think this is something that is left behind by my lecturer when I studied. He always used capital letters. It is many years ago, but I think it remains in the basics from that time. As I said, I have tried many times to change to lowercase letters, but for one reason or another I end up back. Now I have re-written all I have done and written in uppercase, so we'll see how long it takes before I end up back on the old track. Is it only me or am I struggling with my English?πŸ˜‚
  11. I am the opposite. This is something hanging with me from the old days. I can't explain it, but I have many times tried to change it. But I am always going back to the old. When i write CSS or HTML I am using lower case. No problem, but when i am in programing mode, NO WAY! No one can explain it.
  12. Yes, because that's what's important. That I get the information is what is important, and where in the script it arises. A visitor to a website will never have any honest intentions or benefit from getting the info that comes up.
  13. I just got to laugh πŸ€ͺπŸ€“πŸ˜‚πŸ‘ I change to PDO I should have seen it that myself🀬 I think I need to check my glassesπŸ™„ Thanks ginerjm, it's working now πŸ‘πŸ˜Š
  14. I still try to make this work. I have the TRY included now, and out of what I can see and my knowledge and understanding I have to throw it in and ask: What have i done wrong here? <?php try { $pdo = new PDO('mysql:host=sql31.mcb.webhuset.no; dbname=**********; charset=utf8' , '**********' , '**********'); $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $output = 'Database Connection Etablished.'; } catch (PDOException $e) { $output = 'Unable to connect to the databese server: ' . $e; } include __DIR__ . '/../templates/output.php'; ?> When I open this stand alone without ERROR report i get a 500 error. With the ERROR report I get this:
  15. I guess you mean this because of security reasons among others...?
  16. OMG, What a h... Now i feel really embarrassed. I removed it and forget to put it back after check whats happening without it.πŸ€ͺ
  17. Yes, when i run the script stand alone it is ok, but i get a lot of errors when the rest of the script is connected together. It is like you warned me about. So sorry to hear you won't keep up with me. That is an honest choice. Hope to see you around any way from time to time in my weird PHP world.
  18. Yes, when i run the script stand alone it is ok, but i get a lot of errors when the rest of the script is connected together i get the errors. It is like you warned me about. So sorry to hear you won't keep up with me. That is an honest choice. Hope to see you around any way from time to time in my weird PHP world.
  19. After destroying a lot of the script that Barand set up for me, I have concluded that developing a lot of what cannot be fixed is the simplest thing than patching together what he developed for me. I should be able to save the rest. Ie. database, calculations, etc. It is the creation/acquisition of variables, connections, sessions, classes, etc. which needs to be set up again. It will be a bit of work, but I think I fix most things on my own now. I will certainly come back to you for tips and advice. I need at least parts of it to put together a music collection management. At least I feel that I have come so far, and then so far that I manage more or more alone and without help from the books, but their professional assessments and tips will always come in handy. That is why I create this thread get to have a fixed thread and relate to it when it comes to this project I am now starting on. I have created a DB connections script. Can I get an assessment of this? I try to run it as a stand-alone script gets to test it and get only 500 errors. What is the reason for that? <?php { $pdo = new PDO('mysql:host=sql31.mcb.webhuset.no; dbname=*****; charset=utf8' , '**********' , '**********'); $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //GjΓΈr noe nyttig //Setter variablene $title and $output } CATCH (PDOException $e) { $output = 'Unable to connect to the database server: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine(); } include_DIR_ . ''; ?>
  20. IIt's certainly not over yet. It turns out that when I log in, that's not what happens. Because I removed all error check and set everything to requierd_once. Therefore, it seemed to me yesterday that the site logged in. Because it now runs on whether it is wrong or not due to null error check and requierd_once. So now that I have finally slept a few hours and am a little more awake than yesterday, it is back to troubleshooting today as well. It was probably solved a lot yesterday because of your help here at PHP Freaks, but I think I may need you today as well. For it is you who point me in the right direction. I'm not to good enough yet to read the error messages. I hope you can be with me this evening as well if I need you.
  21. Dont be afraid of that. We have many years ahead of us. I try hard and get back to where I was 12-15 years ago, both in business and knowledge. There have been many tragedies along the way. It started with a business fall from 1000 meters and lots of lost money, many deaths in close family and relationships, one broken marriage, close personal bankruptcy, and ended up drinking two liters of vodka or whiskey straight up a day for 4-5 years, one brain stroke, one daughter (now 25) nearly left me (too), one grandchild 2 years old in October (she's the reason i was waking up ++ etc, etc. + I was exposed to a traffic accident 34 years ago that broke my body in small pieces and which was close to taking my life + ADHD that can not be medicated. Of course, it has given me a lot of life experience. This has among other things taught me to listen to others and share what I have. is knowledge, money, etc. One should never give up. Life is fragile and life is what one makes it. We must live and fulfill our dreams while we can. One day it is too late. So now my goal is to come back to where I was in knowledge and business. It's not easy as 50 years and with so many scars r, a lot of new on the front we work, but there I go. When it comes to business Barand knows a little about what a ride I had in the last half of the 90s and early 2000s. As time goes on, you will notice that Leon can also help, not just ask questions. I appreciate all of you and what you do for me. Thanks! I want to continue and be here. For me, this is the beginning of something long. 1.5 years have already passed. Take care guys 😊
  22. I want to say a BIG THANK YOU to all of you who helped me with this problem. It meant a lot to me. I solved it myself in the end, but I would never have been able to do it without their help to kick me in the right direction, so I got on the right track. Thank you very much πŸ˜ŠπŸ‘ I would like to give you a donation. It's just a problem. Most of you do not have a PayPal account. How can I show my gratitude to you? πŸ€“πŸ€”
  23. I mean opening your include files in your browser directly. Accessing them directly to see if there are any errors is at best pointless and at worst misleading. It's pointless because any errors that exist would be shown by PHP when it tries to parse the file during the include process. It can be misleading because the file might depend on variables/functions defined in the main file which are not available when accessed directly and cause errors that otherwise wouldn't exist. I am aware of that. That's why I'm flipping backward. It may seem cumbersome to you Kicken, but it's not to me. It is also a way for me to learn the script and how it is connected. If you use require_once, then PHP will essentially ignore any attempts to require the same file after the first attempt. This can allow you to simply require the file and not worry about if it was already required elsewhere or not. Ideally you would re-structure the code so that the file is only required a single time, but using require_once would be a quick solution while you work towards something better later. I removed all included in the site and removed the session_start(); from header.php. Then it was a short way to make all work. Now there are some "modules" not working, but I am not going to use them in my next project. That is for a friend who asked me if I could make him a music management system for his vinyl collection. He got about 5000- 6000 LP and singles. Thanks for your help Kicken
  24. You should be using require here, not include. The script cannot continue if the file fails to be included so you should just let it fail on the error of not finding the include file rather than a later undefined function error that can get you confused as to what the real problem might be. Thanks kicken. I will try your tip . Opening your include (like db_inc.php) files directly usually isn't going to give you any helpful information, and might just send you down a wrong path. If there's an error with the file it will show up when you include it into the main script you want to run. Do you mean by cut and paste it all into one file? The re-defined function error suggests you are either including your db_inc.php twice. Looks like in marina.php you include header.php and header.php includes db_inc.php. Later on in marina.php you again include db_inc.php which results in the error. You could change your code to use require_once to avoid this problem, or re-structure it so you only include the file once. Ok. So I will change it to "require_once". Where all this calling on all the connections is from I don't understand...or I mean I don't remember. Do you know if they just can be there or stay as they are if I use the "require_once"? I guess I got more of them in other files too since I got some other files with the same error. I dont know where you guys are from except Barand and Gizmola. I am from Norway, so i understand bedtime tierd etc is not the same as in Norway/Europe. But I hope you stay with me (not only me, but stay here at PHP Freaks) as long as possible whereever you are in the world. I am screaming (almost) for help. And I am grateful to everyone who gives me a push.
  25. Yes. I got a session start in both the header.php file and in the login file I can see. And after i put in your code in the db_inc.php (hope I said it right now) i get an error in the login php file when i click the log in button and i have the correct username and password. Do you want the error message from "login.php" ginerjm?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.