1,463,483 questions
Best practices
1
vote
4
replies
53
views
input text Remove operation by condiiton
firstly I will thanks for anyone whom make an effort to help resolving some codes in this forum.
I have a operation logic to do in two simples steps into a input value. For me it's like a input ...
2
votes
2
answers
80
views
PHP Script not timing out while using curl_exec( )
I have a php shell script that runs at scheduled intervals via launchd. The script has a 2 minute php timeout, but I understand that time spend in curl_exec( ) doesn't count towards that. But I also ...
Best practices
0
votes
4
replies
77
views
Simple PHP API example
<?php
include "./db_functions.php";
$method = $_SERVER["REQUEST_METHOD"];
$uri = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$uri = explode("/", $...
Best practices
0
votes
5
replies
73
views
Simple SQL (Get and Edit Data)
<?php
// get data or modify data
function getData($sql){
$db = new mysqli("localhost", "root", "", "database");
if($db->...
1
vote
1
answer
47
views
CodeIgniter cron endpoints: best practice for daily scheduled execution, date-window processing, and token-gated stage 2
I’m working on a CodeIgniter (PHP) app with a 2-stage batch process:
Cron 1 (syncAndPrepareQRTokens)
sync eligible members to member_benefits
generate qr_code_token
Cron 2 (execute)
generate PDF + ...
Best practices
4
votes
1
replies
53
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 ...
-2
votes
0
answers
63
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
14
replies
212
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
4
votes
6
replies
86
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
130
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
138
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
73
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 ...
1
vote
2
answers
92
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
107
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
54
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
...