-
Posts
1,698 -
Joined
-
Last visited
-
Days Won
53
Everything posted by maxxd
-
From the Laravel documentation: $flight->name = 'Paris to London'; $flight->save(); From your code: $data->image=$request->image; $data->save; Do you see the difference?
-
Error Call to a member function library() on null
maxxd replied to vegabson's topic in PHP Coding Help
It looks like you're mixing versions of CodeIgniter - version 3 used load() while version 4 uses namespaces. I'm pretty sure there's an upgrade doc somewhere (it's been a bit since I've worked with CI so I don't remember specifically). -
What you're describing sounds like a FOUC (Flash Of Unstyled Content) and is usually caused by any or all of a few things: Slow-loading (typically remote) stylesheets Stylesheet links at the bottom of the page instead of in the head Javascript styling Does your site use jQuery or Google Fonts, for instance? I've had this issue pretty consistently with Google Fonts or Adobe Font Kit.
-
1. Honestly, no idea. I feel like at some point back in the day I made vertical-align work, but I haven't thought about it for so long that I have no idea how. 2. flex or grid 3. There's nothing wrong with the code you've posted, and using flexbox will get you the result you want. You just need to adopt it - there's not a browser available that can't handle it natively at this point and as you've clearly seen, the struggle is real without it.
-
Additionally - grid is also fantastic, but in my experience a bit more difficult to wrangle. Grid and flexbox are pretty much made to be used together and can do most anything...
-
Yeah, you want flexbox. There's also the idea that HTML should be semantic and a table should be used for tabular data output only. I don't know for sure that Google penalizes non-semantically correct HTML because Google prides themselves on not letting anyone know how they rank sites, but anecdotal evidence points to that being the case.
-
Best browser with the best tools for PHP development?
maxxd replied to sen5241b's topic in PHP Coding Help
Agree. I personally find Firefox dev tools easier to read and work with, but Chrome and Edge tools (given that they're pretty much the same) are certainly not bad. For PHP though, you're probably going to want to look at XDebug or something similar - browser dev tools are built to handle what happens in the browser, not on the server. -
What's the best way to create a booking calendar system?
maxxd replied to imgrooot's topic in PHP Coding Help
Available at all on a select date or available within a given time frame on a select date? If the only spec is that there are no other appointments or events on that person's calendar on that specific date, that's a simple question of a subquery where select all events on date are null. If you're talking time, that gets complicated with start times, end times, and overlaps of either or both. -
Just to avoid any confusion as it's not clear if you're referring to your $first_digit or $last_digit assignment, your second line will assume the third parameter is the length of the string - as kicken pointed out: Or, as stated in the manual: So, if your $last_number assignment was this: $last $last_number = substr($num, -2); it would also return 27.
-
Put your config file outside the document root, so put the file at /opt/lampp/config/config.php, then use require_once $_SERVER['DOCUMENT_ROOT'].'../config/config.php'; in your code.
-
JavaScript isn't going to set your PHP variable; $filePath is set somewhere earlier in the PHP file. Find that line and post it here.
-
I just want to point out that AD and MVC aren't mutually exclusive. Laravel, for instance, is an MVC framework with a built-in AR ORM (Eloquent). Patterns intermingle and build on each other to create a full code base, so you don't need to discount or dismiss AR if you decide to use MVC, and vice-versa.
-
I'll lay good money Barand is spot-on. Don't close out your php files - if there's a trailing newline it'll be regarded as output to the browser, and some editors add a newline by default on save.
-
../user/dbconfig.php outputs something - check that file.
-
It's a shorthand for if:else called a ternary operator. You'll have to scroll down the link for the full explanation as apparently there's not a name link there. Your reading of the line is correct, yes - a checkbox variable will only exist in $_POST when it's checked; so if it's checked and equal to 'a' $score will be 1, otherwise $score will be 0.
-
I use docker for all my setups. Base your image on the official PHP image and go from there. Complete portability, as long as the host machine has docker installed.
-
Your connection string is incorrect. Also, turn on error reporting either in the script or (preferably for local development) in the php.ini.
-
Wrap your entire page structure in a div, give it display: flex, flex-direction: column, and min-height: 100vh. Give the header and footer a max-height and flex-grow: 0, then assign the body div a flex-grow: 1. Sticky footer with dynamic page height, and unless you're still supporting < IE 9, should be pretty universally cross-browser by now.
-
You're missing a semicolon on this line: $data[$topic_parentid][] = array('id'=>$topic_id, 'name'=>$topic_title) $data[$topic_parentid][] = array('id'=>$topic_id, 'name'=>$topic_title)
-
I'm not entirely sure what you're trying to accomplish with everything after the mysqli_query (also, you may want to look into PDO as it's much easier), but what does this give you: die("<pre>".var_export($result, true)."</pre>"); if you put it right after the mysqli_query line?
-
You'll need to look into AJAX. Basically, using JavaScript you trigger a call (ajax or fetch) to a php script on your server - in the call you pass the selected value. The php script will use this passed value to determine what to show in the next drop-down and return that to the JavaScript which will then display that data to the user as a second drop-down.