dynamic css image sliding in php

hello,

I am a beginner in php so looking for your precious suggestions.

I am looking to do this http://www.impressivewebs.com/demo-files/content-switcher/content-switcher.html#one
dynamically in php.

Basically I am retrieving three pirctures from database and looking to do this dynamically, I am badly stuck, so will be glad to get help.

Thank you.

doing it in php would basically be just using linked images, you could add some GET info to the links such as :

index.php?id=1

then in php you do something like:

[php]

if($_GET==1){ echo"<img src={$variable_from_database_call}"; }
[/php]

php would not be all to pretty for something like that, it would have to refresh the page in order to show change, where as you should use javascript or jquery to do some dynamic changes without refreshing the page

Thanks for your reply, basically it is to get votes from user on an image and I am doing like this:

[code]

	<div id="content-slider">

		<ul id="content-slider-inside">
<?php $q = mysql_query("SELECT * FROM vote_frames"); while ( $r = mysql_fetch_array($q) ) { ?>
  • <input type=“hidden” name=“frame_id” value="<?php echo $r["frame_id"]; ?>" />

    <img src=“frame_thumbs/<?php echo $r["frame_pic"]; ?>” />

  • Vote This Frame

    <?php } ?> [/code]

    Records are fetched, they are ok, Now I need to print counting links associated with the fetched image, so if some one clicks on 2, 2nd record is selected like it does in html.

    Ok, I finally did this, now its voting issue, Here is code which did job for me

    Code:

      <?php $q = mysql_query("SELECT * FROM vote_frames"); while ( $r = mysql_fetch_array($q) ) { ?>

      <input type=“hidden” name=“frame_id” value="<?php echo $r["frame_id"]; ?>" />

    • ">

      <img src=“frame_thumbs/<?php echo $r["frame_pic"]; ?>” />

    • Vote This Frame (#<?php echo $r["frame_name"]; ?>)

      <?php } ?>
      <?php $q = "select * from vote_frames"; $result = mysql_query($q); $frameCount = 1; while($row=mysql_fetch_array($result)) { ?>
    • "> <?php echo $frameCount ++; ?>
    • <?php } ?>

    Now, the only issue remains is the voting. Vote goes to the frame with having highest ID even 1st, 2nd or 3rd record is selected. How to over come this now?

    Sponsor our Newsletter | Privacy Policy | Terms of Service