将变量值从一个.php传递到另一个.php [英] Pass variable value from one .php to another .php

查看:521
本文介绍了将变量值从一个.php传递到另一个.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对PHP和Web设计非常陌生,并且在将变量的值发送到另一个php时遇到问题.

这是当前代码:

I''m very new to PHP and web-design, and I''m having trouble sending the value of a variable to another php.

Here is the current code:

<?php
$username = "root";
$password = "";
$database = "banners";
						
						mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die ("Não foi possível estabelecer uma ligação a Base de Dados");
$data = mysql_query("SELECT * FROM banner") or die(mysql_error()); 
echo "<table border = 1>"; 
echo "<tr>"; 
echo "<th>Cliente</th>"; 
echo "<th>Status</th>"; 
echo "<th>Visualizar</th>"; 
echo "<th>Excluir</th>"; 
echo "</tr>"; 
 
while($info = mysql_fetch_array( $data )) 
{ 
echo "<tr>"; 
echo "<td value=".$info['cliente'].">".$info['cliente'] . "</td> "; 
if($info['activo']='SIM'){echo "<td>Activo</td>"; }else {echo "<td>Desactivo</td> ";}
echo '<td><a href="visualizar.php" target="_blank"> 
<img src="imagens/search.png" /> 
</a></td>'; 
echo "<td>".$info['ficheiro'] . "</td> "; 
} 
echo "</table>"; 			
?>



用下划线加粗体显示的代码应将我发送到另一页,并显示表的全部信息的数据以及用户单击的条目的数据.
我的问题是让其他页面知道我要它显示某些"数据,或更准确地说,是将此处的变量形式发送到另一个.php文件.

我举一个图像示例:
http://i.imgur.com/Og7St.png [



The code that is underlined+bolded is supposed to send me to another page, and display the data of the entire information of the table, of the entry the user clicked on.
My problem is letting the other page know that I''m asking it to show "certain" data, or better said, sending the variable form here to another .php file.

I give an image example:
http://i.imgur.com/Og7St.png[^]

I hope I didn''t make it sound so complicated.
Thanks in advance !

推荐答案

用户名 = " ;
username = "root";


密码 = " ;
password = "";


数据库 = " ; mysql_connect(' localhost'
database = "banners"; mysql_connect('localhost',


这篇关于将变量值从一个.php传递到另一个.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆