pb with passing variables

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
yannou
Forum Newbie
Posts: 5
Joined: Wed Apr 13, 2005 4:27 am

pb with passing variables

Post by yannou »

Hi all,

this should be a vry simple one for you experts!!!
I am using PHP/MySLQ on my site.

I have created a list poulated by a table:

Code: Select all

<a href="xxxxxxx=<?php echo $row_Recordset1['Gas_ID']; ?>" >
<?php echo $row_Recordset1['Gas_Name']; ?></a>
How can the link I created for each recorset open up in the same location on the same page?

I hope I am making myself clear...

Thanks a million.

Jcart | Please use

Code: Select all

tags around your code.[/color]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

:?

What is showing in the HTML source code that is outputted?
Are you saying that the link points to itself?
yannou
Forum Newbie
Posts: 5
Joined: Wed Apr 13, 2005 4:27 am

Post by yannou »

No, I mean that the link has to point to the same page... Arf, I know it's even hard to explain .

Imagine you have a table populated by a database.
Imagine I want to link each line of that table to some data but you want it to appear in the exact same page and same location when the visitor clicks on it.

:?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

<a href="?row=<?php echo $$row_Recordset1['Gas_ID']; ?>">

Where $_GET['row'] is the ID of that row :?

Then you just change you query for the DB based on the value of $_GET['row']...

BTW.... the PHP Code forum is the best place to ask this type of question :-D
yannou
Forum Newbie
Posts: 5
Joined: Wed Apr 13, 2005 4:27 am

Post by yannou »

Thx d11wtq,

But I still don't understand how to display the result instead of the table rows now... I'll go ask in the forum.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to PHP-Code and please use

Code: Select all

tags around your code.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

yannou wrote:How can the link I created for each recorset open up in the same location on the same page?
What do you mean - in same location :?: do you want to display it inline... or do you want to display it in same window. Boy, are you confusing :?
yannou
Forum Newbie
Posts: 5
Joined: Wed Apr 13, 2005 4:27 am

Post by yannou »

ok ok ok I know, not only am I a newbie but I am also french, so it's sometimes tough to get an idea through.

I'll try php code forum
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

yannou wrote:ok ok ok I know, not only am I a newbie but I am also french, so it's sometimes tough to get an idea through.

I'll try php code forum
Hey don't get excited. Calm down...
This thread has been moved to PHP-Forum. So you can ask it right here...;)

PS: Hey Phenom, is that you by the name JCart :?
yannou
Forum Newbie
Posts: 5
Joined: Wed Apr 13, 2005 4:27 am

Post by yannou »

ok, Thanks a million.

:P
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

n00b Saibot wrote:PS: Hey Phenom, is that you by the name JCart :?
It is indeed.... I asked him that not long back :P - just to confuse everyone... a random new member with >1000 posts appered out fo the blue with phenom's avatar LOL.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

It sure is confusing seeing a new Mod having a Cart come outta nowhere LOL:lol:
Post Reply