By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

How choose profile image from gallery

P: 3
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
Feb 24 '15 #1
Share this Question
Share on Google+
5 Replies


Dormilich
Expert Mod 5K+
P: 8,639
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.
Feb 24 '15 #2

P: 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.
Feb 24 '15 #3

Dormilich
Expert Mod 5K+
P: 8,639
without knowledge of the concerned system(s) we cannot offer any help.
Feb 24 '15 #4

P: 3
this is the move code

Expand|Select|Wrap|Line Numbers
  1. $srcPath = '../uploadDir/';
  2. $destPath = '../timelineDir/';  
  3.  
  4. $srcDir = opendir($srcPath);
  5. while($readFile = readdir($srcDir))
  6. {
  7.     if($readFile != '.' && $readFile != '..')
  8.     {
  9.         /* this check doesn't really make sense to me,
  10.            you might want !file_exists($destPath . $readFile) */
  11.         if (!file_exists($readFile)) 
  12.         {
  13.             if(copy($srcPath . $readFile, $destPath . $readFile))
  14.             {
  15.                 echo "Copy file";
  16.             }
  17.             else
  18.             {
  19.                 echo "Canot Copy file";
  20.             }
  21.         }
  22.     }
  23. }
  24.  
  25. closedir($srcDir); 
my question is how to add an onclick action on the initial image so the above code run
Feb 24 '15 #5

Dormilich
Expert Mod 5K+
P: 8,639
you have to make an AJAX request (or form submit) since you have to execute server-side code.
Feb 24 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.