Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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

How to fetch PHP script without redirecting?

I have a PHP script that performs a query and echos some html markup. I'm trying to use javascript to fetch the markup and update the DOM without triggering a redirect. Is this possible? Also getting ...
0
votes
0answers
3 views

Call two relational tables in a singe id in Laravel. (check photos)

Here i got two keys but how i will make it in a single key. In my controller i specified id for two different resources for author and authorprofile. But how can i use with single resourse because ...
0
votes
0answers
3 views

Collecting IP addresses from a link to a text file using PHP

I'm using a PHP file on my site to collect incoming traffic information such as IP addresses from a link. And putting said information in a text file in the same directory as the PHP file is located ...
0
votes
0answers
5 views

How to match strings using negative lookbehind with multilines?

I was trying to create some examples to understand a little better regex assertions with PRCE. //(?<=) - positive lookbehind $string = "dra Julia \ndr Marcos \ndr Mateus \ndra Ana"; $regex = "/(?&...
0
votes
0answers
4 views

Json file cannot load

I am using SLIM Framework. require_once('dbconnect.php'); // Display all records $app->get('/edi_850', function($req, $res) { $query = "SELECT purchase_order_number FROM ...
0
votes
0answers
9 views

Laravel - How to get Row with 2 column?

I want to show list of materi (table), based on 2 values from 2 columns. and the column is : kelas (from user table) nama_mapel (from mapel table) but in materi is just "mapel" not nama_mapel. My ...
0
votes
0answers
10 views

Widows 10 PHP 7.3.3: Call to undefined function GuzzleHttp\json_encode()

Browse in stackoverflow, always recommend to install package json, almost of all platform is linux base. but I can't found instruction to install it in Windows. Php: 7.3.3; OS: Windows 10; Service: ...
0
votes
0answers
8 views

How to use onchange function to get the data from database?

I have stuck in the onchange function to get the data from database, I need to choose the "Point" in the select box, then the table get what I want to select the "Point" in the select box. For ...
0
votes
0answers
7 views

Foreign key constraint, even after using bigIncrements and unsignedBigInteger

so in my Tasks migration table I'm trying to reference a foriegn key constraint Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: ...
0
votes
0answers
4 views

How to edit profile in codeigniter

I try to update user profile like email and name, but when i input name and email it always blank, it doesnt change to what i input, it just be blank in my database public function editprofile() { ...
-1
votes
2answers
21 views

PHP Logic for reward when POST reach 1000 Likes

I have one android application which use PHP and MySQL as backend. I want give some extra points when user's post get 1000, 2000, 3000 likes and so on. I am storing total likes in table called ...
-1
votes
0answers
8 views

Rookie help - Making localhost server be a online server

Okay, I need a little bit of guidance. I am really new to all of this... This is for a homework assignment, but I have a site I am hosting on my local network with WAMP/phpmyadmin. How exactly do I ...
0
votes
0answers
11 views

How to get php validation working for a form?

I need to validate the form before it gets sent to the session array, this is what i have so far. Using PHP_SELF the form gets sent to the index which needs to verify that the input entered is ...
0
votes
0answers
13 views

How to check if a date is 28 days or more into the future from today php

Hi I am creating a web form for an assignment, the user would put in some dummy credit card information. The switch case block checks if the expiry date of the credit card is 28 days from todays date (...
0
votes
0answers
22 views

is it possible automatically download a file by the link in javascript?

lets say i have 1000 link like https://test123.sharepoint.com/teams/TechnicalRecordsManagement/Workshop/2014/578090.pdf is it possible to make automatic download without user interaction due to ...
0
votes
1answer
14 views

Php Laravel Applications Invalid argument supplied for foreach() Errors

I am learning PHP Laravel and I am developing shopping cart project. I am able to add the product into list but , when I click shopping cart link . I am getting following error . Facade\Ignition\...
0
votes
0answers
7 views

Original files remain after running the rename function in PHP : Why it worked before : NFS mounted

Currently, I'm investigating the problem of original files remaining after running the rename function in PHP. The program is simple and has moved to a temporary folder.(in PHP with FuelPHP) \File::...
0
votes
3answers
25 views

Problem with route in Ajax using Laravel?

I am trying to get a list of countries with their cities using Select2 with Jquery. At the time of creating a post with their respective country and city, I don't have a problem, but at the time of ...
0
votes
1answer
18 views

Nested Array Check if Exists

I have a foreach loop that looks like this: foreach($arr["CREDIT_LIABILITY_CREDITOR"]["ADDRESS"] as $key => $value){...} The ["CREDIT_LIABILITY_CREDITOR"] array always exists but the ["ADDRESS"] ...
0
votes
0answers
8 views

Resourcespace DAM system - setting external storage as AWS S3

I've been spending few days trying to figure out how to set aws s3 as external storage for Resourcespace. and i've been getting more confused with the this app. I'm using the opensource version and ...
-2
votes
0answers
16 views

Send help. I have an error in my code and the error was "Uncaught Error: Call to a member function fetch_assoc() on null'. Send helppppppp [duplicate]

$new_no = substr($this->mobile_no,3); $sql = "SELECT * FROM access where mobile_no = '$new_no' order by id desc limit 1"; $result = mysqli_query($this->mysqli, $sql); $row = $result-&...
0
votes
0answers
23 views

How to make while loop of SQL result to be defined loop?

I have some trouble of my code that using while loop, here is the code : while ($row = oci_fetch_row($rskutnonindihome)){ if(angka($row[2])==""){ echo '<td class="d1"&...
0
votes
0answers
6 views

phpcs Config file /etc/php-codesniffer/CodeSniffer.conf is not writable

I'm trying to add the Drupal code standard to php code sniffer. Under .config/composer/vendor there is a drupal folder with all the stuff in it. I've done composer global require for Code Sniffer and ...
-2
votes
0answers
7 views

Parse error: syntax error, unexpected '$username' (T_VARIABLE) in C:\xampp\htdocs\WEB1\include\database.php on line 3 [duplicate]

this is my configuration in database.php btw i use XAMPP for the server, thanks before. <?php $servername ="localhost" $username ="root" $password ="" $...
0
votes
0answers
7 views

Google recaptcha ver2 failed when I use Google Optimize installed in the same page

When I try to use Google optimize and Google recaptcha ver2 on the same page, I can't pass the recaptcha and saw endless loop. My website is made by PHP and Laravel not using front side framework. ...
0
votes
0answers
12 views

how to get localhost URL to online web server

i wanna to access my XML file from local computer to my web server but i try to fetch localhost URL contain XML file to my web server but wont work please help me and that is my code in <?php ...
0
votes
0answers
6 views

list all Stripe events for a customer

I have Wordpress connected to Stripe and would like to show a Stripe event history for each user in their Wordpress admin User page. Essentially, I would like the same view that is available inside ...
0
votes
1answer
17 views

How to correctly return a JSON Response in Laravel?

return response()->json([ 'message' => 'No new orders!' ]); Unfortunately, this response is not working? Ideally, I'd like to return a JSON response with 'Message' => 'No new orders!...
0
votes
0answers
13 views

How to retain the value is select2 after form submit in Codeigniter?

Good day, I have a select2 on my view, but when the user clicks submit on the form and the validation fails the previously selected values are cleared. I tried using set_select() but it does not ...
0
votes
0answers
17 views

Submitting page with different submits buttons and forms with PHP

I can't figure this out alone. I have .html file and in body section I'm importing some .php files using switch. I'm displaying table and I'm navigating on it with POST form. Now I want to add to my ...
0
votes
2answers
20 views

How to update each row by it's own value encrypted

I'm trying to update every value of a column. I'm trying to apply encryption for an existing database $query = $this->db->query("select firstname from user"); foreach ($query->result_array(...
-1
votes
0answers
11 views

Gathering User Data from Woocommerce Product and Checkout fields

Urgent!! I need a way to capture data entered by a customer on my woocommerce single product fields and my checkout page. I want to be able to tie the data from both form submissions to that ...
0
votes
1answer
40 views

If else not working in Document Ready function

I am creating a page that selects a different form for running different functions when a user selects different select options. What I am having trouble with is keeping the form displayed when I ...
0
votes
1answer
18 views

Pass Parameter to Relationship Function or alternative solution

i know this question has already been asked but the answers dont work for me i have a table called channel_posts with this model class ChannelPost extends Model { function PostLike( ){ ...
0
votes
0answers
17 views

PHP/HTML : Getting user input for google calendar embed code

I have a custom WP plugin, where there is an option to input the google calendar embedded code under a user's account. The problem I am having is, whether a textarea OR text type input, the value is ...
-1
votes
0answers
13 views

PHP - Adding item from HTML form to favorite or saved list and retrieve back for a particular user

I'm creating a form that will allow users to read the contents, and then decide to add to favorite/saved list, where they can refer back to read quickly again while clicking on "My Favourites." and it ...
-6
votes
0answers
26 views

How can I solve a PHP syntax error that I receive when parsing code? [on hold]

https://prnt.sc/pnaluu https://prnt.sc/pnalzs Please tell me solution for that, thanks Parse error: syntax error, unexpected '$fire' (T_VARIABLE) in C:\xampp\htdocs\crudapp\index.php on line 11
0
votes
1answer
23 views

How to update image with AJAX in Laravel

I'm having problems updating a record with an image. I don't know if something in my code is wrong. ProductController.php This is my controller. Here I try to delete the existing image and send the ...
0
votes
1answer
21 views

PHP variable not taking the value of the database element value assigned to it

I fetched a MySQL result for a query using the MySQLi extension of PHP . The resulting table of the query is only one entry long <?php if(!empty($_POST["search"])) { $query = "SELECT * FROM ...
0
votes
0answers
10 views

PHP Live Server/Live Server Extension for Google Chrome Using VS Code Editor

In an effort to get Php running on a live server like that which has been done for Html/Css/JavaScript, I saw guides for it. I have: VS Code Xampp VS Code plugin 'Live Server' and the google chrome ...
0
votes
1answer
24 views

How to validate equality of rounding values in PHP

Unable to get status of total amount and paid amount. Paid status functionality not working proper. Please see the image below. Wrong Status Showing Here is my code $total_amount = $row->total; $...
1
vote
1answer
11 views

How can I write SYSLOG messages to a remote host in PHP?

How can I write SYSLOG messages to a remote host in PHP (v5.3.3) I don't see a host parameter in the syslog function. https://www.php.net/manual/en/function.syslog.php I'm able to do this in some ...
0
votes
1answer
18 views

How can i run PHP Preg_match against all POST Data?

I have a HTML form where users submit information, depending how many options the user selects in a form there is a different number of POST data sent, some as an array. The POST data looks like this ...
1
vote
0answers
14 views

PHP Performance Load Comparing Two DateTime Objects

I have an availability class which does many checks to see if a date is available, but one of these checks is to see whether the bookable product is within the booking window (i.e. in the future ...
0
votes
2answers
23 views

If (is_page_template()) not working in header.php

I have 3 separate header options, all with a banner image: 1. Homepage 2. Sponsor Template 3. All other pages. I have placed the below code in the header. The homepage and all other pages are working ...
0
votes
0answers
22 views

Can't receive form data in PHP of multi-file upload

I am creating a multi-file upload that passes a form data object to a php script. The form data has all the correct data in it however the $_POST and $_FILES fields are both empty if and only if I ...
0
votes
0answers
33 views

PHP show full blank text when sentence has accent mark [duplicate]

the web shows full blank text when the sentence has a special character (í,ú,ó,é,á)in the database column. The database its in utf8_general_ci and all the columns. index.php <?php ...
-3
votes
0answers
18 views

PHP - Show age calculated in the format of X years, Y months, Z days [duplicate]

say I have a date of birth string stored in a variable formatted like this: mm/dd/yyyy How could I format this birthday so that it says "You are X years, Y months, Z days old." In response to the ...
0
votes
0answers
12 views

create a custom class which inherits from another class PHP

On my Wordpress site when I am currently calling a shortcode my class returns cta cta-white ct-arrow. I want to be able to create a custom class name from cta cta-white ct-arrow change it to ...
1
vote
1answer
18 views

substr_replace does not replace in cyrillic

I have the code <?php $location = 'Болгария'; if (substr("$location", -1) == ('я')) { echo substr_replace("$location","и",-1); } else if (substr("$location", -1) == ('и')) ...