Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/07/2021 in all areas

  1. Yea, I'm always willing to learn though. The project I post on here mostly about literally started with 2 files and expanded into hundreds over the past year. I hadn't even owned a computer in 5 years until I bought this laptop last year specifically to try to make this project. Pretty much had to completely relearn HTML, CSS, JS and learn from scratch AJAX/JSON, MySql, PHP, GIT, OOP, working with APIs etc, it's been quite the journey. I have no background nor training in webdev, it's totally a self-taught project, in which this forum has been invaluable. Saying all that, I wouldn't even know where to start in the direction you're speaking of. Are you referring to frameworks like Laravel?
    1 point
  2. File paths and URLs are not always the same thing. Look at your browser's address bar right now: does it say? https://forums.phpfreaks.com/var/www/forums.phpfreaks.com/index.php?controller=idontknow&action=something&whateverelse&id=313889&name=altering-percieved-resource-path If your $root is also the root of the website then there's a really easy way to get an absolute path: start with a slash. That's it. / in the URL will correspond to the $root. <link rel="stylesheet" type="text/css" href="/css/actors.css"> <link rel="stylesheet" type="text/css" href="/css/gallery.css">
    1 point
  3. I hate it when people embed php tags into their html code. Learn to write without having to do that. (just for grins - I use exactly one set of php tags in my entire scripts all the time) As for example 1 - should have worked I think. #2 tho is not gonna work since it obviously is not in php mode since there is no echo and therefore the variable won't be interpreted. Have you examined your web page when it loads to see how it looks onscreen?
    1 point
  4. Firstly, I doubt anyone is clicking a link from a first-time poster. Second, what you are doing, updating with parts of a column, is indicative of problems in the database design. What is the structure of those two tables and what does the data look like in the relevant columns?
    1 point
  5. You have a problem with file paths and somehow making one file appear to be in another place is the opposite of a solution. Consider that someday you, or maybe someone else, would look at that code and wonder how the hell it seems to be including the correct file when the file path is clearly wrong. 1. If you need to move the file then that sucks. Move the file and get it over with. IDEs can often help with rename operations, otherwise it's real simple to do a quick global search for "page.php" and update the paths you find; unless you have hundreds of files, that should take only a minute or two. 2. If you do have a lot of references to change then that hints at an underlying problem in how you use files for reusable code. Give it a few minutes of thought to see if maybe there is a better way of arranging your code or whatever so that it's accessible in a way that makes more sense. 3. Don't use relative paths. Use an absolute path based on the DOCUMENT_ROOT, as in include $_SERVER["DOCUMENT_ROOT"] . "/pages/page.php";
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.