Php mysql image scroll script??

Reply

Join Date: Apr 2008
Posts: 294
Reputation: Aamit has a little shameless behaviour in the past 
Solved Threads: 11
Aamit Aamit is offline Offline
Posting Whiz in Training

Php mysql image scroll script??

 
0
  #1
Oct 27th, 2009
Hi,

I want to create script like in facebook.

When we log into facebook, go into any friend's profile

Their gift button , show gifts with pagination.
when click on image and ok button it save into database.

Any sample demo script ?
How to create script like this?

Please give me suggestions.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 36
Reputation: Froger93 is an unknown quantity at this point 
Solved Threads: 4
Froger93 Froger93 is offline Offline
Light Poster
 
0
  #2
Oct 28th, 2009
You could do this with radio buttons or JavaScript as facebook does.

Obviously we wont write this script for you but here is how it generally works.

  1.  
  2. <?php
  3.  
  4. // Run query to retreive gifts
  5. $get_gifts = mysql_query("SELECT * FROM `gifts`");
  6. if( @mysql_num_rows( $get_gifts ) > 0 ) {
  7. echo "<form method=\"submit\" action=\"#\">";
  8. while( $row = mysql_fetch_array( $get_gifts ) ) {
  9. echo "<img src=\"...\" alt=\"...\" />" . $row['title'] . '<input type="radio" name="gift" value="' . $row['title'] . '" />';
  10. }
  11. echo '<input type="submit" name="send" value="Ok" />';
  12. echo "</form>";
  13. }
  14.  
  15. if( isset( $_POST['send'] ) ) {
  16. $gift = mysql_real_escape_string( $gift );
  17. // Need the user receiving the gifts id etc.
  18. $user_id = "...";
  19. $query = mysql_query("INSERT INTO `received_gifts` (id, gift) VALUES ('$user_id', '$gift')");
  20. echo "<p>Gift sent</p>";
  21. }
  22.  
  23. ?>

Something allong those general lines.
Last edited by Froger93; Oct 28th, 2009 at 12:50 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 294
Reputation: Aamit has a little shameless behaviour in the past 
Solved Threads: 11
Aamit Aamit is offline Offline
Posting Whiz in Training
 
0
  #3
Oct 28th, 2009
any demo sample example or script like facebook ?

Or sample link ??
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 36
Reputation: Froger93 is an unknown quantity at this point 
Solved Threads: 4
Froger93 Froger93 is offline Offline
Light Poster
 
0
  #4
Oct 30th, 2009
Not that I know of the script above will do the same thing virtually just may need a little playing with.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC