I’m trying to pull the most recent four images from a database into a carousel. The images are stacking on top of each other as one single slide of the carousel. I want them to be on four separate slides. The carousel code: I have included these: I will leave an example of what I mean here. Answer Your …
Input from Model not included in form POST data
I have a simple HTML POST form with a model contained within like so: https://jsfiddle.net/pilotman/rn9gspz8/6/ note: the JS fiddle is basic and just for demo and is not perfect. So when I submit the form and let the input inside the model has some text, my server script does not see ‘input2’ Does…
How can I rewrite this xml file with the correct encoding using php?
I want to rewrite an xml file without the encoded characters using php. My xml file looks like this: How can I fix the issue with the encoded characters? Is there any way I could use php to rewrite the file? thanks. EDIT: This Is my code that takes an xml file, and then splits it into piecies based on
How to add double quote to array values php [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 4 months ago. Improve this question I have an array like below format: But I want to convert the array so i…
PDO json_decode before fetch into class
Is there a way to json parse string before making it a class with PDO? I don’t like using union types. In the example below contact is of type json in the database. PDO User class Answer As Movahhedi suggested you could use PDO::FETCH_FUNC, but the json_decode() should take place in the passed function,…
How to get form data with session in Symfony Form
I’ve been looking for a solution for hours. I’am working with Symfony 3.2. I’am using Symfony Forms in order to display a data-table (with different filter chosen in the form) with Ajax => No submit button. I can access to different result of data-table to view more information. What i wa…
get array_intersect count without duplicates php
I have 2 arrays: $first = array(1,1,2,3,4); $second = array(1,2,3,4,5); when i use $count = array_intersect($first, $second);, and count($count); the matches, it shows 5, resulting in 1 intersecting …
PHP – change/adding numerical value to array key value using submit button
I am using array to limit the results from glob(), like a pagination How can I add value of 1 to $show[0] using a button? Answer You’ll need to record the current state of the page in some way. You can do this with a hidden variable, however I would recommend either switching to $_GET for this function,…
Update pivot table
I have many to many reltionship, trying to update the pivot table order_services. I have this update function in my conroller: $order->update($data); $order->services()->detach(); foreach ($…
PHP Redirect user and save previous URL in browser’s history
This got me quite confused. Let me say a user visits a folder A, but, let’s say, because of some reason he is being redirected to a folder B. The problem is that a browser does not log the location A into its history. url/A redirects to a little different location url/B After user clicks on “histo…