Page 1 of 1

Form Variables - I must be taking crazy pills!!

Posted: Sat May 24, 2008 3:38 pm
by DjMikeWatt
Okay, so I'm a beginner here... I've been doing very well so far though, and I've been impressed at just how intuitive php can be when used correctly. I have successfully made several pages that are passing information the way they should. Now, all of the sudden, I'm working on a page that just isn't working and I can't fathom why. I'm guessing it's something simple that I'm missing, but any help would be appreciated.

On this page, I've tried checking in Live Data View and nothing works. Even setting all of the variables to %, which I would assume would return ALL records shows me nothing. The same thing happens when I upload the page to the testing server. The page that sends the variables is just a normal form with field names (Email, Market, FirstName, uid). I'm confident that the referring page isn't the problem since I can't get the results page (this page) to work even in Live Data View with variable directly inputed.

The page code is below:

Code: Select all

<?php require_once('Connections/AEinput.php'); ?>
<?php
$colname2_rsBySessVar = "%";
if (isset($HTTP_POST_VARS['LastName'])) {
  $colname2_rsBySessVar = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['LastName'] : addslashes($HTTP_POST_VARS['LastName']);
}
$colname3_rsBySessVar = "%";
if (isset($HTTP_POST_VARS['Market'])) {
  $colname3_rsBySessVar = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['Market'] : addslashes($HTTP_POST_VARS['Market']);
}
$colname4_rsBySessVar = "%";
if (isset($HTTP_POST_VARS['Email'])) {
  $colname4_rsBySessVar = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['Email'] : addslashes($HTTP_POST_VARS['Email']);
}
$colname_rsBySessVar = "%";
if (isset($HTTP_SESSION_VARS['AEid'])) {
  $colname_rsBySessVar = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['AEid'] : addslashes($HTTP_SESSION_VARS['AEid']);
}
mysql_select_db($database_AEinput, $AEinput);
$query_rsBySessVar = sprintf("SELECT * FROM AEinput WHERE uid = '%s' AND LastName = '%s' AND MarketCity = '%s' AND Email = '%s'", $colname_rsBySessVar,$colname2_rsBySessVar,$colname3_rsBySessVar,$colname4_rsBySessVar);
$rsBySessVar = mysql_query($query_rsBySessVar, $AEinput) or die(mysql_error());
$row_rsBySessVar = mysql_fetch_assoc($rsBySessVar);
$totalRows_rsBySessVar = mysql_num_rows($rsBySessVar);
?>
 
 
 
 
 
 
 
 
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
 
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
 
<body>
<table width="642" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr> 
    <td width="642" height="314" valign="top"><p><strong><font face="Geneva, Arial, Helvetica, sans-serif">Personal 
        info for user id: <?php echo $row_rsBySessVar['uid']; ?>. (<?php echo $row_rsBySessVar['LastName']; ?>,&nbsp;<?php echo $row_rsBySessVar['FirstName']; ?>)&nbsp;&nbsp; 
        <input name="Submit2" type="submit" onClick="MM_popupMsg('If this table is blank the most likely cause is that the wrong user credentials were entered on the previous screen.  Close this message and click your browser\'s back button and enter your information again.  For help, call Watt Productions at (646) 688-4078.')" value="Don't See Your Info?">
        </font></strong></p>
      <table width="633" height="270" border="3" cellpadding="1" cellspacing="1">
        <tr> 
          <td width="122" height="23" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">First 
            Name</font></strong></td>
          <td width="130" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Last 
            Name</font></strong></td>
          <td width="177" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Job 
            Title</font></strong></td>
          <td width="177" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Market</font></strong></td>
        </tr>
        <tr> 
          <td height="35" bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['FirstName']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['LastName']; ?></td>
          <td bgcolor="#FFFFFF"><font face="Geneva, Arial, Helvetica, sans-serif">&nbsp;<?php echo $row_rsBySessVar['JobTitle']; ?></font></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['MarketCity']; ?></td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Phone 
            #</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Fax 
            #</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Email 
            Address</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Station 
            Owner</font></strong></td>
        </tr>
        <tr> 
          <td height="41" bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Phone']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Fax']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Email']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['StationOwner']; ?></td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Address 
            1</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Address 
            2</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">City</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">State</font></strong></td>
        </tr>
        <tr> 
          <td height="46" bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Address1']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Address2']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['City']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['State']; ?></td>
        </tr>
        <tr> 
          <td height="23" bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Zip</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Avg. 
            Billing</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Ambassador</font></strong></td>
          <td bgcolor="#CCCCCC"><strong><font face="Geneva, Arial, Helvetica, sans-serif">Participant 
            Since</font></strong></td>
        </tr>
        <tr> 
          <td height="41" bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['Zip']; ?></td>
          <td bgcolor="#FFFFFF"><?php echo $row_rsBySessVar['CurrentBilling']; ?></td>
          <td bgcolor="#FFFFFF"><font face="Geneva, Arial, Helvetica, sans-serif">&nbsp;<?php echo $row_rsBySessVar['Ambassador']; ?></font></td>
          <td bgcolor="#FFFFFF"><font face="Geneva, Arial, Helvetica, sans-serif">&nbsp;<?php echo $row_rsBySessVar['timestamp']; ?></font></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="32" align="center" valign="middle"><form action="modify_records_user.php" method="post" name="form1">
        <input name="SecretWord" type="hidden" id="SecretWord" value="<?php echo $row_rsBySessVar['SecretWord']; ?>">
        <input name="Email" type="hidden" id="Email" value="<?php echo $row_rsBySessVar['Email']; ?>">
        <input type="submit" name="Submit" value="Update My Info">
      </form></td>
  </tr>
  <tr> 
    <td height="1"></td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsBySessVar);
?>
I'm seriously about to pull my hair out... please HELP!