i have little problem when i want to insert image into form, the code work on other form but in this form it not work with Uncaught TypeError: Cannot set property ‘src’ of null here is my code javascript : form : Answer Your img tag is inside the select tag so your javascript is not recognizing th…
Tag: php
Laravel RouteServiceProvider map function not called
I’m using the map function in the RouteServiceProvider to manipulate some routes before are being processed any further. When I run on my local machine everything runs fine but on the production server for some reason non of the map functions are being called. To make sure the bug was not for some reaso…
How to solve the fatal error in require_once
My project has two entry point for example File 1:/index.php ( first entry point) – here we include the config form the config folder File 2:service/service.php – here we include the config form the config folde if i call the File 2:service/service.php has no fatal error but when i call the File 1…
How can i save all the variable results from a echo into a txt file using php?
I wrote a php script that generates random tokens, and I want to output these tokens into a .txt file. Below is the code: It echos multiple tokens, until the echo = e3b0, but when I try to write the result on a txt file, it only writes “e3b0”, is that a way to write all the results of the
Get an array in a php file from http request
I’m learning php and I’m trying to get a php file from a http request using Guzzle and then just take a particular array from those contents and ignore the rest. But I’m unsure how to get that array. When I print $contents it looks as expected, for example: I want to just get the array, iter…
How to send message to selected user with their name laravel
I’m trying to send a message to selected users with their names. So let’s say I have two users Ethan and Calvin then the message should start like User1:(Hi, Ethan), User2:(Hi, Calvin). So far the message is like (Hi, Ethan,Calvin) for every user. How can I fix this? Blade Controller Answer It loo…
Laravel 7 – paginate sorted by DESC
I’m trying to display posts from the database, but i want to have the latest on top. This means I have to do this inside of my HomeController.php: But when the site grows up, it might be complicated to find the particular post, so I decided to implement pagination. Unfortunately, pagination only works w…
Can’t include js files in php file on cpanel
I am trying to use a JavaScript library (from GitHub) on my website but I can’t get it to work. It works when I set it up in VS code but not when I upload my code to cpanel (along with the required files). The website is a wordpress site so I just create page templates and link the templates
Parsing nested json data to extract a certain value
so I have a nested JSON response form a JSON request I’m having trouble parsing the nested JSON data to get a certain value I have commented out on the data in need ( “link”: “http://i.imgur.com/DnjD527h.gif”) need to extract data in two places see the JSON data for comments. Sin…
How to pass jQuery variables to PHP
I am replacing the text of a div with a form so the user can edit it with it, but I don’t know how to pass the content of the variables from jQuery to PHP so the form can get the previous text and the id of the post. EDIT: What I need is to pass the jQuery postId and