Jump to content
AMB

passar variavel para outra pagina

Recommended Posts

AMB

Bom dia

Eu estou a utilizar o phprunner 5.2 (e estou a zero em php) penso que aquilo que eu quero é basico mas não estou conseguindo....

Numa pagina origem tenho um botão que diz porto e outro lisboa....

<TABLE 
      style="BORDER-BOTTOM: #282828 2.25pt outset; BORDER-LEFT: #282828 2.25pt outset; BACKGROUND: silver; BORDER-TOP: #282828 2.25pt outset; BORDER-RIGHT: #282828 2.25pt outset; mso-cellspacing: .7pt; mso-table-layout-alt: fixed" 
      class=MsoNormalTable border=1 cellSpacing=1 cellPadding=0 align=center>
        <TBODY>
        <TR 
        style="HEIGHT: 45.6pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
          <TD 
          style="BORDER-BOTTOM: #282828 1pt inset; BORDER-LEFT: #282828 1pt inset; PADDING-BOTTOM: 0.75pt; BACKGROUND-COLOR: transparent; PADDING-LEFT: 0.75pt; WIDTH: 104px; PADDING-RIGHT: 0.75pt; HEIGHT: 45.75pt; BORDER-TOP: #282828 1pt inset; BORDER-RIGHT: #282828 1pt inset; PADDING-TOP: 0.75pt; mso-border-alt: inset #282828 .75pt">
            <P style="TEXT-ALIGN: center" 
            align=center> <STRONG><SPAN 
            style="FONT-FAMILY: Verdana; COLOR: #282828; FONT-SIZE: 12pt"><A 
            href="http://192.9.200.149/Equipamentos/output/cq_cc_list.php?local=Porto"><SPAN 
            style="FONT-FAMILY: Arial; FONT-SIZE: 8pt">Porto</SPAN></A></SPAN></STRONG><o:p></o:p></P></TD>
          <TD 
          style="BORDER-BOTTOM: #282828 1pt inset; BORDER-LEFT: #282828 1pt inset; PADDING-BOTTOM: 0.75pt; BACKGROUND-COLOR: transparent; PADDING-LEFT: 0.75pt; WIDTH: 104px; PADDING-RIGHT: 0.75pt; HEIGHT: 45.75pt; BORDER-TOP: #282828 1pt inset; BORDER-RIGHT: #282828 1pt inset; PADDING-TOP: 0.75pt; mso-border-alt: inset #282828 .75pt">
            <P style="TEXT-ALIGN: center" align=center> <STRONG><SPAN 
            style="FONT-FAMILY: Verdana; COLOR: #282828; FONT-SIZE: 12pt"><A 
            href="http://192.9.200.149/Equipamentos/output/cq_cc_list.php?local=Lisboa"><SPAN 
            style="FONT-FAMILY: Arial; FONT-SIZE: 8pt">Lisboa</SPAN></A></SPAN></STRONG><o:p></o:p></P></TD>

O que eu pretendo é que ao clicar em cada botao na pagina seguinte em que tenho um tabela (list page e add page) 2 paginas... que onde estiver local apareça porto ou lisboa consoante se carrega no botao....

ja coloquei nesta pagina origem: 

  href="http://192.9.200.149/Equipamentos/output/cq_cc_list.php?local=Lisboa"

e na listpage coloquei

<?php

$local = $_GET['local'];

echo $local

?>

mas não faz nada :S

Está errado...em que local da pagina devo colocar ituh???

Share this post


Link to post
Share on other sites
rmlm

Tenta assim:

if(!empty($_GET['local']) && $_GET['local'] == 'Lisboa'){
              echo "Lisboa";
}

Share this post


Link to post
Share on other sites
KTachyon

Na de destino.


“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
rippp

<?php

$local = $_GET['local'];

echo $local

?>

isto nao funciona porque é echo $local; falta o ;

<?php
if(isset($_GET['local'])){
              echo $_GET['local'];
}
?>

porque o local pode ser lisboa ou porto..


Java, Android developerhttp://minimalcode.net

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.