Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8361823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:47:25+00:00 2026-06-09T11:47:25+00:00

On my website an user is able to fill in an url. When he

  • 0

On my website an user is able to fill in an url. When he fills in the url, he gets all the images src’s from that url. I push these src’s to an array in php:

 array_push($goodfiles,$pic);

Now the user will be able to choose on of the pictures (with a next or prev button) and then save it to the database. The picture that’s saved is based on the id of the image in the array. So $goodfiles[‘0’] means id = “0” and so on.

I want the swapping of the images to work with ajax, so that the pages doesn’t have to refresh all the time when clicking the next or previous button. And then when I save the form, I want to know the id of the current image, so that I can save it to the database.

How do I realize this with Ajax (jquery)?

Edit:

This is how I do it right now:

    $current_id = $_GET['id'];
if(empty($_GET['id']) || !empty($empty)) { $current_id = 0; }
$prev_id = $_GET['id'] - 1;
if($prev_id < 0){ $prev_id = 0;}
$next_id = $_GET['id'] + 1;
if($next_id > $_SESSION['count']-1 && $_SESSION['count'] != 'empty') { $next_id = $_SESSION['count']-1;}

This is the code for the pagination

And this is the pagination:

        <div id="url_pic">

        <img src="<?=$_SESSION['pictures'][$current_id]?>" class="img_load"><br>
        <? if($_SESSION['count'] > 1) { ?><center><a href="additem_url.php?id=<?=$prev_id?>"><img src="img/add/left.png"></a> <a href="additem_url.php?id=<?=$next_id?>"><img src="img/add/right.png"></a></center> <? } ?>

    </div>

So right now my solution doesn’t contain any javascript, but it’s all php coded. And the page refreshes everytime you want to see the next picture. I want to solve this in ajax, so that you can paginate through the images without a refresh. The way I want it is like this link:

 http://d-scribe.de/webtools/jquery-pagination/demo/demo_options.htm

But except for the text, I want to paginate through images.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:47:27+00:00Added an answer on June 9, 2026 at 11:47 am

    You probably don’t need to use AJAX for this. Simply return a html file containing a JavaScript array, which contains all those image URLs and do the other stuff using JavaScript.

    Get back to StackOverflow in case you’ve a more precise question and hopefully some code, which we can help on 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a website that requires several user types. I have been able
I'm working on a website where the user should be able to fill out
I want in my wordpress website that user can log in through their facebook
We have a website wherein a user can post information from our website to
I'm building a website that allows user to connect using Facebook Connect. So far
I'm building a website that contains users with user profiles. Many of the fields
I am building a website where I have a need that user should be
I have a form that a user would fill out while creating a ticket
I am creating a website where a user is able to upload an image
Here's the situation: the user is able to sign into a MVC application from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.