
Dane
Members-
Posts
102 -
Joined
-
Last visited
Never
Everything posted by Dane
-
Hey guys, When i go to edit something on my webpage it doesnt come up with the selected nation <?php echo "<select class=\"forminput\" name=\"result_nation\">"; foreach ($location as $key => $value) { echo "<option value=\"$key\""; if ($key==$result_nation) { echo " selected"; } echo ">$value</option>\n"; } echo "</select>"; ?> [code] Thats what im using. My flags.php looks like [code] <?php $location = array( 'uk' => 'United Kingdom', 'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria', 'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola', 'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua And Barbuda', 'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba', 'au' => 'Australia', 'at' => 'Austria', 'aw' => 'Aruba', 'ax' => 'Aland Islands', and im using the foreach ($location as $key => $value) { any ideas why guys? cheers[/code][/code]
-
Sorry for all the posting. Im have changed the coding once again to... <?php $gamequery=mysql_query("SELECT * from `games` WHERE `game_active`='Yes' ORDER BY `game_name` ASC"); ?> <select class="forminput" name="result_game"> <?php while($row_games=mysql_fetch_array($gamequery)){ echo "<option value=\"".$row_games['game_image'].""; if ($row_games['game_image'] == $_POST['result_game']) { echo " selected"; } echo "\">".$row_games['game_name']."</option>\""; } ?> </select> <?php echo $_POST['result_game']; ?> Notice the <?php echo $_POST['result_game']; ?> at the bottom. That is there just to see if they value is posting and it is posting. But after the post the <option>s dissappear.
-
Hey guys. I have this peice of code <select class="forminput" name="result_day"><?php for ($i=1; $i<=31; $i++) { if($i<10) { $val="0$i"; } else { $val=$i; } echo "<option value=\"$val\""; if ($val==$sel_day) echo " selected"; echo ">$val</option>"; } ?></select> But when its submitted and there is an error in my code, the value that was selected doesnt stay the same, its goes back to the current day of the month. Any ideas how i can change this? Thanks
-
try WHERE userID = '$id'
-
Very nice. Im am using 4 yes. I will upgrade hehe. Again thankyou very much for your time.
-
Thanks a lot for your work and time. Im using this on my test server but nothing is outputting.
-
Yes, There are always 4 values to the box. Boxes already have the value yes. And yes GingerRobot, i need to know how and if it can be done mate. Need to be pointed in the right direction. Ok thanks effigy, when you have more time mate Thanks again guys.
-
Each square could have the same numbers.. But each square will have a unique place.. A square can contain 4 4 4 6 So it would need to match up all numbers correctly. But the likely hood 2 squares will fit perfectly in one position is unlikely.. Thanks again
-
Hey guys, Im just wondering wether or not this is actually possible. Say i have numbers. 1 2 3 4 5 6 and i have a square box with the top, right, left and bottom each being a number.... 1 box could be.... 4 3 2 1 another box could be 3 1 2 2 another box could be 2 2 6 6 Can i generate PHP code that will match each other together. For example the box 3 1 2 2 would join to this one 2 2 6 6 to give 3 2 1 2 2 6 2 6 Basically, all numbers must attach to each other correctly. I know its a long shot. If PHP cannot do it do any of you know how to achieve this? Cheers
-
Hey guys, Is it possible to use PHP to make 1 image out of 4 seperate images. So basically 1 image goes on top of another, then another, then another...? If so could anyone point me in the right direction please? Thanks again
-
Ok, so i created the assoc array. <?php $inside = array( 'top'=>4, 'right'=>2, 'bottom'=>3, 'left'=>4 ); $insidea = array( 'top'=>1, 'right'=>2, 'bottom'=>3, 'left'=>1 ); $insideb = array( 'top'=>4, 'right'=>3, 'bottom'=>4, 'left'=>4 ); $insidec = array( 'top'=>2, 'right'=>3, 'bottom'=>1, 'left'=>1 ); ?> How would i get this to output 1 1 1 1 2 2 2 3 3 3 3 4 4 4 4 4 ? Thanks guys
-
how would i then join up the numbers?
-
Hey guys. Is this possible? I have var's of numbers <?php $inside1 = '4'; $inside2 = '2'; $inside3 = '3'; $inside4 = '4'; $inside1a = '1'; $inside2a = '4'; $inside3a = '2'; $inside4a = '1'; $inside1b = '4'; $inside2b = '1'; $inside3b = '1'; $inside4b = '2'; ?> My question is, how can i output those 3 var's so i get a value such as 1,1,1,1,2,2,2,3,4,4,4,4 Im not talking about just echoing in order... But finding the values of each var and matching it next to its equivalent number.... Ill try and explain more if people need more of an explaination. But that should help. Cheers guys
-
This should help you. I just created it in a few minutes so modifiying the colours etc to how you like will work. <style type="text/css"> <!-- .tableoutline { FONT-SIZE: 8pt; COLOR: #000000; FONT-FAMILY: Arial; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; } --> </style> <table width="200" border="0" cellpadding="1" cellspacing="1"> <tr> <td width="40" class="tableoutline" onmouseover='this.style.background="#c3c3c3"; return true' onmouseout='this.style.background="#FFFFFF"; return true'>Prev</td> <td width="20" class="tableoutline" onmouseover='this.style.background="#c3c3c3"; return true' onmouseout='this.style.background="#FFFFFF"; return true'>1</td> <td width="20" class="tableoutline" onmouseover='this.style.background="#c3c3c3"; return true' onmouseout='this.style.background="#FFFFFF"; return true'>2</td> <td width="20" class="tableoutline" onmouseover='this.style.background="#c3c3c3"; return true' onmouseout='this.style.background="#FFFFFF"; return true'>3</td> <td width="40" class="tableoutline" onmouseover='this.style.background="#c3c3c3"; return true' onmouseout='this.style.background="#FFFFFF"; return true'>Next</td> </tr> </table>
-
<?php $date = date("l F j, Y"); echo $date; ?>
-
Good tutorial on here mate. http://www.phpfreaks.com/tutorials/43/0.php
-
Anything that is going into the database use mysql_real_escape_string Other than that, create checks when submitting data. i.e. if it is a username check for a-zA-Z0-9 only, make sure things like " ; ' etc are not allowed.
-
try $time = mktime(time());
-
[SOLVED] Splitting up textarea forms into different variables
Dane replied to anolan13's topic in PHP Coding Help
Hey, I think i can help. <?php $animal = "monkeys dogs tigers"; $pieces = explode(" ", $animal); echo $pieces[0]; // piece1 echo $pieces[1]; // piece2 ?> Or if they're seperated by commas <?php $animal = "monkeys,dogs,tigers"; $pieces = explode(",", $animal); echo $pieces[0]; // piece1 echo $pieces[1]; // piece2 ?> -
can somebody point out whats wrong with this code?
Dane replied to aosmith's topic in PHP Coding Help
Can you put your code in the [code] tags please. Have you tried echoing out the querys? To see what is going wrong and where?[/code] -
[SOLVED] Sorry for all my posts, but I need help again!
Dane replied to TimUSA's topic in PHP Coding Help
$nameresult = mysql_query("SELECT `memberName` from `ladder_points` where `raceid` > 0 order by `memberName`; if you're trying to echo them all out of the table. -
<?php $delete_person = $_POST['deletePerson']; foreach($delete_person as $id) { mysql_query("DELETE FROM person WHERE id='$id'"); echo "Deleted Successfully"; } ?> Test that
-
<?php $startdate = mktime(0,0,0,date("m"),date("d")-7,date("Y")); //echo date("Y/m/d", $startdate); $enddate = mktime(0,0,0,date("m"),date("d")+7,date("Y")); //echo date("Y/m/d", $enddate); $now = mktime(0,0,0,date("m"),date("d"),date("Y")); if ($now > $startdate && $now < $enddate) { echo ("STUFF"); } else { echo ("LAMO"); } ?> Try this
-
works for me <table width=100%> <tr onmouseover='this.style.background="yellow"; return true' onmouseout='this.style.background="#c3c3c3"; return true'> <td> cell 1 </td> <td> cell 2 </td> <td> cell 3 </td> <td> cell 4 </td> <td> cell 5 </td> </tr> </table> see were ive put in background="#c3c3c3"; thts were the colour needs to go