0

Hello ,

I'm trying to set 3 different tables using url variable from a differnt page.
When a certain var is selected , the page should display a certain table.

each table is differed by name and im using an IF statement.
My issue is that only the first echo'd table is being displayed....


As you see in my code , I'm trying to get the 'catagory'
variable from the URL and using it to
display the right table.
The .... is the rest of the table so its not relevant to show it here..
Any suggestions ?

update_ads.php //the page name
....
<?php 

$name = $_GET['record'];
$the_catagory = $_POST['catagory']; //the variable from the
 //other page :(<a href="update_ads.php?record=<?php echo $players_name?>&catagory=players">)


if ($the_catagory = "players"){

echo'
'.$name.'
<!-- players section for update -->
<div>
...

}

 elseif ($the_catagory = "events") {

echo'
'.$name.'
<!-- bands section for update -->
<div>
....
}

else if ($the_catagory = "sales"){

 echo'
'.$name.'
<!-- sales section for update -->
<div>
}
.....
4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by samsambm
0

view your source - if the source code of your webpage contains the reqd div then its html problem

else its php if,else braces problem

your logic seems to be right

0

Following works for me fine:

$name = $_GET['record'];
$the_catagory = $_POST['catagory']; //the variable from the


if ($the_catagory == "players")  {

} elseif ($the_catagory == "events") {

} elseif ($the_catagory == "sales") {

}
0

OK. Now I've got it . There were 2 main issue:
1. I've changed it to == instead og =..
2. From the calling page , I've deleted the 2nd variable '?' mark..
<a href="update_ads.php?record=<?php echo $band_id?>&?catagory=events" >ערוך</a>
Thanks a lot ...Issue solved.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.