Jump to content
CyborGTX

Passar Dados

Recommended Posts

CyborGTX

Boas gostava de poder fazer uma coisa que e passar dados dentro de um echo para outra página

Código:

<?php

		$ligacao=mysql_connect("localhost","root","");
		mysql_select_db("proj",$ligacao);
///////////////busca do valor para limites e guardar em variavel/////////
		$sql = "SELECT * FROM `config` ";
		$result=mysql_query($sql,$ligacao); 

		if($result>0)
		{
		while ($registo=mysql_fetch_array($result))
		{
		$reg=$registo['num_reg']; 
		//echo "$reg";
		}

		}


//////////////Selecçao com limites/////////////////////
		$var_user=$_SESSION["nome_utilizador"];
		//echo "$var_user<br>";		
		$sql = "SELECT * FROM dados WHERE dados.utilizador LIKE \"$var_user\" LIMIT 0, $reg ;";
		$result=mysql_query($sql,$ligacao); 


		if($result>0)
		{
		echo "<table align=left border=0 >";
		echo "<tr><td>Nº</td><td>Nome da listagem</td><td>Ficheiro</td><td>Descrição</td><td>Tamanho</td><td>Data de upload</td><td>Download</td><td>Eliminar</td><td>Ver Grande</td></tr>";
		while ($registo=mysql_fetch_array($result))
		{
		$id=$registo['ID_ficheiro'];
		$nome=$registo['nome']; 
		$desc=$registo["descricao"];
		$link=$registo["link"];
		$fich=$registo["fich"];
		$tam=$registo["tamanho"];
		$dat=$registo["data"];
		$fich_img=$registo["fich_img"];
		//Preview
		$file_pre="$link$fich";//// Passar para include já com imagem
		///////////////////////////////////////////////////////////////////////////////Download_Experiencia///////////////////
		 $file_down= "$link$nome--$fich.zip";

		 ////////img ao passar por cima
		 $image_on = "$link$fich_img";
		 $image_off = "";

//echo "<img src='/images/'.$image_on.' onmouseover='this.src=\''.$image_off.'\';' onmouseout='this.src=\''.$image_on.'\';'/>";




		echo"<tr><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td><td> <hr> </td></tr>";
																																										///Download com img                    										            														 ///Eliminar com IMG														/////Preview em img
		echo"<tr><td>$id</td><td><li><div class='mini'>$nome</div><img src='$image_on' class='pic'  /></li></td><td>$fich</td><td>$desc</td><td>$tam KB</td><td>$dat</td><td><a  href='$file_down' target=''><img src='.\IMG\save.gif' align='right'></a></td></img><td><a target='_blank' href=''><img src='.\IMG\del.gif' align='right'></img></a></td><td><a target='_blank' Href='$image_on'><img src='.\IMG\preview.gif' align='right'></a></td></tr>";
		/*

		//header("Location: '$link'");
		//echo "<td align='center'><a href=\"pastas_s.php">comentar</td>;
		//echo "<tr align='center'></tr>";

		//mysql_close();

		*/
		}
		echo"</table>";
		}
		mysql_close();
?>

Na parte [glow=red,2,300]<td><a target='_blank' href=''><img src='.\IMG\del.gif' align='right'></img></a></td>[/glow] quero buscar o ID do ficheiro "$ID" e poder mandalo pa outra página para poder fazer o delete...

Share this post


Link to post
Share on other sites
KTachyon

Mandas por get:

echo '<a href="pagina.php?id='.$id.'" target="_blank">';


“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.