Questions tagged [php]
PHP is a widely used, open source, general-purpose, multi-paradigm, dynamically typed and interpreted scripting language originally designed for server-side web development. Use this tag for questions about programming in the PHP language.
1,443,919
questions
0
votes
0
answers
14
views
Simple shopping cart with while loop
Right, so I'm working on very primitive online shop (since my knowledge of PHP and MySQL is basic at best) and currently I'm trying to get a cart working.
I know that there is plenty of guides ...
0
votes
1
answer
3
views
Google Ads API - OAuth2 - PHP Error - authorization_error - "login-customer-id" header - GetCampaigns.php / ListAccessibleCustomers.php
With the "Google Ads API" - PHP Client Library.
While calling the "GetCampaigns.php" / "ListAccessibleCustomers.php" example code. I was still getting this error (below) ...
-1
votes
0
answers
10
views
Symfony render service content in view
I have issue with service with symfony. I do not know why, but my view render raw php code in view. Anyone has any suggestion. This is my view.
{% extends 'base.html.twig' %}
{% block title %}Hello ...
0
votes
0
answers
10
views
Add the subtracted value from previous user value in laravel
I have run into an issue where i am adding the point for a user with the previous point already stored in the table via laravel. Now I have an issue where i need to loop all the points of a specific ...
0
votes
0
answers
10
views
Update all blob columns in all tables in MySQL
We are migrating a wiki system from MediaWiki v1.25 to v1.35 while using a cloned database in the same MySQL server, but in a new Apache server. The issue is that, after doing all the steps mentioned ...
0
votes
0
answers
12
views
how to edit string in .htaccess file?
hey guys I am trying to edit the contents of htaccess by PHP
I used this code but it's replacing all the file but I just want to replace the contents between
##START DOMAIN## & ##END DOMAIN##
here ...
0
votes
0
answers
16
views
Determine a user's current local time based on their country ISO code in PHP and MySQL
I'm using a CRON task to run a PHP script that sends emails in the afternoon according to the recipients' local time determined by their country's ISO code.
I don't store dates in UTC, so I can only ...
-1
votes
1
answer
13
views
Fatal error: Cannot redeclare add_theme_support()
I have a directory and file like this
folders
functions.php
<?php
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
}
function add_theme_support() {
...
-3
votes
0
answers
26
views
Point me in the right direction for creating a search engine on my website [closed]
What is the best option is for creating a working search engine on a website.
Mainly I'm looking for an option that provides tables/columns for a search engine. Whether it's using MySQL or not.
Does ...
0
votes
1
answer
5
views
Displaying duplicate text within a JSON array using php
I have an array inside a php file in JSON format. I want to display the most frequent element of the name object
<?php
$mydata='[{"data":[{"name":"amr selim","...
0
votes
2
answers
18
views
PHP - How to combine a list of arrays that are at the same level
After flattening a multidimensional array, I have an array named $array, which running print_r($array) on gives me the following output:
Array
(
[0] => 9999
)
Array
(
[0] => 8888
)
Array
...
-1
votes
0
answers
19
views
Trying to pull a record from my database that has spaces in its content
I got a website and I'm trying to pull out data that contains a space in it.
So on this page it shows certain cars, so it would say 2016 Toyota SFR Racing. The year and the model name is stored in one ...
0
votes
0
answers
10
views
Docker not creating files on configured volume in YAML script
I made the following script in docker-compose.yml, which tries to run a official PHP + Apache image from Docker Hub:
services:
apache:
image: 'php:5.6-apache'
container_name: apache
...
-1
votes
0
answers
9
views
PHP PEAR Mail SMTP response on success
Here is my code:
$mail_object = Mail::factory('smtp', $params);
$send = $mail_object->send($email, $headers, $body);
if (PEAR::isError($send)) {
$error_message = $send->getMessage();
So, ...
0
votes
0
answers
13
views
htaccess impossible to remove index.php?page= tried 5 codes
My php code:
<?php $definedPages = array ( 'dir/site5', 'site1' );
$page = (isset($_GET['page'])) ? $_GET['page'] : 'default.php';
if(in_array($page, $definedPages)) ...