libinaz Posted July 30, 2006 Share Posted July 30, 2006 My display function doesn't work. It works if it's called up on its own, without the other if/else, but doesn't work through the display function. It doesn't seem to get the value of $institutionname. Is there something I need to post/do for it to get that variable?mydisplay.php[code]<?phpfunction display_contact_form(){?><?php $query_billemailw = "SELECT * FROM users_tbl WHERE institutionname = '$institutionname' AND expired < 3 ORDER BY bill_email ASC";$billEmailw = mysql_query($query_billemailw) or die(mysql_error());$row_member4 = mysql_fetch_assoc($billEmailw);?><form name="formactive" method="post" action="removeinactive.php"><input name="institutionname" type="hidden" value="<?php echo $institutionname; ?>"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC"><tr><td bgcolor="#CCCCCC"><table width="100%" border="0" align="left" cellpadding="4" cellspacing="0" class="bodytext"><tr class="bodytextbold"><td colspan="4" class="header"><?php echo $institutionname; ?> Active Members<br><span class="bodytext">As the institution contact you can remove Members from the Active Member list. These would be members who are no longer associated with your institution, or members who no longer wish to be Active. To remove them, select the checkbox to the left and select the Remove Active Members button.</span><p><span class="bodytext"> If you accidently removed a membership you can reactivate them using the Review Deactivated Members below, or you can, <a href="../contact.html">contact Us</a>.</span></p></td></tr><tr><td width="5%"></td><td width="36%"><strong>Email Address</strong></td><td width="59%"><strong>Member Name</strong></td></tr><?phpdo { ?><tr><td><input type="radio" name="bill_email" value="<?php echo $row_member4['bill_email']; ?>"></td><td><?php echo $row_member4['bill_email']; ?></td><td><?php echo $row_member4['lname']; ?>, <?php echo $row_member4['fname']; ?></td></tr> <?php} while ($row_member4 = mysql_fetch_assoc($billEmailw));?></table> </td> </tr> <tr> <td><input type="submit" name="Submit" value="Remove"> </td> </tr> <tr> <td> </td> </tr> </table> </form> <form name="form5" method="post" action="removeinactive.php"> <input name="institutionname" type="hidden" value="<?php echo $institutionname; ?>"> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC"> <tr> <td bgcolor="#CCCCCC"><table width="100%" border="0" align="left" cellpadding="4" cellspacing="0" class="bodytext"> <tr class="bodytextbold"> <td colspan="4" class="header"> <?php $query_billemaile = "SELECT * FROM users_tbl WHERE institutionname = '$institutionname' AND expired > 2 AND expired < 5 ORDER BY bill_email ASC";$billEmaile = mysql_query($query_billemaile) or die(mysql_error());$row_member5 = mysql_fetch_assoc($billEmaile);; ?> <?php echo $institutionname; ?>'s Inactive Members<br> <span class="bodytext">These are members who have not renewed membership for the 2006/2007 Member year. You can email your members and let them know to <a href="https://www.naaco.info/membership06/start.php">sign up</a></span> or if you know they will not be members this year, you can move them to the Deactivated Member's List. <p><span class="bodytext"> If you accidently removed a membership, or need assistance, <a href="../contact.html">contact Us</a>.</span></p> </td> </tr> <tr> <td width="5%"></td> <td width="36%"><strong>Email Address</strong></td> <td width="59%"><strong>Member Name</strong></td> </tr> <?php do { ?> <tr> <td><input type="radio" name="bill_email" value="<?php echo $row_member5['bill_email']; ?>"> </td> <td><?php echo $row_member5['bill_email']; ?></td> <td><?php echo $row_member5['lname']; ?>, <?php echo $row_member5['fname']; ?></td> </tr> <?php } while ($row_member5 = mysql_fetch_assoc($billEmaile)); ?> </table> </td> </tr> <tr> <td bgcolor="#CCCCCC"><input type="submit" name="Submit" value="Remove"> </td> </tr> <tr> <td> </td> </tr> </table></form><table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td bgcolor="#CCCCCC" class="header"><form name="form2" method="post" action="inactivemembers.php"> <input name="institutionname" type="hidden" value="<?php echo $institutionname; ?>"> Select to <input type="submit" name="Submit3" value="Review all Deactivated Members"> </form></td> </tr></table><?php};?>[/code]Where it is called up from[code]<?php$query_contact = "SELECT * FROM users_tbl WHERE bill_email = '$billEmail'";$institutioncontact = mysql_query($query_contact) or die("Problem with the query: $query_contact<br>" . mysql_error());$row2 = mysql_fetch_assoc($institutioncontact);if (isset($row2['institutioncontact']) && $row2['institutioncontact']=="Yes") { display_contact_form();}else{$query_wwcontact = "SELECT * FROM users_tbl WHERE institutioncontact = 'Yes' AND institutionname = '$institutionname'";$institutionwwcontact = mysql_query($query_wwcontact) or die("Problem with the query: $query_contact<br>" . mysql_error());$wwrow = mysql_fetch_assoc($institutionwwcontact);if (isset($wwrow['institutioncontact']) && $wwrow['institutioncontact']=="Yes") { echo 'Your institution contact is ' . $wwrow['lname']; echo', ' . $wwrow['fname']; echo', ' . $wwrow['bill_email'];}else{echo 'Your institution currently does not have an institution contact. Please select if you would like to become the contact.<br>';echo '<select name="institutioncontact" class="formbodytext" id="select" tabindex="1">';echo '<option value="" selected>Institution Contact</option>';echo '<option value="Yes">Yes, make me the institution contact</option>';echo '<option value="No">No</option>';echo '</select>';}}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/16047-display-function-not-working/ Share on other sites More sharing options...
DocSeuss Posted July 30, 2006 Share Posted July 30, 2006 I can't find where the variable in question is ever being set to a value. Where are you intending to get the value for $institutionname? Quote Link to comment https://forums.phpfreaks.com/topic/16047-display-function-not-working/#findComment-66135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.