-
Posts
541 -
Joined
-
Last visited
Posts posted by burnside
-
-
well if the rating is saved in the db why cant you just echo that value out?
-
what is your table like in the db ?
-
actual sorce code is :
Age</td><td width="1%">:</td><td width="9%"><select name="age"><option value=10 (25 == 10 ? 'SELECTED' : '')>10 - 15</option><option value=15 (25 == 15 ? 'SELECTED' : '')>15 - 20</option><option value=20 (25 == 20 ? 'SELECTED' : '')>20 - 25</option><option value=25 (25 == 25 ? 'SELECTED' : '')>25+</option></select> 25</td>
-
added the code but it doesnt refresh the page, get no errors.
the code is
session_start(); if (!isset($_SESSION['refreshed'])) { $_SESSION['refreshed'] = "yes"; $rate = 15; $url = $page; header("refresh: ".$rate."; url=/".$url."/"); }
-
okay i have a bit of code that refreshed the page every so offten, but is it possable for it to refresh only once on that page?
the code is
$rate = 15; $url = $page; header("refresh: ."$rate."; url=/".$url."/");
-
Hey echoed out ".$age." and gives the correct value.
and code
<select name=\"age\"> <option value=\"10\" ($age == 10 ? 'SELECTED' : '')>10 - 15</option> <option value=\"15\" ($age == 15 ? 'SELECTED' : '')>15 - 20</option> <option value=\"20\" ($age == 20 ? 'SELECTED' : '')>20 - 25</option> <option value=\"25\" ($age == 25 ? 'SELECTED' : '')>25+</option> </select>
Dosnt work sorry. Just in case you need age.
$age = 20;
-
what seems to be the proble works fine for me.
-
what is KDE 4 ??? ???
-
thank you. And sorry posted in wrong bored.
-
Hey all.
i have this query :
$get_edit = mysql_query(sprintf("SELECT * FROM `news` ORDER BY id DESC LIMIT 0, 10 ")) or die('Error: ' . mysql_error()); while($edit = mysql_fetch_array($get_edit)) { $edit[msg] = str_replace($words, $faces, $edit['msg']); echo " <br /><br />$space <form action=\"test.php\" method=\"post\"><input type=\"checkbox\" name=\"id\" value=\"".$edit['id']."\"> ".$edit['id']." ";
it works fine i was woundering is there a way if there no records for it to display none or some thing ?
-
yeah age is a int
-
Full file is :
<?php include_once('db.php'); $check = mysql_query("SELECT * FROM members WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) $username = $info['username']; $first_name = $info['first_name']; $email = $info['email']; $last_name = $info['last_name']; $age = $info['age']; echo " <form action=\"update.php\" method=\"post\"> <input type=\"hidden\" name=\"id\" value=\"".$id."\"> <table width=\"25%\"><td width=\"25%\">$space <strong><u>Personal Details</u></strong></td></table> <table width=\"25%\"> <td width=\"15%\">$space First Name</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"first_name\" value=\"".$first_name."\"></td> <tr><td width=\"15%\">$space Last Name</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"last_name\" value=\"".$last_name."\"></td> <tr><td width=\"15%\">$space Email</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"email\" value=\"".$email."\"></td> <tr><td width=\"15%\">$space Age</td><td width=\"1%\">:</td><td width=\"9%\"><select name=\"age\"><option value=\"10\"".($age == '10' ? 'SELECTED' : '')."\">10 - 15</option><option value=\"15\"".($age == '15' ? 'SELECTED' : '')."\">15 - 20</option><option value=\"20\"".($age == '20' ? 'SELECTED' : '')."\">20 - 25</option><option value=\"25\"".($age == '25' ? 'SELECTED' : '')."\">25+ </option></td> <tr><td width=\"15%\">$space Gender</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"checkbox\" name=\"gender\" value=\"male\" checked> Male $space $space $space<input type=\"checkbox\" name=\"gender\" value=\"female\"> Female</td></table> "; ?>
-
This is all the code other than the variables :
<td width=\"15%\">$space First Name</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"first_name\" value=\"".$first_name."\"></td> <tr><td width=\"15%\">$space Last Name</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"last_name\" value=\"".$last_name."\"></td> <tr><td width=\"15%\">$space Email</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"text\" name=\"email\" value=\"".$email."\"></td> <tr><td width=\"15%\">$space Age</td><td width=\"1%\">:</td><td width=\"9%\"><select name=\"age\"><option value=\"10\"".($age == '10' ? 'SELECTED' : '')."\">10 - 15</option><option value=\"15\"".($age == '15' ? 'SELECTED' : '')."\">15 - 20</option><option value=\"20\"".($age == '20' ? 'SELECTED' : '')."\">20 - 25</option><option value=\"25\"".($age == '25' ? 'SELECTED' : '')."\">25+ </option></td> <tr><td width=\"15%\">$space Gender</td><td width=\"1%\">:</td><td width=\"9%\"><input type=\"checkbox\" name=\"gender\" value=\"male\" checked> Male $space $space $space<input type=\"checkbox\" name=\"gender\" value=\"female\"> Female</td></table>
-
Dont work get no errors just doesnt select the correct one
<select name=\"age\"> <option value=\"10\"".($age == '10' ? ' SELECTED' : '')."\">10 - 15</option> <option value=\"15\"".($age == '15' ? ' SELECTED' : '')."\">15 - 20</option> </select>
-
Sorry if this is in the wrong topic. i have a question i have a script
<select name=\"age\"> <option value=\"10\">10 - 15</option> <option value=\"15\">15 - 20</option> </select>
is it possable to keep the value selected that the member has chosen for example :
member is 15 - 20 so form would be :
<select name=\"age\"> <option value=\"10\">10 - 15</option> <option value=\"15\" selected>15 - 20</option> </select>
is there any way to do it from the db if you understand what i am trien to say ???
sorry if i dont make no sence no good at explaning.
-
okay thank you anyway
-
the info bit is took from the db in the query at the start of the script. I am trien to make the script so if some one has the value 'N' in the game_show i can over ride it to 'Y'
-
any one got any other ideas? ? Please
-
$info['security']
is defined in the connect script. The script works atm in a way. it updates the db but in a ASC oe DESC way. so i have to go throught the id 1 2 3 4 etc .... and up date them all instead of the 1 i want id2.
$info['security']
can be in the script or not it still wont work.
-
i have tried several things and cant seem to get it to work, it will update in a desc order but not in a random order
-
did that actually in mysql and it worked. and created a script and it worked. So i have no idea why its not working
-
Now all it does is if i edit id 2 value to "Y" and click update on the up date page is updates the next value say have 4 id 1 2 3 4 it will satart at four then if i click edit on 1 it will do 3 if you understand what im saying.
-
if($_GET[action] == 'update_off' ) { //second level security if($info[security] <= '7' ) { $page_to_view = " Tried to view who has update off. "; echo " <br /><br />$space<span style=\"color: orange\"> <strong>Unable to view this page. Level 7 security or higher required. This action has been logged.<strong></span> "; $sql = "INSERT INTO `logged_1` (`id`, `username`, `player_id`, `page_to_view`, `ip_address`) VALUES ('','" . $info['username'] . "', '" .$info['id']. "', '" . $page_to_view . "', '$info[ip]')"; if ( !$result = mysql_query($sql) ) { die('MySQL Error: ' . mysql_error()); } } else { echo " <form action=\"update.php\" method=\"post\"><br /> <br /> $space This is all game members who have the update messages turned <strong>off</strong>. <br />"; echo " $space <table width=\"50%\"> <td width=\"15%\">$space <u>Username</u></td> <td width=\"10%\"><u>Game Id</u></td> <td width=\"15%\"><u>Action</u></td> <td width=\"15%\"><u>Change</u></td></table>"; $get_on = mysql_query(sprintf("SELECT * FROM `members` WHERE game_show='N' ")) or die('Error: ' . mysql_error()); while($on = mysql_fetch_array($get_on)) { $id = $on['id']; echo " <table width=\"50%\"> <td width=\"15%\"> $space <a href=\"view.php?\">" .$on['username']. "</a></td> <td width=\"10%\">" .$on['id']. "</td><td width=\"15%\">Contact</a></td><td width=\"15%\"><input type=\"hidden\" name=\"id\" value=\" ".$id." \"><input type=\"text\" name=\"game_show\" value=\"".$on['game_show']." \" size=\"1\"> <input type=submit value=update></td></table>"; } echo "<br /><br /> $space <a href=mem.php>Finished</a> "; }
update.php is as followed.
<?php include("connect.php"); $id=$_POST['id']; $game_show=$_POST['game_show']; $query="UPDATE members SET game_show='$game_show' WHERE id='$id'"; mysql_query($query) or die(mysql_error()); echo "Record Updated <a href=mem.php>MEM</a>"; echo " the is you changed was ".$id." "; mysql_close(); ?>
-
variable name id and game_show. i have no idea. you need to see any more of the script of anything? i hast me i can update it but only id DESC or ASC not like any order i want.
PHP Ranking....
in PHP Coding Help
Posted
this ill leave this one to you adam291086 haha