Jump to content

LeonLatex

Members
  • Posts

    403
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. As I have understood it's not normal or necessary anymore and after the new standard(?) to close PHP (?>). So if I got a PHP file with a mix of HTML and PHP I can just open for PHP (<?php)? In other words. Can I just leave it open through the whole file?
  2. Thanks CyberRobot. I will try your suggestion.
  3. As an example: /* Clear floats after the columns */ .row:after { content: ""; display: table; clear: both; } .column { float: left; width: 33.33%; } <div class="row"> <div class="column"></div> <div class="column"></div> <div class="column"></div> </div> Does it matter if it says row or something else in front of :cleare ? Can row be replaced with something else? That is, e.g. background or something else? As I have understood it from what I have read online, :cleare can NOT be replaced with something else, understandably according to the function.
  4. I have come a little further in trying. I've been trying this for three days now. I am attaching the CSS and HTML that are relevant. However, I will explain what is happening. I get the text to wrap around the image. What I can't manage to do is create the space I want the text to have for the image. That is the text that is placed on the underside and the text that is on the right side of the image. If I get the distance to the image on the right of the image, the wrapping function disappears and the text does not fit under the image as it did before when necessary (when the text is so long/too long). This is hopeless! Can someone please look through what I have done and tell me what is wrong/what I am doing wrong, and please also come up with the solution to the problem so that I can fill in the correct one that is the solution to the problem? CSS: div.content1_image { background-image: url("../images/content1_image.png"); width: 275px; height: 181px; position: initial; float: left; margin: auto; margin-top: 25; margin-left: 25px; /*image-border: medium;*/ /*border-color: black;*/ border-radius: 10px; display: inline-block; background-color: #eeeeff; /*box-shadow: rgba(0, 0, 0, 0.65) 0px 0px 0px 3px;*/ color: #111; text-align: left; font-size: 90px; shape-outside: square(); padding: 0px; background-clip: content-box; } div.content1_background { /*text-align: center;*/ font-family: "Consolas", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif"; font-weight: bold; font-size: 14px; color: #000000; margin: auto; margin-top: 25px; position: initial; background-color: #eeeeee; width: 97%; height: 300px; border: 10px; border-color: black; border-radius: 10px; box-shadow: rgba(51, 51, 51, 0.27) 0px 0px 0.2em, rgba(90, 125, 188, 0.05) 0px 0.25em 1em; } div.content2_image { background-image: url("../images/content2_image.png"); width: 275px; height: 184px; position: initial; float: left; margin: auto; margin-top: 25; margin-left: 25px; /*image-border: medium;*/ /*border-color: black;*/ border-radius: 10px; display: inline-block; background-color: #eeeeff; /*box-shadow: rgba(0, 0, 0, 0.65) 0px 0px 0px 3px;*/ color: #111; text-align: left; font-size: 90px; shape-outside: square(); padding: 0px; background-clip: content-box; } div.content2_background { /*text-align: center;*/ font-family: "Consolas", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif"; font-weight: bold; font-size: 14px; color: #000000; margin: auto; margin-top: 25px; position: initial; background-color: #eeeeee; width: 97%; height: 300px; border: 10px; border-color: black; border-radius: 10px; box-shadow: rgba(51, 51, 51, 0.27) 0px 0px 0.2em, rgba(90, 125, 188, 0.05) 0px 0.25em 1em; } HTML: <div class="content1_background"><!--<div class="oval1"></div>--><div class="content1_image"></div> Lorem ipsum dolor sit amet. Sit dolorum beatae quo assumenda nisi eum fugiat exercitationem aut obcaecati commodi. 33 enim dolor rem accusamus veritatis non sequi facere ut veniam galisum est error illum qui tempore voluptatem. At necessitatibus sunt a fugit repellendus ab assumenda obcaecati et voluptatibus eveniet ex recusandae molestias est temporibus pariatur voluptatem incidunt. Rem adipisci laboriosam eum asperiores voluptas est accusantium minima et sint veniam. Sed quas recusandae in voluptas aperiam non eius amet et nobis voluptatum qui assumenda quia. Non voluptates eius ut odio nisi est consectetur quasi est asperiores distinctio et dolorem saepe in molestiae corporis. Ut placeat nisi et quia tempora qui nihil accusantium ab similique quos non delectus neque ducimus culpa qui distinctio minus. In dolore deserunt est voluptatem iusto quo quia aliquid. Lorem ipsum dolor sit amet. Sit dolorum beatae quo assumenda nisi eum fugiat exercitationem aut obcaecati commodi. 33 enim dolor rem accusamus veritatis non sequi facere ut veniam galisum est error illum qui tempore voluptatem. At necessitatibus sunt a fugit repellendus ab assumenda obcaecati et voluptatibus eveniet ex recusandae molestias est temporibus pariatur voluptatem incidunt. Rem adipisci laboriosam eum asperiores voluptas est accusantium minima et sint veniam. Sed quas recusandae in voluptas aperiam non eius amet et nobis voluptatum qui assumenda quia. Non voluptates eius ut odio nisi est consectetur quasi est asperiores distinctio et dolorem saepe in molestiae corporis. Ut placeat nisi et quia tempora qui nihil accusantium ab similique quos non delectus neque ducimus culpa qui distinctio minus. In dolore deserunt est voluptatem iusto quo quia aliquid. </div> <div class="content2_background"><!--<div class="oval2"></div>--><div class="content2_image"></div> Lorem ipsum dolor sit amet. Sit dolorum beatae quo assumenda nisi eum fugiat exercitationem aut obcaecati commodi. 33 enim dolor rem accusamus veritatis non sequi facere ut veniam galisum est error illum qui tempore voluptatem. At necessitatibus sunt a fugit repellendus ab assumenda obcaecati et voluptatibus eveniet ex recusandae molestias est temporibus pariatur voluptatem incidunt. Rem adipisci laboriosam eum asperiores voluptas est accusantium minima et sint veniam. Sed quas recusandae in voluptas aperiam non eius amet et nobis voluptatum qui assumenda quia. Non voluptates eius ut odio nisi est consectetur quasi est asperiores distinctio et dolorem saepe in molestiae corporis. Ut placeat nisi et quia tempora qui nihil accusantium ab similique quos non delectus neque ducimus culpa qui distinctio minus. In dolore deserunt est voluptatem iusto quo quia aliquid. </div>
  5. Finally, I found out how to scale background images automatically depending on the viewport/screen size and the screen resolution. I bought myself a new book about CSS3 and HTML5. But there is a thing missing in the book. It doesn't tell me..... Ok, I start over. I want to use a different background image on different pages. As I have understood I "Have" to use CSS background-***** in combination with the <body class="******"> tag. Is this right, or can I use it with a <div> tag too? I mean as a background image in a <div class='****** with width and height 100%" so the <div> covers the screen at all time? Will the CSS background-***** do the same in a <div> as in a <body> tag? Yes I know i could use a lot of time on this by testing it out my self, but spare me the time by asking in a hope if some of you know the answer.
  6. nah, I do it myself. I don't want to bother you more with it. Actually, i thought this was a site existing for helping and learning. Instead of taking the shortcut and having some help here and saving time, I think it's best I use some extra time and find out about it by myself. If I use a week or 3 months is not special important. And about my comment, I said I was sorry if I was wrong, or something like that. On the 12th of October, I am going to Hua Hin in Thailand for six months. So I will bring it with me to Thailand. I need something to do there as well. The main reason I am learning so slow and remember very bad is because of a cognitive head injury after a traffic accident in 1988. Just sayin, if any wonder about it.
  7. Yes, I know. I am aware of that, but sometimes I forget it. (just like others) Sorry for that, I am just a human ๐Ÿคช Anyway... I am always trying to behave and show (you) my best side ๐Ÿ˜Š
  8. No, I just looked over it and tried different things. I also compared it with other lines. It usually helps to get some sleep. I would think you recognize yourself in that. ๐Ÿ˜‰
  9. When I woke up I took it immediately. There was missing everything from a . on one place to a $ on other places. Even a = and god knows what. And Barand, maybe every error " are glaringly obvious" for you. Sometimes it isn't that for me. That's why I ask for help. This morning I could hardly hold my eyes open, but I want to fix the error, stubborn as I am. And Benanamen, what makes you think I haven't written the script my self? I have taken some frome here and another from there, "IN MY OWN SCRIPTS". So yes, much of it is cut and paste, but it's from my own scripts written by my self ๐Ÿ˜ ๐Ÿ˜ค Maybe it's just me, but I sometimes feel a certain undertone of arrogance in answers to me because I'm nowhere near as good as you at programming. That's why I'm asking the experts (you guys)for help. And it's not always as easy to see your own mistakes when you're so tired that you can barely keep your eyes up. Because it is not always as easy to go to sleep when you are engrossed in something. The cow should not forget that it has been a calf (a saying translated from Norwegian). All I want is to be friends with others with the same interest. And I am really struggling to get back where I once was. Sorry if I am wrong and misunderstood. Feelings aren't always the same on the internet as in real life. I also include in the calculations that language barriers may arise. Anyway, I appreciate the help I get when I get it.
  10. I've been up all night looking at this. I can't understand where the error is. Now I'm tired and bored. It's 05:40 here now. I think i will find it after a few hours on my pillow. Good night/good morning ๐Ÿ˜›
  11. I said I cant find the errors, so guess. I cant see them.
  12. I get an error on line 38, 39, 52, 56, 58, 63 and 71. I cant find the error. I am looking and looking ๐Ÿ˜ฎ Can you help me find it? <?php class EntryPoint { private $route; public function __construct($route) { $this->route = $route; $this->checkUrl(); } private function checkUrl() { if ($this->route !== strtolower($this->route)) { http_response_code(301); header('location: ' . strtolower($this->route)); } } private function loadTemplate($TemplateFileName, $variables = []) { extract($variables); ob_start(); include __DIR__ . '/../templates/' . $templateFileName; include ob_get_clean(); } private function callAction() { include __DIR__ . '/../classes/databaseTable.php'; include __DIR__ . '/../includes/dbconnection.php'; $articleTable new DatabaseTable($pdo, 'article', 'id'); $usersTable new DatabaseTable($pdo, 'users', 'id'); if ($this->route === 'article/list') { include __DIR__ . '/../classes/controllers/articleController.php'; $controller = new articleController($articleTable, $usersTable); $page = $controller->list(); } elseif ($this->route === '') { include __DIR__ . '/../classes/controllers/articleController,php'; $controller = new articleController($articleTable, $usersTable); $page = $controller->home(); } elseif ($this->route === 'article/edit') { include __DIR__ . '/../classes/contollers/articleController.php'; $controller = new articleController(articleTable, $usersTable); $page = Controller->edit(); } elseif ($this->route === 'article/delete') { include __DIR__ . '/../classes/controllers/articleController.php'; $controller = new articleController($articlesTable, $usersTable); $page $Controller->delete(); } elseif ($this->route === 'register') { include __DIR__ '/../classes/controllers/registerController.php'; $controller = new registerController($usersTable); $page = $controller->showForm(); } return $page } public function run() { $page = $this->callAction(); $title = $page['title']; if (isset($page['variables'])) { $output = $this->loadTemplate($page['template'], $page['variables']); } else { output = $this->loadTemplate($page['template']); } include __DIR__ . '/../templates/layout.html.php'; } }
  13. Funny thing when you get so hung up on things because of a small glimpse of a feeling of mastery because you manage something that you haven't mastered in many years. When you deal with something that is structured and you forget to be structured yourself๐Ÿ˜‚๐Ÿคช I have developed some different PHP files (actually a lot of them) for a CMS I am putting together, and just thought that I would put those files in this and those different directories. Until now, I have tested the different files that can be opened in the browser. Now I have reached the point where I can open index.php to test how this works when everything is sewn together. This is something that I now know in retrospect, I was very careful to note before for post-checking and a map that will save me the task I am about to start on now. It's extra work, but someone have do it. I have to go through each individual file and see what I have named each individual directory, and which files are linked to each other. Fun? NOT! I thought I would remeber it, but the project was getting bigger and i forgot. Does anyone recognize themselves? Moral of the day: Don't start a major task until you have a plan (written and drawn down)
  14. Of course ๐Ÿค“๐Ÿ‘๐Ÿ‘Œ
  15. Sorry, Barand. Just had to ask since there was an option no one mentioned. I changed it to E_ALL
  16. On the develop server (my local server) everything is set as you suggest Barand. On the production server (at webhuset) there is one difference. Error reporting is "E-all and E-notice". Is that OK or should it say only E-all? Display errors is set to off as you tell me it should. Log errors is set to on.
  17. Do you mean like this? catch (PDOException $e_all) { $output = 'ERROR: ' . $e_all;
  18. I have developed this database connection. I took a little from here and a little from there. I began to study it more closely. As I understand this, if this fails, it will release a lot of information to website visitors, such as passwords etc. Actually, the user does not need a lot of error codes if the connection to the DB is not successful. I am the one who needs that information. So how do I keep the print-to-screen information, but without the user on the website getting this information? I'm the only one who needs that information. Heres the script: <?php try { $pdo = new PDO('mysql:host=sql31.mcb.webhuset.no;dbname=**********; charset=utf8', '**********', '********'); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $output = 'No ERROR.'; } catch (PDOException $e) { $output = 'ERROR: ' . $e; } include __DIR__ . '/../templates/output.html.php';
  19. As I already said, it makes it easier and more readable with white spaces. I feel it that way. So, when possible, I put in a white space where I can. What about this block: <?php function loadTemplate($templateFileName, $variables = []) { extract($variables); ob_start(); include __DIR__.'/../templates/' .$templateFileName; return ob_get_clean(); } Can I have a space between the period/dot and $ here too? .$templateFileName;
  20. Ok, I like to have spaces too. It makes it more....... readable if you understand what I mean. I was not sure if it was this making the problem for me. If it depends if there is a space or not. Now I know for sure it is not here the problem is. I haven't looked into it today, so I don't know where the error is. But hope I find the error today. Thanks for helping me out and making it clear. I will look in ti your suggestion and see if I find out about this too. I bet you are into security reasons....๐Ÿค” Stressful day. ๐ŸคชThis was awfully bad English. Anyway, I hope you understand.
  21. Drop the value of dir? or do you mean that I should not use __DIR__ at all. What do you suggest I use as a replacement?
  22. I think i got some trouble with the code pasted below: include __DIR__ . '/../Templates/' Is it correct with a space before and after the period or not?
  23. Yes, you did. I read it before answering you, and it gave meaning. Thanks maxxd ๐Ÿ˜Š๐Ÿ‘
  24. I have put together what is a class (took me about 3 days, and I don't know if it works yet) and a controller (took me about 2.5 days, which I don't know if it works either), but I came up with something under way today in terms of the controller script. When you think about the technical language of PHP, doesn't controller have another meaning as well than just to mean that a form has been filled out correctly?
×
×
  • 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.