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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:43:54+00:00 2026-06-12T04:43:54+00:00

Hello I’m working on a image browser where I’ve a submit button to add

  • 0

Hello I’m working on a image browser where I’ve a submit button to add a new row to the database. Unfortunately the isset function isn’t working. When I remove this if statement it works fine, but when use if(isset($_POST[‘addImg’])) nothing happens.

image browser has the form:

<div id="galleryAdd">
    <form enctype="multipart/form-data" method="post" >     
        <!-- een hidden id meegeven voor de plaatsing -->
        <input type="hidden" name="parentID" value="<? //$_GET['b']?>40">
        <input type="submit" name="addImg" value="Toevoegen" />
    </form> 
</div>
<div id="addExisting"></div>

javascript is calling page load when clicking on an image item:

$('.imgItem').click(function() {
        $('.imgItem').removeClass("image_select");
        $(this).addClass("image_select");   
        var imgsource = $(this).find('img').attr('src'),
            folderID = $(this).find('img').attr('rel');
        $("#addExisting").load("ajax.addExisting.php", {parentID:folderID, imgsource:imgsource});
        return false;   
    });

ajax.existing.php : page that is loaded when clicking an image

/* Algemene Gegevens bestand */
$bestand = $_POST['imgsource'];

/* Meta Gegevens bestand */
$file = substr($bestand, 0,strrpos($bestand,'.'));
$ext = substr(strrchr($bestand,'.'),1);
$base = basename($file);


if(isset($_POST['addImg'])){
/* Parent */
$queryParent = mysql_query("SELECT * FROM `image_folders` WHERE id = ".$_POST['parentID'].""); 
$parent = mysql_fetch_assoc($queryParent);
$bestand_folder = "../../images/".$parent['dirname']."/";


mysql_query("INSERT INTO images (positie, parent, parentID, naam, alt, titel, extensie) VALUES ('99', '".$parent['name']."', '".$parent['id']."', '".$base."', '".$base."',     '".$base."','".$ext."')")or die('kan niet uploaden'.mysql_error());

  }
  • 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-12T04:43:56+00:00Added an answer on June 12, 2026 at 4:43 am

    But you are not posting the addImg.

    You only sent to the ajax page the {parentID:folderID, imgsource:imgsource}

    change

    $("#addExisting").load("ajax.addExisting.php", {
                                  parentID:folderID, 
                                  imgsource:imgsource});
    

    to

    $("#addExisting").load("ajax.addExisting.php", {
                                  parentID:folderID, 
                                  imgsource:imgsource,  
                                  addImg:'Toevoegen'});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Hello this is my onload function :- $(function() { <?php if( isset ($this->validation->error_string) &&
Hello guys I am working on silverlight and I have issue regarding on database
Hello all I am working on javascript jquery and svg.I want to ask a
Hello all I am working on html and javascript.And I am going to ask
hello all i am working on a project in which i have a webpage
Hello There, I am new to phonegap.I am trying to record a audio clip
. Hello, I am trying to add a UIButton and other items to my
Hello there I am new to php and want to learn to write reusable
Hello i am trying to check to see if there is a row in

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.