Jump to content


Photo

Problem with variables


  • Please log in to reply
2 replies to this topic

#1 hmsg

hmsg
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 21 May 2006 - 10:55 AM

I have a file "produtos.php" that i want to make a link to another file "cprodutos.php" passing a variable with a number.

This is the code that i have in produtos.php:

print("<p style=\"margin-top: 0; margin-bottom: 0\">&nbsp;<a href=\"cprodutos.php?idcat=$campo_id\">$campo_c</a>");


I think this part is correct, because the link is made correctly, it gives me this: [a href=\"http://www.hmsg.net/bijuteria/cprodutos.php?idcat=2\" target=\"_blank\"]http://www.hmsg.net/bijuteria/cprodutos.php?idcat=2[/a]

the 2 is the number that i want to pass.

But in the cprodutos.php i don't know how to get the variable? is there any function to get the idact=2?

What code should i put in the cprodutos.php?



Whith the best regards

Hugo Gomes

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 21 May 2006 - 11:09 AM

$idact = $_GET['idact'];


#3 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 21 May 2006 - 11:47 AM

Might also consider using sessions

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users