Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Code Reviews

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged php

4 child tags

Use for questions about the PHP language, a server-side web development scripting language.

This tag doesn't have a detailed wiki yet.

66%
+2 −0
Q&A PHP - Why using "global" considered bad?

In PHP why is using global like in the example below considered bad? $a = 1; class foo { public function bar() { global $a; // <-- Why is this considered bad? } } ...

1 answer  ·  posted 23d ago by Vanity Slug ❤️‭  ·  last activity 23d ago by matthewsnyder‭

75%
+4 −0
Q&A Is there any rationale for the lack of local constants in PHP?

The last few years, PHP has basically exploded with lots of modern language constructs that makes the life easier. But local constants are still missing, and I find that very strange. I have found...

0 answers  ·  posted 2mo ago by klutt‭

Question php
25%
+0 −4
Q&A Having problems with my php script [closed]

The exam checking for the backend is working perfectly well but the front end keeps saying an error occurred. Am like ok then tried the demo version replaced the javascript and everything i can rep...

0 answers  ·  posted 4mo ago by zick853‭  ·  closed 4mo ago by Mithical‭

Question php mysql
60%
+4 −2
Q&A How to speed up MySQL query?

I have a website about vacation villa rentals. Around 800 properties are listed. When i start a search, i get properties with my first query which filters type, style, area, no. of rooms, capacity ...

2 answers  ·  posted 5mo ago by erenlerhakan‭  ·  last activity 5mo ago by ArtOfCode‭

Question php mysql
50%
+0 −0
Q&A Adding two products into cart with help of a checkbox.

I've created a code snippet in "functions.php" that should add another product to your cart if you mark the checkbox, but somehow, only the original product is add (like the single product from the...

0 answers  ·  posted 7mo ago by gft‭  ·  edited 7mo ago by gft‭

Question php woocommerce
50%
+0 −0
Q&A Embedding other controller-action with Phalcon

I'm trying to revive an old project of mine. It was built with Phalcon PHP 2 or 3 (I don't even remember which version, but quite old). There I could include a call to the loop inside the controll...

0 answers  ·  posted 8mo ago by posthy‭  ·  edited 8mo ago by Alexei‭

Question php phalcon
71%
+3 −0
Q&A Load site based on cookie value in PHP

I need to load a site based on a cookie. I wrote code to validate that, like this. if(!isset($_COOKIE['cookie'])){ $domain = $_SERVER['SERVER_NAME']; setcookie('cookie', $cookie, time() ...

1 answer  ·  posted 2y ago by hajakutbudeen‭  ·  last activity 10mo ago by keyang‭

75%
+4 −0
Q&A How to use self referential N-M relationship to make 2 users friends using RedBean PHP ORM?

I am working with PHP and RedBean PHP ORM. I have a table user like so: id | username ---|--------- 1 | Alice 2 | Bob I want Alice and Bob to become friends. So I want to create M-M juncti...

0 answers  ·  posted 10mo ago by Vanity Slug ❤️‭

50%
+0 −0
Q&A PHP code is not excluding the watched videos.

Can someone explain why this PHP code is not excluding the watched videos? The email_id parameter is used to specify the location of the watched videos array. The code should remove the watched_vi...

1 answer  ·  posted 1y ago by Collins ‭  ·  last activity 12mo ago by dagelf‭

Question php mysql
40%
+0 −1
Q&A How To Verify Old Password in PHP? [closed]

I have a page to change the user password in my website, this page can only be used if the user have a logged in! The change password page have 3 inputs: Old Password, New Password and Con...

0 answers  ·  posted 2y ago by rrenildopereiraa‭  ·  closed 2y ago by Alexei‭

50%
+0 −0
Q&A How to to make a store tree view cart

I am building an MVC cart system. I have the MERCHANTS table and the PRODUCTS table. A merchant (store) can have one or more products, everything works fine but what I want is to display products b...

0 answers  ·  posted 2y ago by Fyoni‭  ·  edited 2y ago by Alexei‭

Question php mysql pdo treeview
50%
+1 −1
Q&A What solutions available for a CMS-agnostic contact form?

By principle, I normally work with two different companies for establishing websites for myself: One for domain registration and domain-sole email address One for web application hosting My ...

2 answers  ·  posted 3y ago by deleted user  ·  last activity 2y ago by Alexei‭

50%
+0 −0
Q&A Executing a PHP HTML-CSS container on top of various content management systems

I have created two PHP modules, one is a contact form module and one is a a sticky "call now" module. I can access the contact form by example.com/contact_form.php but in contrast, example.com/cal...

0 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

60%
+1 −0
Q&A What input functions can I use in TIO's PHP?

Try It Online! is an online interpreter for many supported languages, including PHP. I'm trying to solve coding challenges using the language, specifically "Hello, {name}!". In PHP, you can litera...

1 answer  ·  posted 2y ago by General Sebast1an‭  ·  last activity 2y ago by hkotsubo‭

Question php function input
50%
+2 −2
Q&A Splitting a large HTML file into two or more HTML files without JavaScript

I am developing a modular HTML-PHP-CSS no-JavaScript (JavaScriptless) contact form and the HTML is becoming increasingly large, around 80 lines (and could easily grow to be significantly larger as ...

1 answer  ·  posted 3y ago by deleted user  ·  edited 3y ago by deleted user

62%
+3 −1
Q&A Is the concept of a PHP lint feasible?

When I review JavaScript files in various text editors (Visual Studio Code, Greasemonkey/Tampermonkey) I sometimes get notified about syntax errors. I never encountered this behavior with PHP file...

2 answers  ·  posted 3y ago by deleted user  ·  last activity 3y ago by nelson777‭

Question php
50%
+1 −1
Q&A yyyy/mm/dd instead expected dd/mm/yyyy format in PHP-created-HTML output

I have an HTML-PHP-CSS contact form with a date field: <input type="date" name="date" id="cf_input_date"></input> The default value in this field is the W3C built-in default: dd/m...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Peter Taylor‭

Question php html css
60%
+1 −0
Q&A Backendly redirecting a user from a contact form webpage to a success webpage

On a CentOS Apache-MySQL-PHP environment I have a website with a simple HTML-PHP-CSS contact form; the contact form itself is working. This is how I backendly redirect a user from the contact form...

0 answers  ·  posted 3y ago by deleted user

Question php validation
50%
+0 −0
Code Reviews PHP for simple HTML-PHP-CSS contact form --- aimed solely for RTL websites

As a non PHP programmer I have tried to program some basic PHP mail() function code to send Right To Left (RTL) contact form messages to my local email client (i.e. an email client which is affilia...

0 answers  ·  posted 3y ago by deleted user

62%
+3 −1
Q&A PHP emails are sent when $message is a string, but not when its an array

I host my website on a CentOS-Bash, PHP and MySQL environment; my local email client is engined by Roundcube. I don't know almost anything about PHP nuances. While my web domain registration is do...

2 answers  ·  posted 3y ago by deleted user  ·  last activity 3y ago by manassehkatz‭

Question php
57%
+2 −1
Q&A Not obligating http:// or https:// in a url field of a contact form

I have a simple HTML-PHP-CSS contact form (no JavaScript) with an input type="url" field. Currently in 30/03/2021, the default behavior of input type="url" (by W3C design I guess) is to obligate t...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Alexei‭

Question php javascript html
71%
+3 −0
Q&A PHP variables aren't expanded when inside HTML which is by itself inside PHP

I transfer emails from my Right To Left (RTL) contact form → to my local email box (powered by Roundcube). Emails reach my email box (inbox) just fine but I have a problem were PHP variables aren'...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by luap42‭

Question php email
57%
+2 −1
Q&A Are JavaScriptless forms accessible?

I consider to make my website's contact form totally javascriptless (only HTML-PHP-CSS --- no JavaScript at all). No modals or alerts No prevent default No AJAX/AJAX/XHR/JHR No form disappear...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by Alexei‭

50%
+0 −0
Q&A Creating a Right-To-Left, primarily-backend, HTML-PHP contact form

I host my website on a PaaS-modeled, shared hosting environment by SiteGround which is quite a well known hosting company with (as I believe) well-venerated email servers. I am trying to create ...

0 answers  ·  posted 3y ago by deleted user  ·  edited 3y ago by deleted user

Question php html contact-form
50%
+2 −2
Q&A Mocking tempnam() with vfsstream

How do I mock tempnam() with vfsStream for code that uses it to create temporary files (for example, in a PHPUnit test)?

1 answer  ·  posted 3y ago by tyteen4a03‭  ·  last activity 3y ago by summea‭

72%
+6 −1
Q&A What are the pros and cons of using objects vs associative arrays for JSON results of a CURL request in PHP?

I have a PHP script that uses CURL to return a JSON result that looks //Curl set up code $result = curl_exec($ch); //Error checking code $json = json_decode($result, true); //Code to process r...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Yaskur‭

Question php json
71%
+3 −0
Q&A In PHP what is the use case for include instead of require when including PHP scripts?

In PHP one can either use include or require to include files, the difference is that if the file doesn't exist it will emit a fatal error and halt with a require and only emit a warning with inclu...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Marijn‭

Question php
71%
+3 −0
Q&A Iterating through a MySQL table with a LIMIT clause and PHP gets progressively slower

I have a very large table that I need to iterate through with a PHP script and I can't do all of the results at once so I do it in sections with a LIMIT like for ($x = 0; $x < 10000000; $x += 1...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by ArtOfCode‭

Question php mysql
80%
+6 −0
Code Reviews PHP script to create a KML square centred on a point.

The objective here is to create a set of square kml coordinates centered on a point. I use this to create a square map centered on a mountain peak and then turn that into a STL that I can 3D print....

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Moshi‭

Question php stl-format
80%
+6 −0
Q&A How to store credentials for PHP scripts on a Windows machine?

I have a number of command line PHP scripts that are either run by a user or by Windows Task Scheduler. These scripts use DB and API credentials and I am wondering if there is a better way of stori...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Charlie Brumbaugh‭

Question php windows