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
0
votes
0answers
3 views

Decode nested json data with php

i need help with json data. I need all the carnumbers (wagenordnungsnummer), i try so much code, but i can't get them. http://jsonviewer.stack.hu/#http://ist-wr.noncd.db.de/wagenreihung/1.0/125/...
0
votes
0answers
2 views

Bootstrap captcha not verifying the response

I want to implement Google ReCaptcha for my project, and I have been following the tutorial in https://bootstrapious.com/p/bootstrap-recaptcha, using the default keys for testing in local obtained ...
0
votes
0answers
3 views

How to show woocommerce product sold quantity in last 24 hrs?

I am trying to add a feature to my product detail page. I want the user can see Sold Quantity of the last 24 hrs. For example, I add code into my function.php file add_action( '...
0
votes
1answer
13 views

How to parse a Link for only the actual domain and not www?

I am using PHP url Parse below is the code I am using $parse = (object)parse_url($arr[1]); if(!property_exists($parse, 'host') || $parse->host === "") { return; ...
0
votes
0answers
4 views

How to deploy a project made in PHP with MVC structure in Google APP Engine?

I hope you can help me, I have the following problem: I am uploading my PHP project with MVC structure to Google App Engine, when I deploy everything is fine, but when I show it in the browser, I do ...
0
votes
0answers
4 views

NuxtJS + axios + php mail - php don't grab data from form

I have problem with my form, basically mail is sending but without my data.For me it looks fine, response show: baseURL: "http://localhost:3000/" data: "{"name":"asda","email":"[email protected]","message"...
0
votes
1answer
16 views

How to use different file name for same file while using file_get_contents?

I can use file_get_contents("https://example.com/file.txt?some"); And I want to know if there's similar way to do it with local server files. Like file_get_contents("./file.txt"); Please let me know ...
0
votes
0answers
22 views

Is there any way to execute a PHP Page or URL using sql query or sql trigger at insert?

Actually i have implemented something by which i am getting data from some outside source into my database table, and now want to add some trigger at insert time, that will fire my Php page code , ...
0
votes
0answers
14 views

When iterating over items with foreach, the value changes depending on what element I put it in

I'm a php novice working on my first wordpress site and am seeing some strange behaviour. I have a testimonials section and a modal-review-show div. The problem is that I'm not getting the same value ...
-1
votes
0answers
11 views

How to Work Id & Name both in upload multiple image and Show

When Id work Successfully this time Name does not catch image path.that means empty Array. But when Remove Id just use name="image[]" successfully submit value..
1
vote
3answers
24 views

Cannot pass variable with apostrophe in “a href” link

I select a list of names from mysqli database then display row details in display.php with if (isset($_GET['name'])); The link is $str = strtoupper($str); echo "<tr><td><a href='php/...
0
votes
2answers
16 views

Multiple arguments in a PHP str_replace [duplicate]

I have a PHP str_replace that replaces every hyphen - that comes right after a slash / by a non-breaking hyphen &#809;. str_replace( '/-', '/&#8209;', $input ); I’d like to extend this ...
0
votes
1answer
19 views

Setting a variable from an Array values in Laraval

The dump of the following array is : $quest_all = $qwinners->pluck('id', 'qcounter')->toArray(); array(2) { [60]=> int(116) [50]=> int(117) } As shown above, the key is 60 and 50 (...
0
votes
1answer
20 views

json value error while recieving long integer value

I am sending array JSON request to the server with big integer array and when I receive them and decode the JSON it convert the integer values to scientific notation format i am using php funtions. {...
-4
votes
0answers
34 views

Python or PHP for a long term social media site? [on hold]

So I'm planning to build a social media network I'm familiar with PHP but I just thought about python is it more suitable than PHP for a long term project? or should I stick with PHP????
0
votes
0answers
10 views

Access to XMLHttpRequest blocked by CORS policy: Error

I am using Magento 2 and CDN for my site.But now getting the following error. Tried to allow the cors header from all origin on CDN site and add the following codes but no luck. to htaccess : <...
1
vote
1answer
13 views

How can I apply a filter from another plugin to woocommerce?

I've been trying to apply a filter to WooCommerce from inside my own custom plugin but whatever I do, the filter is not firing. The commonly found solutions online don't work. I've tried: Overwrite ...
-6
votes
0answers
18 views

What is the major difference in PHP7 [on hold]

Can GURUs of PHP let me know some major changes in PHP7 as compared to previous version of PHP which was 5? I will appreciate some major ones
-1
votes
0answers
11 views

Account Sharing with codeigniter

I want to create a function to prevent account sharing if my user A passes the access data to user B and then tries to login with user B already logged in, showing the message "Someone is already ...
0
votes
0answers
27 views

Displaying Quran In Different Rewayat

The Quran has many Rewayat (Hafs, Warsh, Qaloon, Bazzi, Doori, Shouba, Soosi, Nastaleeq, Qumbul). My question if I want to display the Quran on a web page or mobile app in different Rewayat, is it ...
0
votes
0answers
24 views

How to use already defined variables in included file in PHP? [duplicate]

I want to define a variable in my main php file like this: index.php <?php $main_url = "https://www.example.com"; $site_name = "home"; $full_url = $main_url . $site_name; include 'header.php';...
0
votes
2answers
25 views

Call specific data from table

I forgot, I want to get a result to fetch from projecten by the table pstatus which has a value of 2 only, someone help me out? $result = mysqli_query($mysqli, "SELECT * FROM projecten ORDER BY ...
0
votes
2answers
36 views

Issue creating a JSON

I have my code: $data = array("apiKey" => "85526dd10b9aa01ae6e56698b848d191", "turnos" => array("codigo" => '15918421', "nombreTurno" => "Uno", ...
0
votes
1answer
10 views

XMLReader Skip Parent Node PHP

XML Structure - SKIP Parent Node. Using PHP XMLREADER The XMLReader extension is an XML pull parser. The reader acts as a cursor going forward on the document stream and stopping at each node on the ...
0
votes
0answers
11 views

The post is not displaying with WP_Query

<?php $loop = new WP_Query(array('post_type'=>'works', 'orderby' => 'post_id', 'order'=>'ASC')) ?> <?php while($loop->haveposts()): $loop->the_post(); ?> <?php echo ...
0
votes
0answers
13 views

Load url content with PHP

my goal is to load url content of 'http://www.fanatics.com/nfl/green-bay-packers/aaron-rodgers-green-bay-packers-nike-game-jersey-green/o-2405+t-36485721+p-3102729373+z-9-2995349525' to my String ...
-3
votes
0answers
15 views

How to Solve Timezone Error with PHPFormMail [duplicate]

I have been using PHPFormMail for some time now, and recently upgraded to the latest version (v1.07.3) which can handle later PHP versions. The problem is, in using the script, I get a pageful of ...
0
votes
1answer
18 views

Laravel hasOneThrough(); intermediary table custom column value

I sincerely apologize if this question has been answered before, however I didn't seem to find a similar situation elsewere. If it is a duplicate, please point me to the right direction. I have three ...
-3
votes
1answer
24 views

"Issue with updating a record using a button”

When I click on the update button, the SQL query updates the last record not the wanted one when displaying several courses, I would like to give the user the right to confirm one of the courses, ...
0
votes
0answers
12 views

Is there a way to minimize the amount of middlewares files?

I'm setting up a "control access" in my personal project, to achieve that I'm learned how to use middleware to control who can access what, but the way I've learned it doesn't look the best way. What ...
1
vote
0answers
6 views

Sonata Media Bundle Custom Provider not mapping request data

I have a custom ImageProvider to use with Sonata's Media Bundle. Unfortunetly when I click submit, the form fields are placed into extra_data rather than the form object resulting in the error ...
-3
votes
0answers
20 views

How can we give background colour to checkbox? [on hold]

it will look like a button but it should work like a checkbox? please anyone can tell me how to do it? I need to event catch it event also with the help of jQuery Thanks in advance.
0
votes
0answers
9 views

How to change the Subject in the PayPal button API, when I make a payment?

I have a paypal button to make payments from my website to paypal, everything is done successfully, but the payment issue that comes to my account is: Receipt for Your Payment to test facilitator's ...
0
votes
1answer
22 views

How to fix “Uncaught ReflectionException: Class view does not exist” in Laravel after deployment to Ubuntu 18.04 server

I am currently hosting an application on a ubuntu 16.04 server... but when i try to deploy the same code on fresh ubuntu 18.04 server i get the following error on my apache logs PHP Fatal error: ...
-1
votes
0answers
13 views

SQL splitting column string and searching [duplicate]

I am writing a search function for a website I'm building, so far so good until I hit this roadblock. I have tags stored in a column like so: c_id c_tags 1 Tag1,Tag3,Tag5 2 Tag3,...
-1
votes
1answer
13 views

CakePHP - cake bake all error (says missing $default in database.php, but it is present)

I am trying to bake all with cake bake all, but it returns all sorts of errors. It says that default in database.php cannot be found, but in reality it is present in the file, also, few days ago I ...
-1
votes
1answer
18 views

Use functions inside standalone (w/o Laravel) blade template

I'm doing a simple static website where I installed the standalone version of Blade (so no Laravel) to use as a template engine. I tried declaring a function inside a template and using it but I'm ...
-3
votes
0answers
20 views

I cant publish message [on hold]

I use mqtt in php I get two messages from one topic Simultaneously,I want to publish message for each message received. but I cant. I can publish message just for last message received. why? is it ...
0
votes
0answers
16 views

Docker + yii : Composer could not find a composer.json file in /app (Window 7)

This same below code works well in Windows 10 but not in Windows 7 (using docker toolbox installed) docker-compose run --rm php composer install I am trying to execute above command in my project ...
1
vote
1answer
16 views

How to put the limit on number (1-10) in input field in form component of symfony?

I wrote some code for the form, using symfony form component, but I need to make a limit for number in level input field from 1-10. So, if it is lower or higher it must throw an error or alert. Is ...
0
votes
1answer
15 views

Constraining Laravel/Eloquent relationship based on parent column values?

I have two models in Laravel and I need a specific relation between them. The parent model Track has this relationship with Wire: public function wire() { return $this->...
0
votes
1answer
40 views

Get an EXACT value in $_POST array

I'm studying php and I'm trying to figure out how to get the string "Juve_Milan" from this var_dump($_POST) : array(5) { ["Juve_Milan"] => array(2) { [0] => string(1) "5"...
0
votes
0answers
15 views

why am i getting a 400 (bad request) error when using ajax?

I have a dropdown which calls a js function: <select class="form-control" name="product" id="product" onchange="populateProductLine(this.value)"> <option ...
0
votes
1answer
20 views

update_post_meta being used incorrectly

/* This foreach is used to grab records from WordPress */ foreach ($offices as $office) { /* Set the wordpress offices as an array */ $id = get_post_meta($office->ID, '...
0
votes
1answer
24 views

How to use an abstract class instead of an interface for a custom component?

I'm working on a File Manager module for Yii2 where the goal is to provide the user with an option to use different sources for directory browsing, like Local Directory Dropbox One Drive Google ...
0
votes
1answer
16 views

Codeigniter's zip download files are empty

I have a page where users can choose which files they want to download from different jobs. There could be several files for each job. When the form is submitted, the files are sent to a function ...
-1
votes
0answers
13 views

how to get user data from the console and display them

is there any way to implement a class that will be called in a controller that reads information from the user? hope you help met the stdin example, but there are difficulties with the ...
-2
votes
0answers
13 views

What is the difference between using execute() and query() method in PHP PDO [duplicate]

What is the main difference execute() and query() method in PDO The same job both functions doing and what is the difference if using prepare() with execute() ?
-2
votes
0answers
17 views

PHP Document Factory Design Patterns [on hold]

I have a system structured out. It works exactly as I want it to work, but I'm curious if I'm using the right naming conventions for the structures involved. Base classes: Report classes: ...
0
votes
1answer
19 views

Catch the query, which runs on any php file

I have 3 files, one from the database connection, and the other with querys! I want to save all queries that are executed in any php file! Maybe they will help me! maybe Something in the connection ...