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 6112139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:42:39+00:00 2026-05-23T14:42:39+00:00

I have an xml file called singers.xml . I have singers in it, and

  • 0

I have an xml file called singers.xml. I have singers in it, and the file looks like this:

<singers>
    <name>tiesto</name>
    <name>benny benassi</name>
    ..........       
</singers>

What I essentially want is that I can for each singer ONE BY ONE search and find 4 images, click and choose one image, download the image and add the singer to the database.

I have this function to search for the images:

function getImgUrl($name) {

$url = 'http://ajax.googleapis.com/ajax/services/search/images?';
$manual = 'http://localhost:8080/';
$args = array(
    'v' => '1.0',
    'q' => $name,
    'as_filetype' => 'jpg',
    'imgsz' => 'medium',
    'safe' => 'active',
    'as_filetype' => 'jpg'
);`

foreach($args as $key => $val) {
    $url .= $key . '=' . rawurlencode($val) . '&';
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $manual);
$body = curl_exec($ch);
curl_close($ch);

$json = json_decode($body, true);
$results = $json['responseData']['results'];

return $results;
}

And I’m using it like so:

    foreach($xml as $key => $val) {
    $results = getImgUrl($val);

    foreach($results as $result) {
        echo '<img src="' . $result['url'] . '" alt="" /><br />';
    }


}

But there is a problem with this code. Like I said, what I want is to see the images for each singer one by one and after I choose an image, move along to the next image.

Is that possible?

  • 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-05-23T14:42:39+00:00Added an answer on May 23, 2026 at 2:42 pm

    I’m not sure I fully understand the question, but here’s my suggestion.

    Start with getting the XML with all singers and store it on the server as a list of singers that you want an image for.

    The web application can get the first item on list, and build the page to select an image. Submit your choice back to the server, store the image and take the singer of the list, and repeat the sequence.

    Does that make any sense?

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

Sidebar

Related Questions

I have an XML file that starts like this: <Elements name=Entities xmlns=XS-GenerationToolElements> I'll have
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag
I have an xml file like this: <root> <item> <name>one</name> <status>good</status> </item> <item> <name>two</name>
If I have an xml button in a file called test.xml like this: <Button
i have a xml file on a server that look for example like this
i have this xml file called data_out.xml, and i want to do DTD and
I have an XML structure that looks like this: <?xml version=1.0?> <survey> <responses>0</responses> <question>
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)
I have a XML File like that <?xml version=1.0 encoding=utf-8 ?> <Configurations> <EmailConfiguration> <userName>xxxx</userName>
I have an XML file called employee. I want to bind the XML file

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.