Questions tagged [php]

PHP (PHP: Hypertext Preprocessor) is a widely used, high-level, dynamic, object-oriented and interpreted scripting language primarily designed for server-side web development.

Filter by
Sorted by
Tagged with
-2
votes
0answers
16 views

Why Messenger says that I'm active or not?

Messenger says that I activate or not, therefore, there was a green dot with showing we are online or not if there says time so know obviously before 5 minutes ago he was online. Read more about ...
0
votes
0answers
5 views

Rewritre URL htaccsess using GET method

I have a page name detail.php which handle variable from GET method and the URL displayed will be like domain.com/detail.php?v=tEDdwXC2dkq, but I want change it into domain.com/detail?v=tEDdwXC2dkq. ....
0
votes
0answers
6 views

How do I construct this snippet to store both date and time for column “publicationDate” in MySQL also adding another column “editedDate” to be added?

public function storeFormValues( $params ) { // Store all the parameters $this->__construct( $params ); // Parse and store the publication date if ( isset($params['publicationDate']) ) { $...
0
votes
1answer
13 views

How to send post data with AJAX, current solution not working

So I have a button where I want to use ajax to send post data to a PHP document then reload the page. Here is the button: <button value="ON" id="send" class="btn btn-block btn-primary btn-sm"&...
0
votes
0answers
10 views

One-pass algorithm (clarification needed)

A question about the One-pass algorithm. From definition on (https://en.wikipedia.org/wiki/One-pass_algorithm): A one-pass algorithm generally requires O(n) (see 'big O' notation) time and less than ...
0
votes
0answers
15 views

What is causing the 500 Internal Server Error in the script?

I am scraping the contents of a website using PHP. There are about 250 URLs. Sometimes, I will encounter a Captcha after one or two URLs and get the message about Captcha. Other times, the script ...
-1
votes
0answers
11 views

Fatal error: Call to undefined method WooCommerce::add_inline_js

Fatal error: Call to undefined method WooCommerce::add_inline_js() in /www/wwwroot/1.chinesespecialcolor.com/wp-content/plugins/alipay-for-woocommerce-master/class-wc-alipay.php on line 394 ...
0
votes
0answers
9 views

Disabling a dynamic HTML element with condition using JQuery

I have the following two html elements <div class="col-sm"> <label for="numberOfShiftPerDay">Number of Shift Per Day</label> <input type="number" class="form-control" ...
-2
votes
0answers
6 views

Please see image Download counts not work

please see image in my website download counts not work this show always 0 how to fix it enter image description here
0
votes
0answers
5 views

PHP upload script not working in some devices

I created a website that allow the uploading of files (songs) and everything was working fine but all of a sudden files stopped uploading in my own device but when i used another person's device the ...
0
votes
0answers
11 views

need help optimizing a sql statment using RAND()

I am currently working on a project that has a very large database of users and their different levels, however we where using RAND() and we are starting to get very high MySQL Cpu usage warnings from ...
0
votes
0answers
9 views

Laravel Auditing for event create, update, delete by Api

Is there have anyway to trigger audit for a model that create, update and delete by calling api. Actually i have a model and CRUD is doing by using Api..So if it is possible to use Laravel Auditing ...
0
votes
0answers
12 views

How can I code a PHP file upload specificly for json files that is secure and wont allow Php or html to be uploaded

I am working on a site that allows models to be uploaded. the models are json format like this : {"meta":{"format_version":"3.0","model_format":"bedrock_old","box_uv":true},"name":"crocodile","...
0
votes
0answers
19 views

Add if statement in submit function form jquery

I'd like to add the following if statement, so I can add this variable to the end of the string of my post call. It looks like this jquery if statement is not occuring. I had it right after the $(...
0
votes
0answers
7 views

php zend-db version: 2.10, Subselect

I used zend-db version: 2.10 in my project. now, I want to write the sql, but I don't know how to write. SELECT category_1_index.*, (SELECT real_name FROM ...
1
vote
1answer
11 views

How to make search results and pagination not disappear on click to next page?

whenever i click next page, my search results disappear and my pagination disappear as well. I want them both to stay whenever i click the page numbers, for example when i click next page, the table ...
0
votes
0answers
3 views

how to replace time zone in tabel use php, I try preg_replace() but show error

I have data from the database in the form of datetime and timezone, but I want to not display the timezone in a table using php, I have tried using preg_replace but there is an error, is there another ...
0
votes
0answers
5 views

Hostinger PHPMyAdmin Error 1045 Access Denied

I use hostinger to host my website. They have their own PhpMyAdmin section which im using for my database. Here is a snippet of this login: $host = "localhost"; $dbUsername = "root"; $dbPassword = ""...
0
votes
0answers
9 views

Using return view() will keep the submitted form data in the returned view allowing the user to resubmit on refresh

After submitting a form, I'm returning to a view as follows : return view('q1EvalCount',['type' => $ttype , 'day_qst_3'=>$day_qsts_3 , 'day_qst_6'=>$day_qsts_6]); After returning to the ...
0
votes
0answers
16 views

Call to a member function result() on boolean

its working on localhost but when i put it on free hosting, im getting the error An uncaught Exception was encountered Type: Error Message: Call to a member function result() on boolean ...
0
votes
2answers
19 views

Encapsulated calls in php

I have a project where I am in need of a specific piece of logic, but I am unsure how to express it in OOP php. I have seen things similar to what I need to do in frameworks like Laravel. Here is an ...
-2
votes
0answers
15 views

How to achieve this array manipulation in php [duplicate]

I have an array like below Array ( [0] => Array ( [id] => 12 [type_name] => Coffee [nlp_engine] => dialogflow ) [1] => ...
0
votes
0answers
8 views

PHP - Why am I getting a HTTP2 Protocol error only when doing a POST?

I am making two requests to a domain. When I make a GET request everything seems to be working fine. Then when I make a POST requests I get the following error, and I have no clue what it means or how ...
-1
votes
0answers
18 views

Bluehost database query

I'm fairly new to php and mysql. I'm working on a project, but I've been having trouble querying my database for weeks now. I'm using Bluehost and have the connection variables set, but it doesn't ...
-1
votes
0answers
8 views

PHP post data in dataTable disapear

I have a form in a php page with some parameters and this is a simple example (simplified) of my code. <form action="detailCommande.php" method="POST" > ... <input type="text" value="..." ...
0
votes
0answers
4 views

How to Redirect registration page in wordpress

my idea is, whenever someone visit my website he should be login or register to my website , I make custom login page and I redirect all page to that login page with the below code function ...
-1
votes
0answers
10 views

How to fix “Undefined offset: 1” [duplicate]

i'm using a json file, that some items has a "sub-item" and some dont. Example Json (w/ item) { "Price": 2000, "items": [ { "id": "ff3_rockerpunk", ...
-1
votes
0answers
9 views

Manipulating the DOM in a wordpress site. Doing it with hooks in functions.php vs just doing it via javascript

I'm a web developer but I'm new to using Wordpress. I'm comfortable with Javascript and I just want to know if I can do stuff like manipulate the DOM via JS instead of the Wordpress way(using hooks ...
0
votes
0answers
3 views

Magento 1.9 404 On 'media' Category Due To HTACCESS Rewrites

I am having the strangest issue on Magento 1.9, which I can't seem to find the best solution for. I have a category in Magento named 'Media', with the URL Key being 'media', so if I access a product ...
0
votes
0answers
6 views

Issue with displaying widgets in Timber-based WordPress theme header

I am having no success in rendering widgets in my theme's header. I want it to display beside my navigation, but {{ dump(header_widgets) }} is outputting NULL. I have tried all types of widgets in ...
0
votes
0answers
17 views

Comfile pi will not run python script from browser

I am using a Comfilepi to run a php page that calls a python script on click of anywhere on the screen. The php page is called CarWash.php and on click calls executepython.php which then runs pulse.py....
-1
votes
0answers
9 views

php: is_uploaded_file returns true but file is not found [duplicate]

I try to upload a file from my webside. is_uploaded_file returns true but the file is not uploaded (not found in /tmp). From move_uploaded_file comes 2 warnings: Warning: move_uploaded_file(tmp/...
0
votes
0answers
5 views

How to leave a mp3 voicemail after dial session receive busy signal asynchronously with Twilio?

I want to create a loop of dial sessions (after one dial session end, another one is created) in order to call multiple clients at a time. I have this method in action of my dial verb : public ...
0
votes
0answers
11 views

laravel excel export xlsx download not working

I'm using the Maatwebsite/Laravel-Excel 3.1 version library in Laravel to download an xlsx file. its working fine in localhost but not working in live server. UsersExport namespace App\Exports; ...
0
votes
0answers
5 views

Woocommerce: What hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api

I'm building a mobile app using wooCommerce REST API and need to inject the variations Id with the price in each attr option on REST API Product response. So the final response ( results ) of a ...
-2
votes
1answer
18 views

PHP How do I find the number of days until the next January 1 (without specifying the year)?

How do I find out the number of days until the next January 1 without specifying a year? I always want to know how many days until the next January 1, so I don't want to say "how many until Jan 1, ...
-4
votes
0answers
16 views

download all images and only images frorm comments of a post in Facebook

I have a post in Facebook have a lot of comments and i want to download all images from the comments to my computer , but only images not text comments how i can do this ? please help me it is very ...
-1
votes
2answers
48 views

PHP/mysql count duplicates and output as numbers [duplicate]

I want to count duplicates and output them as a number. database: user Sam Sam Tom Tom Tom John and here is my code: $sql = "select user, count(*) duplicates from users group by ...
0
votes
0answers
25 views

Laravel - what type of relationship?

I am just trying to learn Laravel and it's my first question here, so I hope I will describe it right. I have a 3 models PROFILE, CUSTOMER and VEHICLE (and also USER) user have a profile, every ...
-2
votes
0answers
13 views

Union WP table with external database table

I want to write a query and display results on html page. the query takes orders list and adds another column from other database table. both tables have same order id column that can be used to ...
0
votes
0answers
20 views

How to make this smaller [closed]

I have recently been starting to learn PHP, I created these functions and if statements to display a bar within the header. Do you guys know a way to make this smaller? I tried using a Switch, but I ...
0
votes
1answer
14 views

PHP count FTP files with specific conditions

I can't seem to find the answer anywhere. I'm trying to count the number of files in an FTP folder that meet certain conditions. I am using the following: /* * Filename examples: * Store ...
0
votes
1answer
19 views

Javascript, Unable to Get Mouse Position in iframe That Has Youtube Live Stream as src

Im am trying to get the position of the cursor inside of an iframe that references youtube. I can do this on an empty iframe no problem but as soon as the stream loads the browser is blocking me ...
0
votes
0answers
16 views

Compare PHP and mySQL database [closed]

I'm Working on a Website and currently working on the login feature, but when I try to compare it just doesn't work. I'm a total noob at PHP and mySQL so it would help a lot if someone could help me ...
0
votes
0answers
10 views

JWT - Access token signature validation using public key and pure PHP

Sorry about the long post but I think it is best to provide as much information in an orderly fashion as possible. I have checked all questions that I found regarding this issue in Stack Overflow but ...
1
vote
0answers
17 views

How do I echo a certain div class in php?

I have the following content: <div class="left"> left </div> <div class="right"> right </div> Using this line in php: <?php the_content(); ?> Give me this results: ...
-2
votes
1answer
26 views

Problem with MySQL Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO)

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in C:\WebServer\Apache2.2\htdocs\mensagens\config.php on line 8 nao e possivel I just write the code again and ...
1
vote
1answer
21 views

Insert query for mysqli seems to not be working and I can't figure out why

For a project on school I have to create a site for a company. I was working on the register system when I stumbled upon this problem. For some reason my query won't work on my databse. I've tried ...
0
votes
0answers
8 views

What is the correct order to modify a products archive query according to the $_SESSION value in WordPress?

What is the correct order to modify a product's archive query according to a custom stored $_SESSION value in WordPress?? I'm not getting right the SESSION VALUE. Its returning NULL. Could you point ...
0
votes
0answers
14 views

PHP Folder Rename and Updating MySQL table

I have a recursive category system on MySQL. When I create a new/sub category, new folder automatically created and path saved on category table. Everythings works fine but when I rename or move a ...