Jump to content

williamh26

Members
  • Posts

    32
  • Joined

  • Last visited

williamh26's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thank you very much it works.... <?php include('core/inc/init.inc.php'); if(isset($_GET['file_id'])) { $file_id=(int)$_GET['file_id']; $file=mysql_query("SELECT file_name, file_expiry FROM files WHERE file_id=$file_id"); if(mysql_num_rows($file)!=1){ echo'Invalid file Id'; }else{ $row=mysql_fetch_assoc($file); if ($row['file_expiry']<time()){ echo'This file has expired'; }else{ $path= file_get_contents('core/files/'.$row['file_name']); header("Content-Disposition:attachment;filename=\"$row{['file_name']}\""); header('Content-type: application/force-download'); header('Content-Length:'.strlen($path)); header('Content-type: application/octetstream'); echo $path; } } } ?> I will continue with this project....thnak you
  2. it works but now it does not show the image
  3. How I fix it!!! if anyone knows it... please. thanks
  4. yes it happens all the time.... in firefox and IE
  5. When I am trying to download the file, it shows me this error..... can you guys give me a hint... thanks C:\Users\folder1\AppData\Local\Temp\AADMn2IX.jpg.part could not be saved, because the source file could not be read.
  6. Ok, it was blank spaces on the login function... once I delete those spaces,, it works. thank you for the reply. <?php mysql_connect('xxxx','xxxx','xxxx'); mysql_select_db('xxxx'); ?>
  7. Thank you.... fixed... but now this is the error I have C:\Users\folder1\AppData\Local\Temp\AADMn2IX.jpg.part could not be saved, because the source file could not be read. Try again later, or contact the server administrator. The image failed to saved and download it. thank you
  8. Hi Guys I trying to download files and I have this error message, hopelly you guys can help me please Warning: Cannot modify header information - headers already sent by (output started at /home/content/04/12746204/html/Digital/core/inc/init.inc.php:6) in /home/content/04/12746204/html/Digital/download.php on line 14 Warning: Cannot modify header information - headers already sent by (output started at /home/content/04/12746204/html/Digital/core/inc/init.inc.php:6) in /home/content/04/12746204/html/Digital/download.php on line 15 Warning: Cannot modify header information - headers already sent by (output started at /home/content/04/12746204/html/Digital/core/inc/init.inc.php:6) in /home/content/04/12746204/html/Digital/download.php on line 16 Warning: Cannot modify header information - headers already sent by (output started at /home/content/04/12746204/html/Digital/core/inc/init.inc.php:6) in /home/content/04/12746204/html/Digital/download.php on line 17 Warning: Cannot modify header information - headers already sent by (output started at /home/content/04/12746204/html/Digital/core/inc/init.inc.php:6) in /home/content/04/12746204/html/Digital/download.php on line 18 This is the code I use to force the download <?php include('core/inc/init.inc.php'); if(isset($_GET['file_id'])) { $file_id=(int)$_GET['file_id']; $file=mysql_query("SELECT file_name, file_expiry FROM files WHERE file_id=$file_id"); if(mysql_num_rows($file)!=1){ echo'Invalid file Id'; }else{ $row=mysql_fetch_assoc($file); if ($row['file_expiry']<time()){ echo'This file has expired'; }else{ $path="core/files/{$row['$file_name']}"; header('Content-Type:application/octet-stream'); header('Content-Description:File Transfer'); header('Content-Transfer-Encoding:binary'); header("Content-Disposition:attachment;filename=\"{$row['file_name']}\""); header('Content-Length:'.filesize($path)); readfile($path); } } } ?> Thank you for your help.....
  9. Hi guy I am trying to get the pagination right. this is my code <?php echo"<img src='images/banner/ribbon.jpg' align='center' width='500' height='100' alt=''/>"; $categoria_id = $_GET['cat']; $query = "Select count(categoria_id) from categoria where categoria_id = $categoria_id"; $result = mysql_query($query); $row = mysql_fetch_array($result); if (mysql_num_rows($result) > 0) { $per_page = 7; $pages_query = mysql_query("SELECT COUNT(nombre) from productos WHERE categoria_id=$categoria_id"); $pages = ceil (mysql_result($pages_query, 0)/$per_page) ; $page = (isset($_GET['page'])) ? (int)$_GET['page']: 1; $start = ($page - 1) * $per_page; $sql = mysql_query("SELECT * from productos WHERE categoria_id=$categoria_id LIMIT $start, $per_page"); while($row = mysql_fetch_array($sql)){ $nombre = $row['nombre']; $descripcion = $row['descripcion']; $precio = $row['precio']; $imagen = $row['imagen']; echo"<ul class=leaders>"; echo"<li><span><a href='images/platos/$imagen.jpg' rel='prettyPhoto[gallery4]' title='$nombre $descripcion' width='489' height='720'><img src='images/platos/$imagen.jpg' rel='prettyPhoto[gallery3]' align='left' width='105' height='90' alt=''/><strong> $nombre</strong></a></span>"; echo"<span>$ $precio</span></li>"; echo"</ul>"; } if($pages >=1 && $page <= $pages) { for ($x =1; $x<=$pages; $x++) { echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ': '<a href="?page='.$x.'">'.$x.'</a> '; } } } ?> the problem is that when I click for example page number two in the pagination it shows me the index page... How I FIXT IT... OH something else... how i erase the <li> dots?? I am trying with css but with not results. THANKS IN ADVANCED
  10. It shows only the chapters from Genesis and when I click Exodo nothing happens
  11. yes it looks fine... maybe some modification in the sql query.? Source code: <?php $capitulo_id = intval ($_GET['cat']); $libro_id = intval ($_GET['libro_id']); $query="SELECT * from rv1960 where capitulo_id = $capitulo_id and libro_id= $libro_id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $libro_id =$row['libro_id']; $versiculo =$row['versiculo']; $texto =$row['texto']; echo "<h3>$versiculo -- $texto</h3><br>"; echo"<p>"; } ?>
  12. in the link perhaps shoud i put the id field like this: <a href=\"index.php?content=escritura&cat=$id=id&$capitulo_id&libro_id=$libro_id\"> and the code will get <?php $capitulo_id = intval ($_GET['cat']); $libro_id = intval ($_GET['libro_id']); $id = intval ($_GET['id']); $query="SELECT * from rv1960 where capitulo_id = $capitulo_id and libro_id= $libro_id and id=$id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $id =$row['id']; $libro_id =$row['libro_id']; $versiculo =$row['versiculo']; $texto =$row['texto']; echo "<h3>$versiculo -- $texto</h3><br>"; echo"<p>"; } ?> But i dont know in the select query if it is rigth to put two "and" i try it.. and i got this result: Undefined variable: id in C:\wamp\www\Iglesia viviente\includes\capitulo.inc.php
  13. i understant that and it supposed to be like that, however when i click exodus--> chapter 1 --> does not show the text....
  14. actually not i was looking in a wrong part.. according with the database exodo starts a id_libro where link id =2 the id=2 starts in id number 1534...
  15. This show that it picks the exact id from the database but it does not retrieve the text http://www.youtube.com/watch?v=Pqqh5sUonQc
×
×
  • 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.