How choose profile image from gallery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxiskills01
    New Member
    • Feb 2015
    • 3

    #1

    How choose profile image from gallery

    Hi, good day every one please i am working on a social site on a member's page he or she can select a picture from any of his or her uploaded image and it will replace the timeline banner or page profile picture . pleas how can i achieve this using jQuery with Php
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    pleas how can i achieve this using jQuery with Php
    jQuery = JavaScript = client-side … PHP = server-side. both are not compatible with each other.

    without knowledge of the concerned system(s) we cannot offer any help.

    Comment

    • maxiskills01
      New Member
      • Feb 2015
      • 3

      #3
      what am saying is these images are in the database which is fetch and display on the member page onclick on any of the images fetch to page will now be move to a timeline folder which now replaces the timeline image.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        without knowledge of the concerned system(s) we cannot offer any help.

        Comment

        • maxiskills01
          New Member
          • Feb 2015
          • 3

          #5
          this is the move code

          Code:
          $srcPath = '../uploadDir/';
          $destPath = '../timelineDir/';  
          
          $srcDir = opendir($srcPath);
          while($readFile = readdir($srcDir))
          {
              if($readFile != '.' && $readFile != '..')
              {
                  /* this check doesn't really make sense to me,
                     you might want !file_exists($destPath . $readFile) */
                  if (!file_exists($readFile)) 
                  {
                      if(copy($srcPath . $readFile, $destPath . $readFile))
                      {
                          echo "Copy file";
                      }
                      else
                      {
                          echo "Canot Copy file";
                      }
                  }
              }
          }
          
          closedir($srcDir);
          my question is how to add an onclick action on the initial image so the above code run

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            you have to make an AJAX request (or form submit) since you have to execute server-side code.

            Comment

            Working...