Passing variables throug diferents scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hmsg
Forum Commoner
Posts: 42
Joined: Sun May 14, 2006 9:48 am

Passing variables throug diferents scripts

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

To get the value put this in cprodutos.php

Code: Select all

echo $_GET['idcat'];
Post Reply