Jump to content

LeonLatex

Members
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. I said I cant find the errors, so guess. I cant see them.
  2. 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'; } }
  3. 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)
  4. Of course ๐Ÿค“๐Ÿ‘๐Ÿ‘Œ
  5. Sorry, Barand. Just had to ask since there was an option no one mentioned. I changed it to E_ALL
  6. 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.
  7. Do you mean like this? catch (PDOException $e_all) { $output = 'ERROR: ' . $e_all;
  8. 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';
  9. 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;
  10. 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.
  11. 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?
  12. 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?
  13. Yes, you did. I read it before answering you, and it gave meaning. Thanks maxxd ๐Ÿ˜Š๐Ÿ‘
  14. 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?
  15. After a long-awaited night's sleep, I reassembled the entire DIV stack with CSS. Then it was all right.
  16. But what if these two DIV's is inside a DIV?
  17. Faen! I didn't see the quotes. Thanks Barand ๐Ÿ˜Š๐Ÿ‘๐Ÿ‘Œ
  18. Why can't I get the color I want? This is a color listed by W3 Schools: w3-win8-steel <a href='<?=$HOST?>index.php' class='w3-bar-item w3-button' 'w3-win8-steel'>Home</a>
  19. That wasn't my question. I was asking for help if somebody remember that post where they have an answered me.
  20. Previously, I think it was here that I got tips instead of setting up a page with templates as I have done before by importing "header.php, front.php, footer.php". <? include $ROOT.'header.php'; include $ROOT.'front.php'; include $ROOT.'footer.php'; ?> The thing is, I was told about a new way to do it. Can someone tell me the way to do it? I don't remember where I was told that.
  21. Thanks, Barand. I made it with your second answer. The answer above is a good bonus.
  22. Thanks barand. I tried a little myself by using the transform: skewX(45deg); But this wasn't working. I used some time on it but gave up for the evening. Then I came over/I saw your example too late, but when I did, I tried your script, and that was working (of course ๐Ÿ˜Š๐Ÿ‘). Hope it's ok if I copy and paste and saves your code on my network for later use? This was great๐Ÿ˜Š thanks ๐Ÿ˜Š
  23. I contacted Adobe same night. The person I was talking to couldn't give me a clear answer on this issue. But if i want to have it colored i could just go in to the setup and corect it there. I left it like it was, but felt i was siting there, against all my self-experienced (when i was working as a support agent) .... just sitting there with my beard in the mail box asking my self: Is this what i am paying 60 euros /month for ๐Ÿ˜ฎ๐Ÿ˜‚
  24. Then it will be..: transform: skewX(25deg);
×
×
  • 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.