I’m currently working on a project where I have a gallery (Gallery.php) containing a carousel of images, if an image is clicked on, the ImageID (I have set) and the Image URL are added to a 2D array in the localStorage. I am attempting to retrieve the array from localStorage in the homepage (index.php) which works as confirmed by logging
Tag: php
Redirect based on the ?id= parameter in the url
I have a login system that I build in PHP and MySQL. if any of my users log in they get directed to the user.php page I have an authenticate.php page that redirects the user based on their ID to a page. This is the code that adds the id to the URL: header(“Location: user.php?id=”.$id); ) Can I write a
how show value of input select from database without click any button after select date?
{{– In the database, there is a table named rooms. I want to display all room details from the table(room) –}} Answer You should change the PHP code with following code After that,You can use onchange function to fetch room details from the database(fetch_room_data.php, which is used to fetch the room table details from the database). Here, I will provide
Hide or show input on dropdown selection
I am trying to create a sign-up page for my app. All the code works, but when I try to hide input box based on dropdown select, it doesn’t work. I tried this: But it didn’t work. And this is my code for the signup page: Answer It does work, you only need to place the script underneath the form
Dynamic Div Tags in a While Loop
I have a while loop that populates 4 div tabs (in one parent div) with PHP. I also have a copy-to-clipboard script to copy text from a P tag. Unfortunately, this function works only if the tag and button have a unique Id. So my question is this: How do I assign a sequential Id to my looped P tags?
How to select multiple class class with same name in JS
I use PHP to dynamically render these lists that I fetched from the database, and each one has the same class, because I can’t change it, it renders dynamically. I select these classes via JavaScript and create an event on click to open and close them with the hidden class. Now I have a problem, this event works for me
How can I increment and decrement value with unique id?
I have this loop, The id is unique. When I try to increment it is working for only one input field. How can I increment and decrement using unique id? Javascript Answer I suggest you use an approach that doesn’t need IDs.
How to pass order ID to Paypal Button?
I create an order by my php sdk. like this and now i have this order id. but … How to pass order ID to Paypal Button? like this Answer Create two routes on your server, one to create an order (and return the resulting JSON), and one that takes an order id as a parameter and captures it (and
Change options when I select a category using Javascript (Country/State)
Im trying to hide some options when I select a different country. These options are the states of this country. But, when I select the country, it doesnt showing nothing in the subcategory. So, I try make differents values using numbers, coz I cant use the same values in my application. Someone can help me? Answer There are a few
I am trying to use AJAX to change the orderby and order arguments in a WP_Query, but I can’t determine why my code won’t work [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 10 months ago. Improve this question