Jump to content

passing multiple variables to another page


jim.davidson

Recommended Posts

I'm having a problem with passing variables to another page.

 

First page has these variables

$member_id = '12345';

$location = 'PA';

$region = 'east coast';

 

I send the member_id to another page

<a href="update_member.php?member_id=<?php echo $member_id; ?>"</a>

 

On update_member page I have this

 

if (isset($_GET['member_id'])) {

  $this_member = $_GET['member_id'];

}

echo $this_member;

 

I get 12345

no problem doing what I want

 

Now I want to send two variables ($member_id and $location)

I send the member_id and $location the other page

<a href="update_member.php?member_id=<?php echo $member_id; ?>?loc=<?php echo $location; ?>"</a>

 

On update_member page I have this

 

if (isset($_GET['member_id'])) {

  $this_member = $_GET['member_id'];

}

if (isset($_GET['loc'])) {

  $member_loc = $_GET['loc'];

}

echo $this_member;

echo $member_loc;

 

I get 12345 and nothing shows for $member_loc, it's blank.

 

What am I doing wrong?

 

Any help will be appreciated

I have the same sort of problem.... i read that link but im still not sure i understand

 

This is my goal:

 

I want the user to enter a postal code... then have the option of 11 main categories...roll over the category will reveal a list of sub categories. When you click on a sub category you will be shown some company info ( for a company in that postal code in that specific sub category)

 

1. The sub categories can appear in one or more main category

2. There is only one company per sub category

3. Show only the sub categories with a company in them

 

 

Ok i got some help with how to build my database...but im still sort of stuck... i was told to make my tables as so...

 

Table : Postalcode

1. postcode

2. category

3. area

4. vendor_ref

5. status (available/sold)

 

Table : Vendor

 

1. vendor_ref

2. name

3. address

4. phone

5. email

6. website

 

So the user has entered a postal code....been sent to this page with buttons..so I have this button...in this example exterior...and when you rollover it...i have this code to show the categories available in that particular section

 

<?php

session_start();

mysql_connect("_________","_____","________");

mysql_select_db("_________");

 

 

$sql= "SELECT * FROM postalcode

WHERE postcode = '".$_POST['postcode']."'

AND area ='exterior'

AND (status='sold')";

 

$qry = mysql_query($sql);

 

if (mysql_num_rows($qry) > 0) {

while ($rs = mysql_fetch_assoc($qry)) {

print '<a href="index.php?ID=1" rel="gb_page_center[720,480]">'.$rs['category']."</a><br/><br/>";

}

} else {

echo 'no result found';

}

?>

 

 

What i'm stuck on is...when you click on the categories that are appearing.. i want the company connected to that category...to appear in a box...like a lightbox....with all the info (name, website, etc)

 

on the other pg(index.php?ID=1) i have the code that grabs all the information for the company....but it only works if i manually put the vendor_ref to equal something...and then all the categories have the same company.

 

My question is....is there any way to pass the vendor_ref from the first pg of categories to this page (index.php?ID=1) , so that it shows the correct company info that matches the category....or maybe there is a better way of doing this?

 

 

I hope I made sense....this is driving me crazy...just can't get it to work!!

 

Thanks for the help!

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.