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.

0
votes
0answers
2 views

wp core install cannot connect to database with WP-CLI

I don't know why it's doing this but for some reason, when I try to install WordPress with WP CLI with wp core install, it cannot complete and throws the Error: Error establishing a database ...
-1
votes
0answers
6 views

Please tell me how can i fetch the price in the textbox from database of that item which i select from select drop down in PHP

I want to make the same software as you can see in the link below. Visit http://www.saifinfosystem.in/quot.php
0
votes
1answer
8 views

Strip any unknown characters from string php

I have a restful web service, that gets input string, sanitizes it and saves it to MySQL database. My workflow looks like this: I get string, I trim it. Then I remove any non alphanumeric characters,...
0
votes
0answers
9 views

If we throw an exception that's not caught again, do we get an empty response status?

Basically, I was sending a ajax request with an object with some missing json data, and I was wondering why I didn't get a status code and no response data. So I tried it several times and the ...
0
votes
2answers
11 views

How To jQuery toggle() and Hide Toggle Link or Button?

I am using PHP sessions to to provide specific forms on a page and need to toggle between a "show form" link and the form. I have this working using jQuery toggle(), but I cannot figure out how to ...
0
votes
0answers
15 views

comments are not showing on godaddy

i am poorly trapped and also not getting any proper support from the Godaddy customer care. I have a comment section which is working perfectly on localhost and some other hosting but it is not ...
-3
votes
0answers
16 views

How to make Ajax request without loosing PHP Session?

I'm loosing my PHP session each time i get a another PHP page with ajax request. I'm currently developing an eCommerce admin dashboard, and i could not figure out why i'm loosing my page sessions? ...
0
votes
1answer
7 views

Pagination in wordpress posts

I have been given this post template to work with, I am trying to get the posts to paginate, how would I go about achieving this? Apologies if I am asking about this/approaching this in a naive way. ...
-4
votes
0answers
10 views

How to implement PayDroid Payment Gateaway to my website? [on hold]

I can't able to integrate the PayDroid Payments Gateway to my website... I tried to get info from the website but I m unable to integrate it ... You can check the website - https://payments.argdroid....
0
votes
2answers
21 views

Laravel request is an array but not recognized by count()

I am passing an array into my controller via axios.post request. I am trying to get the length of the $request array that I am passing to the controller. However, I keep recieving a "Parameter must be ...
0
votes
0answers
7 views

WP: Unable to replace upload in AWS S3 bucket using Enable Media Replace

I'm currently working on a Wordpress site where I am making use of the Enable Media Replace plugin. The enable media replace functionality help to overwrite an upload with a new chosen document. The ...
0
votes
0answers
10 views

How to redirect my website to another website only on mobile devices? [duplicate]

I have a website www.unicodea.com and I am gonna create its subdomain app.unicodea.com. So I want that whenever user opens www.unicodea.com in a mobile device it should redirect to app.unicodea.com. I ...
0
votes
0answers
6 views

php\r nu such file or directory when trying to run phpunit

So i'm trying to run phpunit in my vagrant server in virtualbox(ubuntu) for a project on school but i'm unable to. I'm certain that my that phpunit is located in vendor/bin/phpunit and my test ...
1
vote
0answers
18 views

The “Responsive filemanager” plugin does not work ”- Plugin for TinyMce 5

I warmly welcome. I apologize for my English, but I translate it with google translate. I am trying to install the "Responsive File Manager" plugin (https://www.responsivefilemanager.com/) I moved ...
0
votes
0answers
8 views

AJAX search inside hook_form_alter()

I don't know how to implement AJAX in hook_form_alter(). Field is plain text by default and it is populated by NID (number) of client company. Module name is "my_car". I didn't used node reference on ...
0
votes
0answers
13 views

HTTP client/ “file_get_contents()” makes Laravel application time out because of loading time

I am currently using Guzzle to fetch data from a resource, and this is inside a Laravel application. The function to fetch the API is located in the function of a controller. Whenever I load a page (...
-3
votes
0answers
14 views

Inserting shoping cart data into database [duplicate]

I have create shopping cart webpage PHP and I get error when inserting selected cart data into the database.The error image attached. I receive error of Array to string conversion and ...
-2
votes
0answers
20 views

Why can't I access my table from the database? [duplicate]

Why am I unable to do a select query.I am able to connect to the database Look down at what I have tried <?php require "connect.php"; $query="SELECT * FROM user_info"; $conn=mysqli_connect("...
0
votes
2answers
18 views

Using css for styling a dynamic menu

I have this code for a dynamic menu using php: menu.php: <?php // Get current page file name $page = basename($_SERVER["PHP_SELF"]); ?> <?php include "templates/header.php"; ?> &...
0
votes
1answer
18 views

Issues with Progress Bar

I have this progress bar and what is shown as the description is decided based on has the customer set his targeted reward or not (by checking in database if a value is null) but i set a value to be ...
0
votes
0answers
5 views

Samsung PM55H TCP Connection on port 1515 refused

I wrote a PHP script with multi display commands (MDC) for monitoring the Samsung Smart TVs (Model PM55H) in our company. I works perfectly fine, but I have 2 devices which always answer "connection ...
-1
votes
0answers
28 views

Displaying images via link from database ? (PHP/MYSQLI) NEWBIE

Is it okay if i store links in the database to the images and then just display them in the website ? is this a bad practice ? Example code below <? echo "<img src='/projects".$row['image']....
3
votes
3answers
27 views

Laravel - Convert array back to a collection

I am trying to get a collection of categories only if they are in the products table. My categories table has 300 items. I only want a collection if a category is attached in the products table. The $...
0
votes
1answer
12 views

Can not find autoload.php when running laravel in a docker container

I am trying to run laravel on a docker container. However, I created a docker file to install the required dependencies and extensions. Then, I created a docker-compose file to run the container. But, ...
0
votes
1answer
15 views

How to get the fingerprint of a public key?

In PHP, I have a public key (already as an OpenSSL resource). I'd like to calculate that public keys fingerprint (SHA1 or other hash). How do I do this? PHP version is 7.2 or older.
-3
votes
1answer
20 views

How to create button click function

I created button click function in php and it won't print. //create button click if(isset($_POST['create'])){ echo "created button clicked"; } Please help, thanks, Jacky
1
vote
0answers
13 views

How to save value from quote in custom attributes of customer object?

I need to keep the values ​​from the quote in the custom attributes of the customer object. This is necessary for the user to be able to add additional fields on the checkout. I added 2 custom ...
0
votes
2answers
28 views

I have a function to generate random string,I want it to generate more than 1 line of random string

I have a Function to generate random string ,it produce more than 1 random string ,but how to separate them Function generatorstring($count) { $karakter = '...
1
vote
1answer
18 views

What should i write in the img tag so this works

The image dosen't show up on the website. I have tried different codes. I have a database row imgFullNameGallery and a folder (img/gallery/). <div style="background-image: url(img/...
3
votes
1answer
27 views

Insert statements working when inserting emojis, but throws error when using eloquent

Running the query, INSERT INTO table (ref_id, user_id, role_id, text) VALUES (233, 3, 40, 'Hdhdhdh😜😀😊😃hzhzhzzhjzj 我爱你 ❌') works just fine in Sequel Pro, but when using eloquent, it throws an ...
2
votes
0answers
21 views

How to return a BSTR which contains multiple null characters from a COM DLL

I'm creating a COM dll that can be used from PHP to read a memory mapped file whose size I already know, while I have no problem reading the file, I can't return it correctly as a BSTR. When I use the ...
0
votes
1answer
10 views

Separate line breaks (new line down) in a text file when reading the contents of the file from a directory of text files

I need to separate line breaks in a group of text files in the output. Currently, we can display all the text files in a folder on a webpage in blocks but the text data is combined in the block of ...
0
votes
1answer
10 views

How to Include Something Like &trade; in a Sitemap

I'm trying to generate a sitemap using php, and I'm getting errors because some of my product names include "&trade". I know that & needs to be escaped to &amp, but I'm unsure what to do ...
2
votes
0answers
27 views

Trying to display an ipcam on my website but a popup isn't being displayed and preventing the video feed

Creates a popup that I cant see on my website and just says connection unavailable. Typing in the address of the camera: http://<IP-ADDRESS>:<PORT>/video.cgi?user=<USER>&...
0
votes
0answers
8 views

503 Service Temporarily Unavailable after running an import-script

I have a domain on a Plesk server (version 17.8) with CentOS 7. Prestashop is installed on this domain and the products are imported via a self-programmed module. When I start import then I get the ...
-1
votes
0answers
12 views

Github PHPMailer contact form script not sending mails [duplicate]

I downloaded a sample phpmailer script from Github and i followed all necessary procedure but when the submit button is clicked the page just refreshes and no form data is sent to mail and i get no ...
0
votes
1answer
7 views

How to add_action to Woocommerce hook?

I simply want to add an action to an existing Woocommerce hook (woocommerce_after_cart in this case). After adding a function with add_action() and loading the page back up, my function doesn't run. ...
2
votes
1answer
25 views

Getting Undefined property: stdClass::$migration error in Lumen when making a migration

I've built and run 1000 migrations with Laravel/Lumen and I've never seen this happen before. I'm running a dev copy of my application locally, I'm using sqlite with the latest Lumen. This is what ...
1
vote
0answers
10 views

phpWord add chart to location specified by a variable on a template

I'm trying to insert a chart into an existing .docx file, somewhere in the middle of the file. There are other sections where I had to insert numbers generated by my code which I just did using the ${...
-1
votes
0answers
32 views

Warning: Illegal string offset 'rates' in … line 14 [duplicate]

A free USD:CAD rate api is no longer free, I didn't code this script but it no longer works. I found another free USD:CAD rate api but I need to update my script for it to work. I did to the best of ...
1
vote
2answers
22 views

Binding a DATE parameter using PDO::PARAM_STR

I am working with php and I am trying to insert into a table. However I am getting an Invalid character value for cast specification error. I believe the error is coming from trying to bind a Date ...
-1
votes
0answers
17 views

Php SQL Database Not Functioning [duplicate]

Everytime I run the following code my database refuses to connect despite all of the login credentials seemingly being correct. I am not operating on localhost but rather a website I own running ...
0
votes
0answers
6 views

Wrong redirecting but only standard WP-Rules in .htaccess

Problem: I have a download link with an ip as "site name" http://192.168.1.1/downloads/file.txt This is redirecting to https://www.mywebsite.comdownloads/file.txt Now I want it of course to ...
-1
votes
1answer
8 views

Get product visibility value - WooCommerce

I need to check the visibility status of a product by it's id. NOT just if it is visible or not, but if it's search, hidden, or visible. I have tried get_post_meta($id, '_visibility', true);, ...
1
vote
1answer
19 views

Parse simpleXML

Hi have a sample data and I want to extract responseMessage from this. `var_dump($response) which print something like this: object(SimpleXMLElement)#34 (3) { <br> ["responseMessage"]=><...
-3
votes
1answer
20 views

How to work with a php element/value in outsourced javascript file?

I have to outsource the javascript code for the installation of security layers. Now I came across the following command : var aPictures = new Array(<?php echo $sPicturesWithPath ?>); Is ...
0
votes
0answers
26 views

Styling a dynamic menu using css

I have this simple code that creates a menu using HTML: <?php // Get current page file name $page = basename($_SERVER["PHP_SELF"]); ?> <div id="navigation"> <ul> ...
2
votes
0answers
22 views

Is it possible to use index.php instead of index.html in a vue.js project built with webpack?

Well i've got some login in a different app built in just php and when i try to get those session vars i lose them. i was thinking i could solve that problem just changing the index.html instead index....
1
vote
3answers
60 views

Creating arrays from inputs?

I wish to store an arbitrary number of answers to a question on a form in a single field (json). So the inputs may be something like: Your Jobs: job title start date end date I know I can call the ...
1
vote
1answer
20 views

How can I update some placeholder text using form, input and php?

I am trying to update some placeholder text (not the placeholder attribute) with values that come from a form-input, that are all on the same HTML page. So I have one index.html file and one test.php ...