Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Everything posted by only one

  1. $_SESSION_DATA=array(); Is that not your problem? its setting all your sessions to 0.
  2. <form method="post" action="member.php"> <? echo "<select name=\"NickName\">"; echo "<option size =30 selected>Select</option>"; if(mysql_num_rows($approvalQuery)) { while($myrow = mysql_fetch_assoc($approvalQuery)) { echo "<option>$myrow[NickName]</option>"; } } else { echo "<option>No Names Present</option>"; } ?> </td> </tr> </td> <td valign="top" align="left" class="control_panel_td_2"> <input type="submit" value="Approve" name="Approve"> <input type="submit" value="Deny" name="Deny"> </form> </td> <? }else{ echo "No Pending Students"; } ?> </tr> <? //Approves user account activation if(isset($_POST['Approve'])) { mysql_query("UPDATE Profiles SET Status = 'Active' WHERE Status='Approval' AND NickName = '{$_POST['NickName']}'") or die (mysql_error()); } You have to set the $_POST[] array, not the $myrow[] array.
  3. But then it's not going to post the nickname you selected in your dropdown menu, like i said, its not you MySQL query, its your HTML your dropdown menu isn't inside the <form> tags.
  4. I see your problem, your drop down menu isn't inside your form.
  5. Try setting a value on the option, <option value=\"$myrow[NickName]\">$myrow[NickName]</option>
  6. No, instead of $myrow['NickName'] it would be $_POST['NickName'];
  7. Could i also advise something, by simply doing this: $page=$_GET['page'].'.php'; include('connect.php'); Your are really leavaing yourself open, I'd advise setting a file_exists() function in there.. <?php if ( !isset($_GET['page']) ) { header("location: index.php?page=home"); } else { $page = $_GET['page'].'.php'; if(file_exists($page) { include('connect.php'); } else { echo "404"; } } ?>
  8. Javascript is clientside, PHP is server side, AJAX is the only langauge that can communicate with a serverside and clientside langauge, just read a tutorial.
  9. Then it should show an error No, make sure you check your cases, 'c' is completely different too 'C'.
  10. Thanks, they actually aren't globaled but that worked.
  11. Ok, Ill rewrite your code then: <?php //generates a list box to display the rows of available business $findbusinessresult = mysql_query("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < 3") or die(mysql_error()); while($row = mysql_fetch_array($findbusinessresult)) { $option .= "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>"; } ?> <form name="" method="POST" action="businesslondonstage2.php" enctype="text/plain" id="Form1"> </br></br><center><select name="businesslist" size=10>"></center> <option value =""><b><u>Business Types</b></u></option> <?="$option"; ?> </select> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:358px;top:215px;width:75px;height:45px;z-index:1"> <input type="checkbox" id="Checkbox1" name="Checkbox1" value="" style="position:absolute;left:466px;top:232px;z-index:2"> </form>
  12. And your center codes.. echo '<br /><br /><center><select name="businesslist" size=10>"'; echo'<option value =""><b><u>Business Types</b></u></option>'; while($row = mysql_fetch_array($findbusinessresult)) { echo "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>"; } echo '</select></center>';
  13. The session does get set, but it only gets set for 2 pages, on the second it begins too fade, and by the third you are logged out again.
  14. It could be because of your br's </br> should be <br />
  15. Just run two mysql queries. mysql_query("INSERT INTO `fmodels` (`member_id`, `make_id`, `model`, `model_date`, `description`) VALUES ('$memid', '$fm', '$fmod','$today', '$fdes')"); mysql_query("INSERT INTO `table2` (`member_id`, `make_id`, `model`, `model_date`, `description`) VALUES ('$memid', '$fm', '$fmod','$today', '$fdes')");
  16. As in the current url? $_SERVER['REQUEST_URI'] For the current root $_SERVER['PHP_SELF']; check the $_SERVER[] manual on the php website.
  17. Try: <?php if ($_GET['page'] == NULL) { header("location: index.php?page=home"); } else { $page=$_GET['page'].'.php'; include('connect.php'); } ?> or: <?php if (!$_SERVER['QUERY_STRING']) { header("location: index.php?page=home"); } else { $page=$_GET['page'].'.php'; include('connect.php'); } ?>
  18. while($row = mysql_fetch_assoc($result)){ foreach ($row as $key => $val) { print $key . " - ". $val. "<br />"; } }
  19. I'm no expert on RSS or how it works but here are HTML codes for quotation marks: " = " ยด = `
  20. Oops, i made a mistake in the code above <?php while($vairable = array_query()) { $i++ if($i == 3) { echo "<tr>"; $i = 0; } } ?>
  21. You have too disbale the session.bug_compat_42 or session.bug_compat_warn in your php.ini file.
  22. I find it difficult too read you code, try making it a bit more tidy. Here's an example of what you are looking for: <?php while($vairable = array_query()) { $i++ if($i == 3) { echo "<tr>"; } } ?>
  23. You are setting two mysql_quers in variables, so it is not actually running any query: mysql_query("UPDATE userregistration SET IllnessType='Winter Flu', TimeOfIllness='$Date' WHERE CountryID='1'") or die(mysql_error());
  24. No, I'll give you an example: <?php $add1 = "This is the first bit in the variable"; $add1 .= "This will be added to the variable"; //Will output 'This is the first bit in the variableThis will be added to the variable' echo "$add1"; ?>
  25. Don't ask me why it is like it is but when i do it the normal way the cookie doesn't get set.
×
×
  • 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.