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
2answers
12 views

PHP preg_replace - text will not be recognized

I have problems with preg_replace. The $insert_marker text will not be recognized and is caused by "$". If I remove the 2 $ characters, it works. So what is the problem? function insert_into_file($...
0
votes
0answers
5 views

Filter a doctrine ManyToMany Relationship by property of target

I have the Entity Item and the Entity Category. They are in a ManyToMany relationship. When I run getItems() on a Category I would like to filter the results by the prooperty visible (boolean). I ...
0
votes
1answer
13 views

Show image from other domain without showing the domain name - PHP

I want to show an image on my website but not want to save in on my hosting. I want to show it something like this: <img src="https://example.com/img/pic.jpg"> or <img src="https://example....
0
votes
1answer
21 views

How to run and watch local server at the same time?

I've been having some issues setting up my local server. I can get it to run with php artisan serve, but I can't add npm run watch at the same time. I've done npm install and updated my node too. It ...
0
votes
0answers
18 views

Why is my input validation from jquery wont work?

I want a validation onkeyup from an input form, I've made a jquery. I'm having a hard time finding why is it not checking? I need to go to a php page in checking. What could be wrong to my code that ...
-2
votes
0answers
15 views

Browser stopped loading but php script still executing

I have some php script. It extracts several zip archives with images, handles images and make queries to DB. It needs about 15 minutes. At some point browser stopped loading. But php script is still ...
0
votes
0answers
17 views

Multipart form submits and sends email but file upload fails with jQuery check

I have a simple HTML form that can be filled out and the information emailed via the POST method. I recently added a file upload to the form - If i do no checks with Javascript/jQuery then it submits ...
0
votes
1answer
17 views

ErrorException in Collection.php line 1043: Undefined offset: 0 in laravel

controller: HomeController.php public function index() { // home page redirect query $data['redirect'] = SiteSettings::where('name','default_home')->get(); $data['popular_rooms'] = ...
0
votes
0answers
16 views

Access form request from Observer laravel

I am trying to cleanup my controller. I have a lot form fields so I want to use observer to insert for the other model that have relationship with the main model I have already successfully insert ...
0
votes
0answers
19 views

How to add html + blade into javascript variable for google maps api

I'm using Google Maps API to build a MAP with users on it. So I wanted to add info windows on my map, that works ! But I also wanted to insert avatar and a link to the user's profile, so I'm using ...
0
votes
0answers
13 views

single quote problem with preg_replace_callback

I've searched extensively, but I don't find hints or solutions for my problem. The problem is that I'm unable to match words with single quotes. Perhaps this is caused by server, php or mysql settings....
-1
votes
0answers
7 views

how to make google map to show the location of an input?

i have a wordpress webpage and i've added google map correctly (it runs ). but my problem is that i can't make google map to show the location of an input or select.option tag. I was successful to ...
-2
votes
1answer
14 views

Register form connected to database myphpadmin

I have this register form but I have an error in it. Under the register form it appears this code: document.write = 'Account created';";{ else { echo 'Error :('; } } ?> and this is the entire code ...
-1
votes
0answers
11 views

How to check URL's structure in PHP?

All my site's URLs have the following structure: https://www.example.com/section/item where section is a word and item is a number. So, possible URLs are: https://www.example.com https://www....
0
votes
0answers
11 views

Symfony 4 - Database connection refused

Symfony4 PHP 7.2.19 Ubuntu Linux 18.04.2 ( Up to date) MySQL 5.7.27 Its seems like I cannot get access to my database. I do have access to phpMyAdmin with the same user & password. I downloaded ...
1
vote
1answer
9 views

How to Create A Unique URL for each product enquiry form for Google Analytics Tracking

I have a WooCommerce website. The products are of high value and digital downloads. So there are three buttons on the product page which say, 1. Enquiry. 2. Request A Discount. 3. Request A Sample. ...
0
votes
0answers
31 views

Laravel email configuration: what am I missing?

I can send emails via PHPMailer, but not via Laravel. I assume my Laravel configuration to be wrong. I'm sending from my local development environment. Laravel error Failed to authenticate on SMTP ...
0
votes
1answer
18 views

Display birthday data of more than 1 person in modal

I'm trying to make a modal that popups up when a person's birthday is today. So far the code below works. But now i want to display multiple modal if there are multiple person having the same birthday ...
-1
votes
0answers
15 views

I can't use Auth::user() to get database value to show on view blade

Data is null, I try to get data from settings database using Auth::user()->amount_minimum So nothing appear. In view blade {{Auth::user()->amount_minimum}} in my Setting Model public static ...
0
votes
0answers
14 views

how to check if the email is valid email [duplicate]

I have the following portion of my signup form to check if the email is valid but I would like to check if the email actually exists by sending the user a message and if it doesn't exist, to delete it....
0
votes
0answers
15 views

enctype='multipart/form-data' Post request fails when requested for the first time

So I need to make a form which accepts multiple photos to upload and looks something like this: <form action='' method='post' enctype='multipart/form-data'> <input type='text' name='title' ...
-1
votes
0answers
9 views

Searchable data form - php? SQL? [on hold]

I have a question regarding a search form. I have data that contains a lot of tasks that can be sorted by name, start time, end time, duration, department and all sorts of things. I am trying to ...
-1
votes
1answer
43 views

Assign indexed array values to multidimensional array?

I'd like to replace the values of a multidimensional array with the values of a simple numerically indexed array. The number of values in each array is equal, but they do not have the same keys/...
0
votes
0answers
9 views

slim4 php can't get started

I've installed Slim4 via composer by following the installation guide command, php composer.phar create-project slim/slim-skeleton slimexample Then went to localhost:8080 which returned a json ...
-1
votes
0answers
11 views

how to filter data from database by date on chart js?

i really need help for my college test rn. i want to add date filter to my chart based on mysql database does anyone have an idea how to code it? please guys i really need help. Here's my chart code ...
0
votes
0answers
19 views

How to create JSON tree from database

“I’m setting up a File browser and saving folder's name in database. Any number of folders can able to save in database, from the saved data i want to create a json tree. This is my database table ...
0
votes
1answer
14 views

How to save digital signature into db using php file in Android Studio

I have created app that need user to sign in form. In code below,the sign was only save into gallery.My problem is I do not know how to save into db mysql.I do not know how to call the signature in ...
-8
votes
0answers
35 views

Find rank of a students who are in same contry? [on hold]

I want the rank of a student who is from India. Students attend many activities:- first find the students who are in India. find the students total marks those are from India. based on marks find the ...
1
vote
1answer
15 views

Custom WordPress stylesheet not loading

I went through the many other threads on this topic, but none of it seems to work for me. I'm trying to make my own WordPress theme, but I keep getting this error: GET http:/ /placeholder-url.net/wp-...
0
votes
0answers
20 views

Sending request from React or Laravel Controller

I have an application made with Laravel, where I have a controller, which now is only responsible for retrieving the view like this: public function index() { return view('pages.portfolio'); } ...
-3
votes
0answers
23 views

Laravel controller changes not showing

Laravel controller is not showing changes after Composer dump-autoload but when I used a new controller it is working. I was using this route and it is not working : Route::get('/', ['uses' => '...
0
votes
0answers
16 views

Why .htaccess is not wroking to removing index.php?url

I am trying to remove the index.php?url=controller/method/parem I just want to remove the index.php?url= thats it but its not working. Now its look like this : http://localhost/ServerSide/index.php?...
1
vote
1answer
20 views

Data attribute only returning first value

I'm trying to get the body of my page to change color when hovering over some list items. Each list item has its own color stored in a data attribute, which I can see in the chrome inspector. The code ...
-2
votes
0answers
17 views

write correct code for all windows without win10

I want to send an exe file to all Windows operating systems except Windows 10. I've written the following code for all Windows operating systems, but I don't know how to change the code to not send it ...
-1
votes
0answers
17 views

I want a user login with approval

I need user approval login with session. I tried to apply login query with where approval, it works fine but when it redirect to index it shows empty page. Login file: <?php if(isset($_POST['...
-4
votes
0answers
29 views

admin set two date limits and user select between those date, in php [on hold]

Exam Planner for Administrative staff for planning that declaring no. of Exam days and within these days student/user select one day.I am confused how to do in php and mysql.help me please like admin ...
0
votes
0answers
21 views

How to list all roles with Permissions,in spatie permission Package?

I'm using spatie package for roles and permissions in my laravel project, I need to list all roles with their permissions in a table, is there is any way? [ { id:1, name:"role1", ...
1
vote
1answer
26 views

How to change span value from a html input which has been appended using ajax call?

I have a modal which is triggered on click and modal data is added by ajax request to my php file. After the ajax call, when the modal shows,I want the span values in my modal to change ...
0
votes
0answers
18 views

Unable to send HTML form data to email using PHP [duplicate]

I have tried to send the form data to my email id. unfortunately it is not working and not getting any email from it. I deployed into the server to test. Experts inputs please? here my try, index....
0
votes
0answers
16 views

are there any property to use to load part of page rather than using window.location.href?

I have a map with markers on it, I made the marker to be clickable and it trigger the page to load a chart. Now I am using window.location.href property, but it load whole page or redirected. Are ...
0
votes
2answers
29 views

Syntax issue writing conditional mySQL query in PHP

I have the following mySQL query written in the format of a PHP PDO script. I made sure to verify that all of the columns I refer to in the query exist. So the issue seems to do with the syntax of ...
-1
votes
3answers
32 views

How to achieve this number pattern with n input

I want to give n as a input and get a pattern like this. pattern If n = 4 1 222 33333 4444444 33333 222 1 What is the perfect way to achieve this? I have tried. But my code is ...
0
votes
0answers
4 views

Add function condition on `file_get_contents` when `failed to open stream: Connection timed out`

How to add function condition on file_get_contents if we got a warning failed to open stream: Connection timed out? Can we set timeout time? So if the process exceed the time limit will return with ...
-1
votes
0answers
20 views

I am having this issue..though i tried to solve this through invoking the previous issues in StackOverflow.. Bt i failed…Help me out [duplicate]

I tried to fetch an object property "username" and tried to echo it...I m having the error...and the error is being shown for 6 times as I have 6 columns in my user table. $got_users = User::...
-4
votes
0answers
16 views

How to Get Number form doc,docx,pdf etc file [on hold]

i want to read contact number from CV and CV format is(doc,dox,pdf etc), i want to upload cv and want to get mobile number for OTP.I dont't know how to get mobile number from PDF,doc,docx etc file
0
votes
0answers
32 views

How to itrete array inside array data in laravel ,output are given below

Out-put array:2 [▼ 0 => array:1 [▼ 0 => array:12 [▼ "product_name" => "Raw Mango" "product_image" => "Raw_Mango_1997.jpg" "product_id" => "15" "...
-1
votes
4answers
37 views

To get output of movie with its genre

I am writing a program to get an output of movies with there genre. sample database Movie movie_id , title (1, snitch) genre genre_id , genre (1, Action)(2, Animation)(3, Drama)(4, ...
-3
votes
0answers
16 views

Overwrite or replace existing csv file with html table using Javascript or PHP [on hold]

I want to save the table in my HTML page to an existing CSV file using Javascript, can anyone give me a sample? I've searched cant find anything substantial, sorry just a starter here using CSV as ...
0
votes
0answers
7 views

How fix Server Cpanel automatically adds blank lines to the php code file

After I upload the php file from localhost to hosting, it automatically adds a blank line to my file, every line of code is a blank line. Even if I upload the .zip file to the hosting site and extract ...
0
votes
0answers
8 views

how to read this type of value in wordpress [duplicate]

I want to make API for cart in WordPress but I got this value from database user metadata a: 1: {s: 4: "cart";a: 0: {} how can I read this value for response to API request