PHP - Problemas paginacion pagina

 
Vista:
sin imagen de perfil

Problemas paginacion pagina

Publicado por sadelea (1 intervención) el 09/06/2017 17:42:42
Tengo un problema gordo. Pretendo hacer una galeria php/mysqli
La cual recibira de una pagina anterior llamada index.php


1
2
3
4
5
6
7
8
9
10
11
12
13
Lista de Acontecimientos<Br />  <?php
$conexion = mysqli_connect("localhost", "root", "") or trigger_error(mysql_error(),E_USER_ERROR);
mysqli_select_db($conexion,"db674013292");
$consulta="Select * from textos where clase=1 ";
$result=mysqli_query($conexion,$consulta);
?>
 
 <?php
 while($fila=mysqli_fetch_row($result)){
echo "<a href=\"H.php?inombre='".$fila['0']."'\">".$fila['1']."</a><br>";

  }
?>

En la Galería represento las imágenes que especifique el parámetro inombre que se hay tomado de la pagina anterior . Pero el problema lo tengo en el enlace a las pagina de las galerías
Parece que no envio el inombre
1
<a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&?$inombre=$objResult[idtexto];'>


Galeria.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
$inombre=$_GET['inombre'];
 
		$objConnect =  mysql_connect("localhost","root","") or die(mysql_error());
		$objDB =  mysql_select_db("db674013292");
 
		$strSQL = "SELECT * FROM galeriadecidiendo where idtexto =$inombre ";
 
		$objQuery = mysql_query($strSQL);
		$Num_Rows = mysql_num_rows($objQuery);
 
		$Per_Page = 8;   // Per Page
 
		@$Page = $_GET["Page"];
		if(!@$_GET["Page"])
		{
			$Page=1;
		}
 
		$Prev_Page = $Page-1;
		$Next_Page = $Page+1;
 
		$Page_Start = (($Per_Page*$Page)-$Per_Page);
		if($Num_Rows<=$Per_Page)
		{
			$Num_Pages =1;
		}
		else if(($Num_Rows % $Per_Page)==0)
		{
			$Num_Pages =($Num_Rows/$Per_Page) ;
		}
 
		else
		{
			$Num_Pages =($Num_Rows/$Per_Page)+1;
			$Num_Pages = (int)$Num_Pages;
		}
 
		$strSQL .=" order  by idgaleriatexto ASC LIMIT $Page_Start , $Per_Page";
		$objQuery  = mysql_query($strSQL);
		echo"<table border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
		$intRows = 0;
		while($objResult = mysql_fetch_array($objQuery))
		{
			echo "<td>";
			$intRows++;
	?>
<img with="150" height="150" src="<?=$objResult["url"]; ?>"><br>
	<?PHP
			echo"</td>";
			if(($intRows)%4==0)
			{
				echo"</tr>";
			}
		}
		echo"</tr></table>";
	?>
		<br>
	<span class="paguinas">Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page :</span>
		<?PHP
		if($Prev_Page)
		{
			echo "
			<a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&?$inombre=$objResult[idtexto];'>
			
			<< Back</a> ";
		}
 
		for($i=1; $i<=$Num_Pages; $i++){
			if($i != $Page)
			{
				echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=?$i&$inombre=idtexto'>$i</a> ]";
			}
			else
			{
				echo "<b> $i </b>";
			}
		}
		if($Page!=$Num_Pages)
		{
			echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&inombre=idtexto'>Next>></a> ";
		}
		?>
	<?PHP
mysql_close($objConnect);
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder