Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to make a photo gallery for my users and I want it to look like this:
last img. img. next img.
<- [] ->
I wonder if someone could explain how the last/next image link/button works.
I use mysqli and i have imgID, imgURL etc stored in the db
You mention you have an imgID stored in the database.
when someone clicks on the 'Next' button, pick the id of the image that is currently showing.
Query the database to find out the next higher (or lower, based on whatever sort), imgID.
Then fetch its URL.
Show that image, in the same way, however you are showing the current image.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've created simple page where you can add images to database. Here is my code, where i pull images to website:
enter image description here
in DevTools i can see that all images are pulled correctly:
enter image description here
But when i click next/previous
website is reloading, but picture is still the same, and URL is changed:
enter image description here
Do you have any idea why?
I even add JS script to add intervals to this carousel but it's still doesn't work.
Thank you
It seems the problem about javascript library. it is not loading. You need to add full code to test it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How can I do this thing: I have php file with html code. On this page I have 8 images and 1 button.
I pressed button
POST request maked some php code and gave me back a random number between 1-8
7 images changing attr "src" to "empty"
1 image changing attr "src" to "full"
I don't need php code to make random and something like this. Please, tell me how can I change attr when I already get random number.
var rand = 3; // somehow get the random number from server via ajax
$('img').attr('src', 'empty');
$('img').eq(rand).attr('src', 'full');
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
i want to be able to upload multiple images (i got this working) its array
only problem is i need each image to have its own content but i want to use one form as this relates to a specific article.As you see this picture
This welcome article for example has a heading, an image and text to explain for each image .
this is my current db structure but as you can see there is no way content will be separate for each image
article id is the foreign key
How could i achieve this in a database structure?
You talking about uploading images to your server right ? if so:
You got few options to do it:
Create a 'unique' id and put them inside the image element and the content element.
Then you will get two arrays and you combine them by the unique.
Almost the same, just simply to store the content and the images inside arrays. and just loop through them and 'combine' them by the array's id. because you inserting the same amount so it should be the same. But answer 1 is safer here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I already have the info i need in the database. I know how to display the data on the main page, but i only show a small part of info there.
What i need is when i click on the read more i want it to link to a full info page.
How to i accomplish that? Do i have to make/generate a html file for every car i have and link the info from the main page to it? Or what is the correct technique for achieving this ?
It sounds like you want to have a list of cars on a main page, and then clicking on one of these cars would bring you to a details page with more information about that specific car.
This is a common situation. You'd simply have your main page query your car table and format that as a list of cars, each with a link to a details page like /details/12345 where the number represents the ID of the car you want to see. Then your details page would get the ID from the URL, query your database for details of that car ID, and assemble the page with those details.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
When I click on a link to an jpg image, the browser will usually open a new tab, and diplay it on a white background.
I want to use a generated php page, that will diplay the image, so I could use css on it.
I could put every image on a single php site, and simply link to that, but I want it to happen automatically, once any image link is clicked.
Link
How do I do that?
Change the links to Link or similar, create a showimage.php page that has the formatting you want and use $_GET[ 'image' ] to get the requested image's url.