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
3 views

Using MySql data row value as html table headers and divisions in PHP

I want to dynamically generate an HTML table based on MySql data, and the user would be able to update the table directly on the page (through JQuery and Ajax). Week rows will be inserted for the ...
0
votes
0answers
7 views

Echoing un-escaped HTML

Guys! Very unusual question. I came across some code some years in the pass that was including conditions and normal PHP syntax while echoing all content. My question is how is that Technic/syntax ...
0
votes
0answers
3 views

How to get PayPal Advanced API credentials?

I have my store on cscart and I want to setup PayPal Advanced on my store. So I want to know how to get PayPal Advanced API credentials from Paypal after login into Paypal account. Need Following ...
0
votes
0answers
6 views

private class with array from database

i have private class with array : class Whois{ private $whoisServers = array( "ac"=> "whois.nic.ac", "ae" => "whois.nic.ae", "tech" => "whois.nic.tech", "yu" => "whois.ripe....
1
vote
2answers
12 views

PHP SQL form with JS action - show result only in individual div instead of all

I need to echo the result of a dynamically created form post request only in one div. The original table and scripts are more complex, but I broke it down to the basics for this example. Table: ...
-1
votes
0answers
7 views

How to echo a specific words from a txt.file with php?

I have just started with php, and cant get a hold of it. I have a txt file with a dozen of words, and only one starts with letter A, but i am struggling to echo that word, i have this code below, but ...
0
votes
1answer
18 views

PHP echo user text into chatbox div causes Undefined index error ( My Question is not about the session_start(); placement) [duplicate]

I am creating a chat website where people put their text into a input box and then it appears inside a chatbox. I'm trying to do this by turning the usertext into a session variable and then echoing ...
0
votes
1answer
18 views

PHP - Creating dependent dropdown lists

So, I have two dropdown lists which are populated with data from two seperate mysql tables connected with a foreign key, I was wondering am I able to make them dependent using php alone (without the ...
0
votes
0answers
10 views

Single Sign On - Workflow

It was proposed to develop an SSO, but I'm not very knowledgeable about it. Tell me if this makes sense and where to start? I have 3 apps A - Developed in Python (Django); B - Developed in PHP (...
0
votes
0answers
11 views

Slim application Autoloading

I am newbie on REST and Slim applications. I was not able to autoload some classes: Type: RuntimeException Message: Callable UserController does not exist File: /var/www/fdes/vendor/slim/slim/...
0
votes
1answer
26 views

Images from home page on website disappear on mobile

The website is www.jobconscious.com and the pictures on the home page disappear when the browser is resized to mobile size/view and when on mobile.
-1
votes
1answer
23 views

In a loop one iteration should be plus (+) and one minus (-) vice versa in PHP

Have a logic, I am not sure what does it called but need to calculate as under. $mainNumber = 6; $finalData = []; $operator ='+'; for ($i = 1; $i <= $mainNumber; $i++) { switch ($operator) { ...
2
votes
3answers
22 views

How do I check if URL contains certain words

I want to show custom content if current URL contain certain words. So far, I'm able to achieve this if the URL contains just the word, 'cart', using the code below. However, I want to be able to ...
0
votes
0answers
12 views

laravel mix not able to find style.css or images on front end - where am I going wrong?

I am using laravel mix to bundle my assets and I can't seem to get my bundled styles.css or images working in the front end, I get the console errors below: Codebase: https://github.com/bennkingy/...
-1
votes
2answers
20 views

Php Get request with client parameters

I need to make a http get request in php. So far I have the php go to the url and login via the username and password parameters. However the url I am trying to access generates a token using my ip. ...
0
votes
1answer
20 views

How do I clear the screen, echo variable and repeat?

I know this question has been asked previously on stackoverflow but when I tried to implement the solution myself it didn't work. This is what I am trying to do: Clear the screen. What I mean by ...
0
votes
1answer
15 views

How can I use either Dynamic SQL or mySQL Prepared statements to filter search results from a dropdown list?

I only have about 2 months worth of PHP under my belt, but I am having trouble trying to find an answer to a problem. I want to at least have four dropdown menus that will have options of selecting: ...
0
votes
0answers
6 views

PHP CLI - Running Multiple Async/Disconnected Exec Commands

In php, you can make system commands using the exec() function. Just like a command prompt, you can use a semi colon to send to commands at once. exec("command1; command2"); Works great. Also, you ...
0
votes
1answer
13 views

Customize Cart Totals and Checkout Totals Text based on product categories

I'd like to customize the text in Cart and Checkout order summary tables based on the product category (or some other logic). For example, for the 'Total' text (see image) - if the cart contains ...
0
votes
0answers
17 views

Combine a Button and a Input using JS to 1 Click

Once i again ill have to ask a question. I have a (designed as a Button) and an actual . One is sending an SQL Query and one is running a Function on DropZone to upload a picture to my server. I ...
0
votes
0answers
9 views

php_flags with php5.6-fpm [duplicate]

I am attempting to use php5.6-fpm as a replacement for mod_php with Apache 2.4.25 on Debian Stretch The following flags need to be converted from mod_php style to a compatible php5.6-fpm style. ...
0
votes
0answers
7 views

Why I am getting this error mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given? [duplicate]

<?php include('server.php'); if (isset($_GET['edit'])) { $id = $_GET['edit']; $update = true; $record = mysqli_query($db, "SELECT * FROM info WHERE id=$id"); if (@count($record) == 1 ) { $n = ...
0
votes
0answers
14 views

MYSQLI Insert data from html table

I am using JS that is doing some calculations and date forecast based on data already being pulled and display the calculation results into a HTML table. How can I then with e.g. a click of a button ...
0
votes
0answers
7 views

Warning: key() expects parameter 1 to be array, null given in C:\xampp\htdocs\mom\functions.php on line 165

I have a problem with key() and current(). I want to make a fuzzy logic application. When I change the variable it works but errors happen in the rules. function to_string(){ global $HIMPUNAN, $...
0
votes
2answers
17 views

OnLoad in body does not work with wordpress?

Wordpress site, creating preloader for content div using Jquery and CSS, I found simple and great one here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_loader5 <script type="text/...
-3
votes
0answers
12 views

Transform into pdf / doc and send to a folder

I have a form with some info etc. The form sends to the database and everything else, functional. Someone would have some example that after the submit, the form is transformed into pdf / doc and ...
-3
votes
0answers
8 views

Retrieving data Notification from API

Im trying to create a notification system that retrieves the data from api and send notification to the user of the result.
0
votes
1answer
29 views

Edit PHP file in Wordpress programmatically

I am trying to edit a few PHP codes lines in my Wordpress theme files with a snippet of PHP code, though I am stuck and have been struggling to do this for a while with this code. I have been trying ...
0
votes
0answers
10 views

Play a sound when new comment is detected on AJAX refresh

I'm making a live chat system for my site. Any help with solving this issue is greatly appreciated =). I have a page ticket.php with a div #reply-holder where I fetch the comments for that ticket ...
0
votes
4answers
22 views

Use variable with part of array path to output array value

I have an array like so: $cars = array( 'type' => array( 'brand' => array( 'car' => 'Honda', ), ), ); And I also have a string like so: $path ="type][brand][car"; I'd ...
0
votes
0answers
11 views

PHP Curl request runs scripts until end, but gets timeout error

I have a PHP script (script 1) that is called from a website using AJAX. The script will use Curl to call another PHP script (script 2) on the server. THAT script will then use Curl as well to run ...
0
votes
0answers
10 views

How to load a custom file in Nginx

Nginx returns error 404 when I'm trying to load a file with the next structure: http://xx.com/js/custom.{random_number}.js I'm able load this file using Apache server. this is my nginx.conf server ...
1
vote
1answer
13 views

Move short description into tabs in Woocommerce single product pages

In woocommerce Single Product pages, how do I move the product short description into a custom product tab where the description and the additional information are? I have moved the description and ...
0
votes
0answers
6 views

PHPUnit's code coverage does not cover executed method

I apologize in advance for the possibly wrong use of terminology. I'm currently experimenting with unit tests in order to apply them to my work, but now I've encountered a problem, if it is one at ...
0
votes
1answer
38 views

Why file downloaded is 0 byte?

I have this code triggered when user download mp3 file $file = $_GET['file']; $ext = pathinfo($file, PATHINFO_EXTENSION); $match_array =array('pdf','mp3','mpa','ra','wav','wma','mid','m4a','m3u','iff'...
0
votes
0answers
10 views

This page can't be displayed. Contact support for additional information. The incident ID is: N/A

I have payment page authorize.net gateway. After payment processing, the return url is not coming to my site. The page shows error like this This page can't be displayed. Contact support for ...
0
votes
0answers
7 views

I got “timeout-or-duplicate” error using ReCaptcha v3

I got a contact form on my website on Laravel and I'd like to place a ReCaptcha v3 but for now the result I got from the verification is the error "timeout-or-duplicate". Can you help me from A to Z ?...
-1
votes
2answers
23 views

How to have an else statement after a loop with an if statement?

I am trying to make a registration system with text files and I need help with using an else statement after the loop that checks if the username is taken. I am generally just trying to find out how ...
0
votes
0answers
10 views

Redirect to all requests to folder and https?

I am using bolt-cms with htaccess to redirect the root of the URL to the /public folder. Now I need to redirect http to https. How can I concatenate these two rules? Here's my htaccess: ...
0
votes
0answers
18 views

.php file does not find file or directory of <link> or <script> html tags

Whenever I run my .php file on atom as "start in folder of current file" the FullCalendar link and script files cannot be found. This makes it so the calendar does not load. If I covert the file to ....
-4
votes
0answers
17 views

Need some direction in building a simple program to process orders

I design kitchens and sell cabinets/countertops for a company in San Francisco. We are using an outdated order tracking system (think 3-ring binder) and I'd like to develop a new order processing ...
0
votes
0answers
13 views

How to handle comments in MongoDB PHP

So I have homework where I have to write code to make users able to add comments on a particular movie. I have tried to do what the instructions (commented in the code) has asked for, but I am stuck. ...
0
votes
1answer
29 views

How to make dots … hyperlink in php?

I am working on a php code as shown below in which I want to make ... hyperlink in php. <div class="video-block__contlink"> <p><?php echo limit_text($stream->excerpt, 240);//...
-1
votes
2answers
39 views

I can't get the results of my quiz to be stored in a database

The results from my quiz are not storing to my database 'results' I've tried storing my $_session['score'] in a variable $score = $_session['score'] but nothing happens Below are all my files ...
1
vote
1answer
14 views

Blank all WooCommerce checkout fields except country

On my WooCommerce checkout page, I want the billing fields to be blank except for the billing country. I'm using this to make sure the checkout form is blank when it gets filled out: add_filter('...
0
votes
1answer
12 views

Group messages by the time of sending

I'm developing a message system between two users and I want to group them by the time of sending, showing it only once. Currently, I show messages and the time each of the messages was sent, but I ...
0
votes
0answers
17 views

How can I get the subscription back from a Recurly Purchase?

I am building a custom checkout with the Recurly PHP Client. Since we use our own gateway logic, we are forced to use the Create Purchase method, as opposed to Create Subscription (as Create ...
-1
votes
1answer
15 views

How to monitor a difficult webpage with curl

I'm trying to monitor this page and send an email if it changes. I tried to use curl, but that doesn't work because it seems to be generated on the fly with JavaScript.
0
votes
1answer
41 views

replace String to number in loop

I want to create a fill in the blank quizz web site. My problem is putting a different name="" value of all inputs. So I create a function Who change a string giving into input. But the problem is ...
0
votes
0answers
5 views

Magento on MAMP custom module install fails “Unknown database 'magento'”

I have created a custom module, but when I go to run php bin/magento setup:upgrade it fails and returns SQLSTATE[HY000] [1049] Unknown database 'magento'. I have tried other stackover flow solutions ...

http://mssss.yulina-kosm.ru