Jump to content

saikiran

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

saikiran's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi, this is how i am calling it into the popup. sorry for not putting the popup one <?php include_once('config.php'); $psql = "select * from bhakt_photo"; $result = mysql_query($psql); if($result) {     while($row = mysql_fetch_array($result,MYSQL_BOTH))     {         echo "<table>";         echo "<tr>";         echo "<td>";?> [b]<a  href="javascript:;" onClick = "window.open('bhakti_popnew.php?id=<?php echo $row['id'];?>','Gallery','height=700,width=589,scrolling=yes')"><img src="http://www.seher.in/uploads/<?php echo $row['mid_img'];?>" border="0" ></a>[/b]         <?php         echo "</td>";         echo "</table>";     } } ?> cheers saikiran
  2. hi, I am running a photo gallery in my site. in which , i am having a thumbnail page and a popup image page, what i am doing is when user clicks the thumbnail, the bigger picture should open in a popup in a separate page. I would like to add a navigation link in the popup page. i.e. with in the popup page, user can go and view the rest of the images in the gallery also. [color=red]i am providing this as 1,2 ,3,4,5.....[Next][Previous] .  format. i am not able to run the navigation part properly....[/color] This is what the code for the 2 pages: [color=red]Thumbnails page code [/color] [code]<?php include_once('config.php'); $psql = "select * from bhakt_photo"; $result = mysql_query($psql); if($result) {     while($row = mysql_fetch_array($result,MYSQL_BOTH))     {         echo "<table>";         echo "<tr>";         echo "<td>";?>         <a  href='bhakti_popnew.php?id=<?php echo $row['id'];?>'><img src="http://www.seher.in/gall_upload/ <?php echo $row['mid_img'];?>" border="0" ></a>              <?php         echo "</td>";         echo "</table>";     } } ?> [/code] -----Popup page code------------- [code]<?php include('config.php'); //new code $id=$_GET['id']; //this the Id i am getting for the images // how many rows to show per page $rowsPerPage = 1; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) {     $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; //$offset =  $rowsPerPage; $query = " SELECT * FROM bhakt_photo where id=$id " .         " LIMIT $offset, $rowsPerPage"; echo $query."<br>"        ; $result = mysql_query($query) or die('Error, query failed'); ?> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">         <?php         while($row = mysql_fetch_array($result))         {             echo $row['big_img'];         } ?>       </table>       <br> <br> <?php // how many rows we have in database $query  = "SELECT COUNT(big_img) AS numrows FROM bhakt_photo "; $result  = mysql_query($query) or die('Error, query failed'); $row    = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav  = ''; for($page = 1; $page <= $maxPage; $page++) {   if ($page == $pageNum)   {       $nav .= " $page "; // no need to create a link to current page       }   else   {        $nav .= " <a href=\"$self?page=$page\">$page</a> ";          } } if ($pageNum > 1) {   $page  = $pageNum - 1;        $id  = $id-1;     $prev  = " <a href=\"$self?page=$page&id=$id\">[Prev]</a> ";   $first = " <a href=\"$self?page=1&id=$id\">[First Page]</a> ";     //$prev  = " <a href=\"$self?page=$page\">[Prev]</a> ";   //$first = " <a href=\"$self?page=1\">[First Page]</a> "; } else {   $prev  = '&nbsp;'; // we're on page one, don't print previous link   $first = '&nbsp;'; // nor the first page link } if ($pageNum < $maxPage) {   $page = $pageNum + 1;    $id = $id +1;     echo "<b>". $id."<br>";       $next = " <a href=\"$self?page=$page&id=$id\">[Next]</a> ";       $last = " <a href=\"$self?page=$maxPage&id=$id\">[Last Page]</a> ";       //$next = " <a href=\"$self?page=$page\">[Next]</a> ";       //$last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else {   $next = '&nbsp;'; // we're on the last page, don't print next link   $last = '&nbsp;'; // nor the last page link } // print the navigation link echo $first . $prev . $nav . $next . $last; // and close the database connection // ... and we're done! ?>[/code] the problem what i assume is - the 'id' value is not passing in the subsquent pages properly. i have checked readymade photogallery packages...but i would like to have my own. I am not an expert in PHP too. can anyone just tell me whats the problem in my code and help me out in completing this one. cheers saikiran saisen76@hotmail.com
  3. hi, one small doubt once again, i am clear upto getting the latest row id and storing it in another table, and while clicking the download link, we have to check whether the id is greater than the stored one, in this case, does we have to use join with the two tables using the id column..if yes then what will be the syntax for join. [quote]$sql1 = "select * from table1, table2, where table1.id=table2.id && table2.id>$last_value";[/quote] just tell me whether i am doing it wrong or right. thank you once again cheers saikiran
  4. hi, This is wat i am looking for , i hope so....let me work in this way... i hope, this will solve my problem probably. Thank you once again for your suggestions cheers saikiran
  5. hi, [quote]The query checks where something is something For example you have a field with id_num SELECT * FROM table WHERE id_num > 15; This should show all results where id_num is over 15 (16, 17, 18....[/quote] Sorry to say this.... i am still not able to understand.How could i generate a latest back up of a table using the above script. Suppose, assume that id_num is my auto-generated record id, how could i know, whether this is the latest back up or not ???? cheers saikiran
  6. hi, [quote]$sql = "select * from blocked_temp_cus" WHERE x = 'y'[/quote] Thank you for your reply. But, i am not a php expert, what i understand from your code is that, we have to add one column or field, which will check for some value Y/N to be there. If it is Yes, then it will execute the script ? Can you please elaborate it so that i can do the rest . cheers saikiran
  7. hi, I am developing an web-app, where the client can download the database table as a .csv file. I am doing this using the below script [quote]<? header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 header("Cache-control: private"); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=block_registration.csv"); header("Content-Type: application/octet-stream"); header("Content-Transfer-Encoding: binary"); require ("config.php"); //db connection $sql = "select * from blocked_temp_cus"; $result = mysql_query($sql); if ($result){ //$sql = "select * from ads"; //$result = mysql_query($sql,$conn); $count = mysql_num_fields($result); while ($rows = mysql_fetch_array($result)){ for ($i=0;$i<$count;$i++){ echo $rows[$i].", "; //data } echo "\n"; //new line } } ?>[/quote] This works pretty well. Everytime, they click the download link, this file generates the .csv file and puts all the rows into the excel sheet completely. [color=red]Everytime, when user presses , we are getting the full table [/color] [color=red]Now, what we want is whenever we click the link, i want to download the latest records that i have inserted, instead of downloading the complete table once again.[/color] Can anyone help me out in this regard. cheers saikiran saisen76@hotmail.com
  8. hi redarrow, Thank you for your reply. while executing the code [quote]<?php     @mysql_connect("localhost", "admin", "maaindia") or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db("shobhacards") or die("ERROR--CAN'T CONNECT TO DB");     $limit          = 2;                  $query_count    = "SELECT count(*) FROM prod_catlog2";      $result_count  = mysql_query($query_count);       $totalrows      = mysql_num_rows($result_count);     echo $totalrows." ";   global $page;     if(empty($page)){         $page = 1;     }           $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM prod_catlog2 LIMIT $limitvalue, $limit";          $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");       while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["Product"]);     echo("</td>n<td>");     echo($row["Sno"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;               "<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."[/url] ";         //echo('<a href="disp.php&page=$pageprev">PREV'.$limit.'[/url]');     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;       echo $numofpages." ";       for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{                       echo("<a href=\"$PHP_SELF&page=$i\">$i[/url] ");           //echo "<a href='disp.php?page='$i''>$i[/url]";             //echo('<a href="disp.php?page=$i">'.'$i'.'[/url]' );         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{           echo("<a href=\"$PHP_SELF&page=$i\">$i[/url] ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;           echo("<a href=\"$PHP_SELF?page=$pagenext\">NEXT".$limit."[/url]");     }else{         echo("NEXT".$limit);     }       mysql_free_result($result); ?>[/quote] i am not getting any error, instead i am not able to traverse through my records with the back and prev button , as they are not showing the link at all. if i give something like this [color=red]http://localhost/gal.php?page = 1 0r 2 0r 3[/color]...., then it is showing that particular page. What i feel is the problem is with the navigation link part. if you can put some time...i hope you can help me out. cheers saikiran
  9. hi to all, I tried out the above script, but i am not getting the desirable output. What i want is this, i have image thumbnails which are placed in a page. When user clicks any single thumbnail, it has to open a gallery page which has many images (from database) with medium size. From here, if user presses one image, it should open a popup a show that image in bigger size. I have to provide back and next button facility in both the pages. kindly help me out in how to do it. cheers sai
  10. hi, I am using this script as it is to check the pagination script. [quote]<?php     @mysql_connect($localhost, $user, $password) or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db($database) or die("ERROR--CAN'T CONNECT TO DB");     [color=red]$limit          = 10;              [/color]     $query_count    = "SELECT count(*) FROM table";        $result_count  = mysql_query($query_count);        $totalrows      = mysql_num_rows($result_count);     if(empty($page)){         $page = 1;     }             $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM table LIMIT $limitvalue, $limit";            $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");         while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["users"]);     echo("</td>n<td>");     echo($row["usersID"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;                 echo("<a href="$PHP_SELF&page=$pageprev">PREV".$limit."</a> ");     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;         for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{             echo("<a href="$PHP_SELF?page=$i">$i</a> ");         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{             echo("<a href="$PHP_SELF?page=$i">$i</a> ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;                 echo("<a href="$PHP_SELF?page=$pagenext">NEXT".$limit."</a>");     }else{         echo("NEXT".$limit);     }         mysql_free_result($result); ?> [/quote] i have modified the same script 100%, just to check with my database table. What i did is changed the limit as 2 [color=red]<?php     @mysql_connect("localhost", "admin", "maaindia") or die("ERROR--CAN'T CONNECT TO SERVER");     @mysql_select_db("shobhacards") or die("ERROR--CAN'T CONNECT TO DB");     $limit          = 2;                  $query_count    = "SELECT count(*) FROM prod_catlog2";        $result_count  = mysql_query($query_count);          $totalrows      = mysql_num_rows($result_count);     echo $totalrows."<br>"; global $page;     if(empty($page)){         $page = 1;     }             $limitvalue = $page * $limit - ($limit);     $query  = "SELECT * FROM prod_catlog2 LIMIT $limitvalue, $limit";            $result = mysql_query($query) or die("Error: " . mysql_error());     if(mysql_num_rows($result) == 0){         echo("Nothing to Display!");     }     $bgcolor = "#E0E0E0"; // light gray     echo("<table>");         while($row = mysql_fetch_array($result)){         if ($bgcolor == "#E0E0E0"){             $bgcolor = "#FFFFFF";         }else{             $bgcolor = "#E0E0E0";         }     echo("<tr bgcolor=".$bgcolor.">n<td>");     echo($row["Product"]);     echo("</td>n<td>");     echo($row["Sno"]);     echo("</td>n</tr>");     }     echo("</table>");     if($page != 1){         $pageprev = $page--;                 "<a href=\"$PHP_SELF&page=$pageprev\">PREV".$limit."</a> ";         //echo('<a href="disp.php&page=$pageprev">PREV'.$limit.'</a>');     }else{         echo("PREV".$limit." ");     }     $numofpages = $totalrows / $limit;         echo $numofpages."<br>";         for($i = 1; $i <= $numofpages; $i++){         if($i == $page){             echo($i." ");         }else{                     echo("<a href=\"$PHP_SELF&page=$i\">$i</a> ");          //echo "<a href='disp.php?page='$i''>$i</a>";             //echo('<a href="disp.php?page=$i">'.'$i'.'</a>' );         }     }     if(($totalrows % $limit) != 0){         if($i == $page){             echo($i." ");         }else{         echo("<a href=\"$PHP_SELF&page=$i\">$i</a> ");         }     }     if(($totalrows - ($limit * $page)) > 0){         $pagenext = $page++;           echo("<a href=\"$PHP_SELF?page=$pagenext\">NEXT".$limit."</a>");     }else{         echo("NEXT".$limit);     }         mysql_free_result($result); ?>[/color] i am using the same $PHP_SELF only, can anyone find this and correct what wrong with this code. Also, instead of page numbers, i want to show just back and next and navigate to single record (image photo gallery type) suggestions and some links will be helpful. cheers sai
  11. i, thank you for the links. i will check it out as it as and get back to you.I hope my problem will be solved with this code. cheers sai
  12. hi, [color=red]I want to create a Image Gallery. The images are stored in a folder and while be linked with database table.The file name will be stored in the table and retrived and resolved using <img src="<?php echo ./uploads/$row['img_name']">.[/color] I want to add pagination facility in it. Some thing like [color=red]Back and Next buttons[/color], so that at a time 6 images will be displayed, by clicking next button, the next set of images should come... while clicking the [color=red]thumbnails, the image should be opened in a separate popup window. In the popup window also, we have to put next and back functionality.[/color] can anyone show me some tutorial or link for doing this. cheers saikiran saisen76@hotmail.com
  13. hi, Thank for your idea. when they are logging in i am just checking whether their email and password are correct and existing, If yes, i redirect them to their personalized page. In this case, along with email and password, i want to check with the field block also. I hope i am right. the sql code will be something like this sql = select * from customers where cust_email='{$_POST['cust_email']}' && cust_pass = '{$_POST['cust_pass']}' && blocked = 'true' i hope this is what , i have to do inorder to block the user. cheers saikiran
  14. hi just-j, thank your for your valuable idea, to be frank, i am just getting into PHP, yes i have a fair knowledge of using Sessions, but for the second idea, you have put forth, if you could help me out with some tutorial or code link, it would be appreciated. But, as you have mentioned, apart from these how could we do this, as this is a must for our system. cheers saikiran
  15. hi, I am creating an online order processing system, which has got personalized login system with registration process. What i do is this: 1) Accept registration through a form 2)Activate the registration, and send a random password, to the registered user email 3)After become member, they can access my order processing system and can view my company stocks and query for some stocks. [color=red]What i want, is after registering an user, if i feel the user is not genuine, i want to cancel the user's registration and to block that user.[/color] how to go abt this. i am using PHP 4.0/Wind XP/IIS cheers saikiran
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.