Jump to content

LeonLatex

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. 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",
  2. 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';
  3. Yes, I know, but this was something I remembered from those days long ago. Thank you for your tip and advice πŸ˜ŠπŸ‘πŸ‘Œ
  4. 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.
  5. 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🌞
  6. As I thought but I was soooo unsure because it was so poorly explained for me. But anyway, thanks again.
  7. 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.
  8. 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 πŸ€”πŸ™„πŸ˜΅β€πŸ’«
  9. 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 πŸ˜ŠπŸ‘
  10. Look at the picture, is it double or single underscore before and after DIR?
  11. 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; }; ?>
  12. 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; }
  13. 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.
  14. Thanks cyberRobot. Just what I was looking for.
  15. Website starts looks ok in 720px-740px and up. That's ok if it wasn't for the last button/link in my menu bar. I know I have seen the solution to this in w3 schools about "w3 schools CSS" responsive design so this option comes on the next line, but now I can't find it. Please help me someone. or, actually, I would like to have the menu show up like a button like this one: (Show Button) on mobile devices. But now I can't find that either. So, please, any? And search on w3schools.com is no point since all the results come's up is to other sites which have no meaning to what I am looking for.
  16. I can't figure it out, and I can't find the answer. I thought it was an easy thing, like a walk in the park or cycling to the pub. I want to decide for myself how wide the <label> should be. What am I doing wrong? <label style="width: 200px;">Fornavn</label>
  17. I don't πŸ€ πŸ€”πŸ€ͺ Thanks πŸ™‚
  18. A person I met at a cafe told me he was hired into a project about some sensors for the pacific sea they are developing. About that he said he was developing the software for those sensors in python because python was faster than C# C+ What do you say? Hard to believe this, that's why I am asking.
  19. It's the w3-card that won't center. There is no content in it except a w3-panel. Without the w3-panel inside it doesn't center either.
  20. I have tried different things to center the card below. But it doesn't. What am I doing wrong? The other styles are working, but it won't center, no matter what. Maybe there is a simple solution for this, but as said, it doesn't work. I have tried inline CSS too. Is it a simple solution for this? <div class=" w3-card w3-center w3-padding w3-twothird w3-round">
  21. In first place I posted this wrong, but when I saw I had posted it in the wrong place it was too late to delete it. That's why it is to find in two places. Got to fill in: After I followed Barands advice it was getting better. He told me to use W3Schools W3 CSS. Things were getting better. I must rewrite the main box completely and stop using my own CSS as little as possible. The only problem now is the article box inside the main box who keeps the article preview text and picture. The box scales to narrow and the photo doesn't scale at all. The photo keeps in the correct place but it doesn't scale down to fit the rest that is scaling down. And the main bow doesent expand on to large picture. Just on text when the text is to long. Hope I manage it till tomorrow after i have slept a little. 06:27 here now. Good morning and good night 😴
×
×
  • 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.