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

Laravel url call usein javascript

This is my Laravel route Route::get('upload-question/{sugg_id}/upload/{question_id}', ['uses' => '[email protected]', 'role'=>['admin'], 'as' => 'upload.question.store']); I'm using the ...
0
votes
1answer
28 views

jQuery click event does not fire function the way it should

There is a great chat example on css-tricks that I think is great for beginners in PHP. (https://css-tricks.com/jquery-php-chat/) As I'm looking at it, I notice there is no send button. This is pretty ...
0
votes
0answers
12 views

Unexpected “<” in if else statement PHP [duplicate]

$redData = $row['red_data']; $amberData = $row['amber_data']; $greenData = $row['green_data']; if( $currentValue < $amberData ) { ...
0
votes
1answer
14 views

How to Image Crop And upload to Folder And Save Name in database Using Ajax And Jquery In Php

I want to crop And rezize Image and Upload In Folder For user registration and profile updations.Upload and Crop Image using PHP and jQuery. HTML Form with Image Upload Option with JQuery Croppie ...
-3
votes
0answers
12 views

How can I validate the mobile numbers which are telegram users from a list of numbers?

I am having several excel file which contains the mobile numbers, I want to filter the only numbers which are telegram users? I tried using a telegram bot but it only gives chat id when the user uses ...
0
votes
0answers
14 views

call javascript function inside a method

how can i call this js function that is inside the method in an onclick on the button that is inside another method <?php class Test { public function GetTest() { print $HTML = '&...
0
votes
0answers
17 views

Datatables(): ordering + pagination with Ajax + Mysql

I am struggling with Datatables() using AJAX to pull data from a MySQL table running my PHP script. I understand that Datatables() comes with several features including sorting, pagination, etc, all ...
1
vote
0answers
4 views

Doctrine: How to assign a property on a child entity that is created with @GeneratedValue in the parent entity?

TL;DR How do I use a property value from a parent entity that is created with @GeneratedValue as a value for a property on a child entity? I currently have a FailureLog entity and an Image entity. ...
0
votes
1answer
16 views

Laravel 6 - SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

I planned to make transaction to have access to supplier, but i get this error SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint ...
0
votes
0answers
20 views

How to fix Devices with the same IP from redirecting in PHP

When logging in, it checks the database to detect if the IP that the device has matched the IP that is in the database. If it cannot detect the IP in the database, It should send them a message that ...
-1
votes
0answers
7 views

php imagecreatefromjpeg 32 bit depth

i have some trouble with imagecreatefromjpeg i have a jpeg image with 24 bit depth and 32 bit depth so this file work well with 24 bit depth and not with 32 bit depth so my script for take picture ...
0
votes
2answers
29 views

How can i convert characters in PHP?

I need to convert an example string contains, for example: "ABF965;CDE436;EAF873" in "N;N;N" where all alphanumerics characters must be "N" Is there any native function to do this?
0
votes
0answers
7 views

Php file chunking - how do i do it properly

Im new to PHP file chunking and uploading. I was wondering if someone can give me some guidance on how to do it properly. One of my main questions i have in mind, when uploading chunks, does that ...
-5
votes
0answers
11 views

How to build PHP restful API for mobile application?

I want to make mobile app which has already website , already have admin panel of that website so how to use that website database for mobile app
0
votes
0answers
18 views

sending html text input ID through a php class or possible alternative?

I'm in a bit of a pickle. So I have this section where I want to display comments for a given post. In order to do that I need the postID to show all comments to that post. However I set this up a ...
1
vote
0answers
9 views

XERO send Invoice through email

I have integrated XERO with my php(codeigniter) website, everything i have implemented is working just fine. I want to send the invoice through an email i have created. I am using XeroOAuth. //This ...
0
votes
0answers
12 views

How do I restart IIS (or single site) from a PHP page?

When I was looking at Azure, there was an option to restart IIS from the web-based control panel: according to a friend of mine, the interface is just calling powershell scripts on the backend. My ...
0
votes
1answer
21 views

PHP regular expression any kind of letter from any language

I'm trying to create my own routing in php using regex, my example returns true when the name is in latain, but when the name is in arabic returns false preg_match('#^(en/users/(?<name>[\p{L}\p{...
0
votes
0answers
16 views

jQuery AJAX not received at PHP server in Firefox and Safari

For a frontend HTML5 application, I'm using jQuery 3.3.1. API is php 7.1.23 and laravel 5.1. I'm able to send jQuery $.ajax requests to my API without issue in Google Chrome (ver 77.0.3865.120), but ...
0
votes
1answer
14 views

Invoking a static method that's in a different class, that calls a protected method inside that same class

Maybe its just because I'm tired and have been working all day, or maybe it's because I just don't really have a firm grasp on PHP classes as I thought I did. But anyways. Here's my problem. I'm ...
1
vote
0answers
16 views

Find an user using its hashed password

I want to fetch an user in the database using its password, that has been hashed using password_hash(). The problem is, this function uses salt so it isn't deterministic. What it means is that I ...
0
votes
1answer
21 views

Error sending information on POST form in Laravel

I am Laravel and the error is displayed "The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE." I'm using the form :: open with the code below: View ...
-1
votes
0answers
6 views

error on php session and headers why logging in [duplicate]

I upgraded my PHP to version 7.2.7 since then my longin system is no longer functioning. i have used several suggestions including replacing php header codes with echo 'window.location = "MyAccount....
0
votes
0answers
9 views

How to upgrade mysql_pconnect to mysqli [duplicate]

I am trying to set up a website that uses outdated php constructs. I am trying to set up ShoutIRC bot to run a web request web page. They use outdated php codes because it is an old script. I have ...
-1
votes
0answers
18 views

how to count row from single column by specific digit stored in mysql in php?

I want to count total number of rows in a specific column by specific digit from mysql database. Suppose I have "RatingTable" and My database structure is: id username rating Now suppose I have ...
0
votes
0answers
22 views

I need to setup the friendly urls for a website

I'm trying to make friendly urls for this website https://superbackings.com The trouble is when you place a search, the url appears this way https://superbackings.com/?search=bon+jovi But I need the ...
0
votes
0answers
6 views

.htaccess redirect email address to URL parameter

I'm currently trying to convert an email address sent in a URL into a parameter which can be passed into a PHP script. The URL is basically http://example.com/[email protected], and I need it to be ...
0
votes
3answers
35 views

Is there a way to return multiple unrelated results in an sql query?

I'm trying to create a "feed" system on my site where activity on users' posts is posted. To do this effectively and order all activity by date, I need to put everything in one huge query (unless ...
0
votes
0answers
15 views

Woocommerce variation dropdown option tag add some dataset

<select class="license_type" name="license_type" id="license_type"> <option value="license" data-set="500">Single Site License</option> <option value="license" data-set="...
0
votes
0answers
19 views

Weird connection of PHP header already sent error and javascript [duplicate]

Edit: Solved by reading BETTER the answer from mario at How to fix "Headers already sent" error in PHP. Adding an ob_start() at the beginning of my file solved my issues. Recently I figured ...
1
vote
1answer
34 views

Display formatted JSON (Big Object) in HTML

I am trying to display formatted JSON in an HTML page but I'm having some trouble when it comes to larger objects (an array of objects). Currently I am displaying the JSON object using JSON.stringify(...
0
votes
1answer
17 views

(PHP) wait for child process to exit with timeout

i started a child process with proc_open(), and now i need to wait until the child has finished -or- until X seconds has passed, whichever comes first. one obvious way to solve that problem is a while(...
0
votes
0answers
8 views

how to 301 Redirect “wp-admin/edit.php” to “wp-admin/404.php” without affect in other post type like “wp-admin/edit.php?post_type=projects”?

i'm using wordpress and i have post types installed. i don't want "post tab" any more because my project uses custom post types only. so i removed it from menu but can arrive to it by url, so i want ...
0
votes
1answer
26 views

mysql/php session_destroy of user

can i destroy a session of a user throught sql or mysql-php ? i deleted his login on the database but he stills be able to use the products and more...
-2
votes
0answers
23 views

PHP mail handler acting strangly [duplicate]

I had a perfectly working html form and php mail handler (index.html and mail.php). I decided to change it to a single file (index.php). I copied the php code to the index body, renamed it to index....
-1
votes
0answers
7 views

Filter for all WooCommerce alerts and notices?

I'm trying to find a filter that I can use for any WooCommerce notice or alert it outputs, I know of one that is used for the "add to cart" notice, that being: wc_add_to_cart_message_html ...but is ...
0
votes
0answers
21 views

how can show the real source code with iframe

<iframe src="https://morocco.blsspainvisa.com/book_appointment.php"height="1500" width="1550"></iframe> How to import website completly source with iFrame this screenshot of source code ...
-1
votes
2answers
26 views

Every passport must randomly have symbols, capital letter, small letter, numerics. Not working

Random password generate method must on every generated string contain a) symbols b) capital letter c) small letter d) numerics. But my output is randomly missing them all. function ...
0
votes
0answers
19 views

Why I get this exception by trying to decrypt RSA with java but encrypted with php?

I'm using PHPSecLib to encrypt my text with RSA: $rsa = new Crypt_RSA(); $rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1); extract($rsa->createKey()); $rsa->...
-1
votes
0answers
20 views

Reproduce a submitted form

I am developping a quizz type website using symfony: on the result page (coded using TWIG) I would like to display the result, but also the submited form with the checked and unchecked boxes (actually ...
0
votes
2answers
21 views

Wordpress add_image_size crop makes super bad quality

I am trying to resize images in size 300x175, but the result is with super bad quality (the original image is with good quality). The code I use is: add_image_size( 'saveti-home-thumb', 300, 175, ...
0
votes
2answers
17 views

Docker php DPO to MariaDB - Error: Could not find driver

I'm learning PDO now and I found it better to learn it in a LEMP docker stack (Nginx, php-fpm, MariaDB, phpMyadmin) on my Ubuntu 18.04LTS. This is my php file: <?php try { $mydb = new PDO('...
-2
votes
0answers
22 views

Display json response in codeigniter view as a table [on hold]

I have this on my controller public function view_scholars() { $query['scholars'] = $this->Home_model->view_scholars(); $response['Error'] = FALSE; $response['Message'] = $query; ...
0
votes
1answer
19 views

Wordpress custom page template Stripe integration showing - “PHP Fatal error: Uncaught Error: Class 'Stripe\Stripe' not found” ERROR"

I have used the following code in the payment.php page template... <?php /* Template Name: Page: Donate Success */ // Check whether stripe token is not empty if(!empty($_POST['...
-4
votes
1answer
26 views

show every second symbol of a string

Is there simple function? How to split string and show every 2 symbol of a string in php? $text = "Hello World"; // output needed: H l o W r d
0
votes
0answers
18 views

how do i make my image cards responsive using images from my database and using bootstrap 4?

Trying to make my image cards or whatever you call them responsive. I need 4 cards to be next to each other and then its just gonna start over again under. I can only get it to work if i use images ...
0
votes
2answers
28 views

querySelectorAll or any other method returning more than one element- not working

I want to fetch a few posts written by the user with php, and write a function with JavaScript that's supposed to cut the post after the 50th character, and add three dots (...). Everything is working ...
0
votes
0answers
14 views

How to transfer class value from popup window to parent window using jquery

I want to get class name from popup window to parent window. I mean if my popup window show instagram page and I click on follow button then the class of the follow button will change. I want if I ...
-4
votes
0answers
37 views

hello guys there are wrong in my php code . help me to solve it [on hold]

these code not work please help me in these this code give me inputs and button only but php code not work and i use xampp and it work <!DOCTYPE html> <html lang="en"> <head> &...
0
votes
0answers
26 views

Recursive function that counts from 2 to 2

How can I create a recursive function that meets the following criteria must be for or a recursive function, from 0 to 5. I need the following for example for <? for($i=0; $i<=5; $i++){ echo ...