All Questions
1,463,487 questions
Best practices
2
votes
0
replies
32
views
Use PHP TS as Apache module and FCGI
php.net site write:
NTS builds are for single-threaded use cases, typically PHP running
via FastCGI or on the CLI. TS builds support multithreaded SAPIs and
are intended for PHP loaded as a web ...
-1
votes
0
answers
51
views
PHP strpos() cannot find string in curl_getinfo() result [closed]
This is a part of my code:
$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
fwrite($file, $content_type);
if(strpos($content_type, "text/html") === false)
{
// do some things
}
.....
Best practices
2
votes
12
replies
159
views
Does my code look secure? And How do I prevent people from entering a page?
To practice php I created a login system that only works for 1 user, and if you type in the wrong username/password it will kick you out. If you type the right one it sends you to a devtools.php. I'm ...
Advice
3
votes
5
replies
71
views
Dashboard Setup: Same Repo or Separate Project?
I finished coding my project, but it requires a dashboard. What should I do? Should I create a separate repository or project for the admin dashboard, or use a monorepo?
Best practices
3
votes
5
replies
106
views
How to avoid page rendering delays in PHP and JavaScript web development?
fellow developers!
I’ve been working on web development projects using PHP Native for backend and Vanilla JavaScript for frontend. Sometimes, I notice that my web pages take a noticeable time to ...
-1
votes
1
answer
115
views
Why is my PHP query string malfunctioning?
I am writing a simple web-app to display flashcards using PHP, SQL and HTML.
To show the cards currently created I have a page called view_cards.php which loads with a query string comprising the ...
-4
votes
2
answers
68
views
Append instances of specific word in string with incrementing integer
I have some text like this:
Lorem ipsum THIS dolor sit THIS amet, consectetur THIS adipiscing elit.
and it needs to be like this:
Lorem ipsum THIS1 dolor sit THIS2 amet, consectetur THIS3 adipiscing ...
0
votes
2
answers
74
views
How to toggle bootstrap nav pane from a button
I have successfully implemented a tabbed pane design with collapse for small screens.
On one of the panes I would like to include a button which toggles to another pane.
I have tried unsuccessfully ...
-1
votes
1
answer
96
views
How to make reflinks in PHP?
How does one make reflinks in PHP?
I found symlink() to make symlinks, and link() to make hardlinks, but I don't see any reflink function.
Advice
0
votes
1
replies
46
views
Is there a way to use relative component paths when using blade
I am working on a fairly large project, and have a lot of components.
Those components are grouped in folders like so:
- views
- components
- bootstrap
- navbar
- navbar.blade.php
...
1
vote
1
answer
136
views
created_at (server time) is sometimes earlier than clicked_at (client time) — why?
I’m tracking button clicks on my website and storing both client-side click time and server-side insert time in my database.
Frontend (JavaScript)
I capture the click timestamp like this:
clicked_at: ...
Advice
1
vote
4
replies
153
views
Confused which one to take: js or php for back end (Laravel or Node.js)
I am currently learning Laravel PHP, but I feel a bit confused. From what I see, there seems to be less demand for Laravel at the moment. On the other hand, I hear that JavaScript—especially Node.js ...
1
vote
0
answers
81
views
Laravel app handling redirects unexpectedly
I have two apps running on the same server behind a Webscale proxy (Apache). A Laravel 11 app works correctly, returning a proper 302 with session cookies. My new Laravel 12 app returns 200 OK with no ...
3
votes
2
answers
153
views
How to accurately "JSON.stringify" in php (codeigniter4) according to Node/express JSON.stringify for Sha256 validation?
I'm having problem comparing a sha256 for a webhook validation from this documentation:
API doc: docs.api.delyva.com
API guide: delyva blog
webhook validation (sample from API provider/delyva):
const ...
1
vote
2
answers
69
views
Laravel localization using session not applying globally (locale changes in session but app()->getLocale() stays unchanged)
I am trying to implement localization (English/Japanese) in a Laravel 12 project using session-based language switching.
I have a route to switch language:
Route::get('/lang/{locale}', function ($...