Page 1 of 1

Passing variables throug diferents scripts

Posted: Sun May 14, 2006 9:59 am
by hmsg
Hello everbody

I'm starting with php and mysql.

So i've build a script called produtos.php and a cprodutos.php

i'm trying to pass an argument from produtos.php to cprodutos.php

I already have the code to make the link (in produtos.php) but i can't received the variable in cprodutos.php

Someone can help me?

Here is the code:

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 code is correct, because it makes me a link with the correct syntax (ex.: cprodutos.php?idcat=2)


But the problem is to receive the value of the variable idcat, i can't figure out how i receive that value ($idcat)

can someone help me with the code to put in the cprodutos.php to receive the variable?


Here's what i'm trying to do: http://www.hmsg.net/bijuteria/produtos.php


With the best regards
Hugo Gomes

Posted: Sun May 14, 2006 10:07 am
by hawleyjr
To get the value put this in cprodutos.php

Code: Select all

echo $_GET['idcat'];