![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
only one
-
Posts
437 -
Joined
-
Last visited
Never
Posts posted by only one
-
-
<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.
-
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.
-
I see your problem, your drop down menu isn't inside your form.
-
Try setting a value on the option, <option value=\"$myrow[NickName]\">$myrow[NickName]</option>
-
No, instead of $myrow['NickName'] it would be $_POST['NickName'];
-
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"; } } ?>
-
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.
-
Then it should show an errorare you connecting to your db; because I do see where your connecting
Same result..
SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < 3
Do you think queries would know what C is or should it be $C ? :S
No, make sure you check your cases, 'c' is completely different too 'C'.
-
You probably should check whether "register_globals" is disabled. If it is enabled, you will have problems when there is a local variable that is named the same as a session variable. For example, with register_globals enabled
<?php session_start(); $user = 'xyz'; $_SESSION['user'] = 'abc'; ?>
You will find that the value of the $user variable will clobbered by the value of the $_SESSION['user'] variable.
Ken
Thanks, they actually aren't globaled but that worked.
-
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>
-
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>';
-
Right, but it isn't possible that that issue is the problem. Because if it is not set, the session doesn't get set, but it should!
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.
-
It could be because of your br's </br> should be
<br />
-
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')");
-
As in the current url?
$_SERVER['REQUEST_URI']
For the current root
$_SERVER['PHP_SELF'];
check the $_SERVER[] manual on the php website.
-
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'); } ?>
-
while($row = mysql_fetch_assoc($result)){
foreach ($row as $key => $val) {
print $key . " - ". $val. "<br />";
}
}
-
I'm no expert on RSS or how it works but here are HTML codes for quotation marks:
" = "
´ = `
-
Oops, i made a mistake in the code above
<?php while($vairable = array_query()) { $i++ if($i == 3) { echo "<tr>"; $i = 0; } } ?>
-
You have too disbale the session.bug_compat_42 or session.bug_compat_warn in your php.ini file.
-
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>"; } } ?>
-
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());
-
When you say extend you mean it ia added to the array of the variable?
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"; ?>
-
I understand that. I just thought the logic was backwards.
Don't ask me why it is like it is but when i do it the normal way the cookie doesn't get set.
Problem with session.php
in PHP Coding Help
Posted
$_SESSION_DATA=array();
Is that not your problem? its setting all your sessions to 0.