Jump to content

LeonLatex

Members
  • Posts

    403
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. Strider64, after kicken and I get some help from another one who came in and commented, then I saw what you tried to tell me. I have changed and using your connection now. Thank you so much, and sorry for misunderstanding you.
  2. Yes, I see it now after you told me. Thank you for a very clear answer kicken. (another medal for you)
  3. Strider, I am not sure what you meant with your answer. Your code does exactly the same as mine. My code works well, that was not the problem. I was wondering something. You'll figure it out if you read my opening posting one more time. Anyway, thanks for trying. I think you misunderstood me.
  4. Here is my DB connection: <?php try { $pdo = new PDO('mysql:host=mysqlserver.no;mydbname=mydb', 'myusername', 'mypassword'); $output = 'Database connection established.'; } catch (PDOException $e) { $output = 'Unable to connect to the database server: ' . $e->getMessage(); } When it comes to error and connection check, or I start at the other end..: I know the error check works. I print both to screen. Checked it by entering both correct and incorrect passwords. So I'm sure it works, but does it only work on the user details, or will it work on other errors as well? For example, if there is no connection with the DB server, if it is on a separate server, for example?
  5. Yes, I know, you have told me the solution to this problem before, but now I got the same problem. My header bar is moving up and down when scrolling. I am using position: sticky; but it still goes up and down. What is the problem? div.header_container { background-color: #033333; position: sticky; height: 83px; width: 100%; padding-top: 0px; margin-top: 0px; } div.logo_bar { background-color: #033333; width: 100%; height: 47px; } div.logo_div { background-image: url("../images/logo_bg_original.png"); width: 300px; height: 35px; margin-top: 0px; } div.menu_bar { font-size: 13px; font-weight: bold; background-color: #ffffff; width: 100%; } div.menu_div { background-color: #ffffff; width: 100%; }
  6. Edt: I was thinking that block 3 would overwrite the values in block 2 since it is read later,
  7. Yes, of course. I was thinking that block 3 would overwrite the values in block 3 since it is read later, but now I see that there is different values in those two blocks. So, the case is closed. Thanks 😊
  8. Strider, can you please tell me why you set up block 2 and 3 like this? : .logo-div, .translate-div { display: inline-block; vertical-align: middle; } .logo-div { background-color: red; color: #fff; text-align: left; Both blocks have a reference to "logo-div". Why? I ask before I try because I want to understand what I am doing when doing it. Will the result not be determined by what is written in block 3 regardless of what is written in block 2 because block 3 is read after block 2? I mean: Therefore, the values for. logo-div in block 2 are overridden by the values of block 3 for ". logo-div" no matter what. I'm just asking because I got a little confused now. I have never set up CSS like this before, and I didn't know you could do it this way. Therefore, I need an explanation.
  9. Thanks to all of you. I will look into it and all the advice you are giving me. There has been a downtime of about 10 hours on the server, and I didn't have a copy on this site locally, so I haven't been able to work on the site. Again, thank you so much 😊
  10. I've lost my way, and now I can't find the right solution again. I've managed to do this before, but now I can't find the right combination. I have 1 DIV that contains two other DIVs. One is on the left side, and one is on the right side. The right side is the google translate drop down menu. The right one is a div that contains the logo and company name. The problem is that the DIV for the google translate dropdown menu stays at the top, while the DIV for the logo is placed on the line below. Which "display: inline" option should I go for each individual DIV when i want them aligned left and right on the same line?
  11. I still need help with this. Please help me make VSC work.
  12. I don't remember how I did this last time. Should the 1st line point to php.exe and the 2nd line point to phpdbg.exe or both pointing to php.exe? After i bought me a new laptop, VSC won't work because i have to re-configure it. Can you guys please tell me witch of the lines should include what? I cant make it work no matter what. But before I move on I have to get these two lines right, be sure it's right. This is how it is now: "php.validate.executablePath": "C:\\laragon\\bin\\php\\php-8.1.10-Win32-vs16-x64\\phpdbg.exe", "php.debug.executablePath": "C:\\laragon\\bin\\php\\php-8.1.2-Win32-vs16-x64\\phpdbg.exe", I have tried this too: "php.validate.executablePath": "C:\\laragon\\bin\\php\\php-8.1.10-Win32-vs16-x64\\php.exe", "php.debug.executablePath": "C:\\laragon\\bin\\php\\php-8.1.2-Win32-vs16-x64\\phpdbg.exe",
  13. Thanks Kicken
  14. Please, look at the first 2 lines. I can't find it my self. Where is the ERROR? <?php try { $pdo = new PDO('mysql:host=*****;dbame=*****'; charset=utf8', '*****','*****'); $pdo->setAttribute(PDO::ATT_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = 'SELECT' `article` FROM `articleText`'; $result = $pdo->query($sql); while ($row = $result->fetch()) { $article[] = $Β€row['articleText']; } $title = 'Matsnakk'; $output = ''; foreach ($article as $article) { $output .= '<blockquote>'; $output .= '<p>'; $output .= $article; $output .= '</p>'; $output .= '</blockquote>'; } } catch (PDOException $e) { $title = 'An ERROR has occurred.'; $output = 'Database ERROR: ' . $e->getMessage() . ' in ' .$e->getFile() . ':' . $e->getLine();'; } include __DIR__ . '/../templates/layout.php';
  15. Yes, I know, but this was something I remembered from those days long ago. Thank you for your tip and advice πŸ˜ŠπŸ‘πŸ‘Œ
  16. I have a TABLE called article. In this table I have 4 columns which is articleid, articletext and and articledate . Time has come to upgrade the TABLE with one more COLUMN. That's not the problem, how to create it. The problem is what values/parameters I need to enter/set. I am not storing the images in the database. I will just store the link to the picture that is stored in its own directory (images) given its own name on upload to the directory where the pictures are stored. This is how far I have come til now: ALTER TABLE article ADD [COLUMN] articleimage column_definition |AFTER articletext]; To start somewhere to move on, I think the best thing is to create the path that will be converted to a link in a PHP script including href="http://www.******.tld /images/article_images/ As you understand, the link to the images directory will be fixed in PHP/HTML, but when it is loaded, the name of the file will be inserted after article_images/ So, when the page loads PHP and HTML, the link will be created and printed out to be shown visitor's browser. Since the name of the image will be arbitrarily/automatically entered, I am not sure which values/parameters I should enter for the column I will create/have created since the image can then consist of all kinds of letters and characters. If I'm completely lost here, please tell me how this is normal and how to do it. Because it's been so long, at least 15 years since I've done something like this. Whoops, this must have gotten messy, but I hope you understand what I'm trying to figure out.
  17. It's not a recommendation. Who told you that? This is taken from one of the first chapters describing/teaching about how it's possible to do an html or php site/file unreadable for visitors of the site by direct access through the browser. This chapter also describes he use of templates and the In later chapters, they are changing this to the "normal way". It's just to do It more readable and understandable for the reader. So, since I am reading and learning from the book (and the other freaks in here) I feel I am more appropriate to rate this book than one who has not. But, out on your experience and knowledge, I understand your reaction. It's easy to be the first in line to throw the first word about something or somebody. The book Is good. And I learn a lot from it. Some chapters I have to use more time on, but that is my own fault, not the book. Maxxd, I wish you a beautiful Saturday morning, day, and evening. Greetings from Thailand🌞
  18. As I thought but I was soooo unsure because it was so poorly explained for me. But anyway, thanks again.
  19. Thanks, kicken. I was confused because I am used to seeing a double underscore with a little space between them. Because of you, I am not confused anymore. You gave a list showing double underscores with space between them. Thanks. You earned that medal for a god and clear answer.
  20. There's a reason for asking. On my computer this is a single underscore and dont look like the one in the example _ , and this is a double underscore that looks like the one in the example __ This makes me confused πŸ€”πŸ™„πŸ˜΅β€πŸ’«
  21. I am reading a book about PHP and came into a problem. I can translate it well from English to Norwegian, it's not that. It's because of a lack of information and things the writer has not said/ given enough information about, or I can have overseen it. Anyway, I can't find the answer anywhere in the book. So, please help me out here. In the English text below, do they mean a level up outside the www directory when they say up a level? Do they mean I have to create i new directory/folder outside the www directory/folder named "project, or is the project directory/folder? This is in connection with security and should ensure that visitors to a website do not get direct access via the web browser to the file "count.html.php .Can anyone tell me what is meant here? "This is the text: Go ahead and move count .html.php up a level into the project directory and amend count.html.php to reference the new location". Thankful for a explanation πŸ˜ŠπŸ‘
  22. Look at the picture, is it double or single underscore before and after DIR?
  23. I paste my script here. It won't connect, and I can't find the reason. Can you see where the bug in the script is? I appreciate your help if you can see it. <?php try { $pdo = new PDO('mysql:host=127.0.0.1;dbname=mydb; charset=utf8', 'myuser', 'mypass'); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $output = ('Databasetilkobling er opprettet.'; } catch (PDOException $e) { $output = 'FΓ₯r ikke kontakt med server, eller kan ikke koble til databasen:' . $e; }; ?>
  24. As told in the heading, am I struggling with a dropdown menu that won't place where I want. I want it to move all over to the right, but for some reason, it won't. The CSS can be a little messy since I have changed it forth and back in many attempts to make it work. Thanks for trying! πŸ˜ŠπŸ‘ Here are some of the HTML and CSS HTML <body> <div class="header_container"> <div class="logo_bar"> <div class="logo"> <div id="google_translate_element" style="margin-top:11px; margin-left: 32px;"> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'no', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> </div> </div> </div> <div class="menu_bar" style="background-color: #ffffff;"> <div class="menu"> <a href='<?=$HOST?>index.php' class='w3-bar-item w3-button w3-round-tiny w3-hover-white'>Hjem</a> <a href='<?=$HOST?>index.php' class='w3-bar-item w3-button w3-round-tiny w3-hover-white'>Hjem</a> <a href='<?=$HOST?>index.php' class='w3-bar-item w3-button w3-round-tiny w3-hover-white'>Hjem</a> </div></div></div> CSS div.logo_bar { background-color: #003333; /*box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;*/ margin: auto; margin-top: 0px; width: 100%; height: 64px; padding: 0px; position: fixed; } div.logo { display: inline-flex; flex-direction: row; align-items: baseline; background-image: url("../images/logo_bg_original.png"); width: 300px; height: 35px; margin-top:9px; margin-left: 10px; position: static; } div.translate { display:inline; flex-direction: row; align-items: baseline; width: 300px; height: 45px; margin-top:3px; margin-left: 10px; position: static; } div.menu_bar { font-size: 13px; /*font-weight: bold;*/ background-color: #ffffff; box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px; margin: auto; margin-top: 54px; width: 100%; height: 50px; position: fixed; } div.menu { background-color: #ffffff; display: inline-flex; flex-direction: row; align-items: middle; margin-left: 0px; margin-top: 8px; }
  25. I was just asking for help to find the right place to find the solution to my problem. What is wrong with that? And if we who are the visitors here on PHP Freaks can't ask for help, I don't understand what this site is for if we can't ask questions which is in connection with the many categories here at PHP Freaks.
×
×
  • 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.