Jump to content

Daney11

Members
  • Posts

    301
  • Joined

  • Last visited

    Never

About Daney11

  • Birthday 09/10/1986

Contact Methods

  • MSN
    daney_marshall@hotmail.com
  • Website URL
    http://www.danemarshall.co.uk

Profile Information

  • Gender
    Not Telling
  • Location
    England

Daney11's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Could you post a qucik example when you have a spare 5 minutes please. 100% divs dont go to the end of the broswer. i need to add it into body?
  2. Ok. How would i create the background on my website then? So that the top section of my website will have the white and the 10px of dark grey, then the middle second will have the dark grey, and the bottom part of the website will just be white, and that all the text will go into the dark grey and white underneath? Thanks
  3. Hey guys, Please take a look at the attached image. Im using the below code, and the background.png is the attached image. body { background-image: url(../images/background.png); background-repeat: repeat-x; } #wrapper { width: 1000px; margin: 0 auto 0 auto; } Now the image background works fine, however all the content goes in the dark grey area, and when text overlapses the dark grey area, it goes onto the white area.... I need to know how to create the background so that the dark grey streches with the content, and the white will be below the content... Thanks
  4. If anyone else finds that they dont recieve replys. Goto www.sitepoint.com. They will help you.
  5. I guess this is not possible. Thanks anyways for all your replys.
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <div align="center"> <?php if ((!isset($_GET["Month"])) && (!isset($_GET["Year"]))) { $Month = date("m"); $Year = date("Y"); } else { $Month = $_GET["Month"]; $Year = $_GET["Year"]; } $Timestamp = mktime(0,0,0,$Month,1,$Year); $MonthName = date("F", $Timestamp); ?> <?php echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">"; echo "<tr><td colspan=\"7\" align=\"left\">Calendar Table for $MonthName, $Year</td></tr>"; echo "<tr bgcolor=\"#999999\">"; $daysOfWeek = array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); foreach ($daysOfWeek as $value) { echo "<td align=\"center\"><strong><font color=\"#ffffff\">$value</font></strong></td>"; } echo "</tr>"; $MonthStart = date("w", $Timestamp); if ($MonthStart == 0) { // if the month starts on a Sunday $MonthStart = 7; } $LastDay = date("d", mktime(0,0,0,$Month+1, 0, $Year)); $StartDate = -$MonthStart; for ($k=1;$k<=6;$k++){ //print six rows for six possible weeks echo"<tr>"; for ($j=1;$j<=7;$j++){ //seven columns per row $StartDate++; if($StartDate < $LastDay) { //blank calendar space if($StartDate > 0) { echo"<td>$StartDate</td> \n"; } else { echo"<td bgcolor=\"#eeeeee\"></td> \n"; } } elseif (($StartDate <=1) && ($StartDate >= $LastDay)) { //date goes here if($StartDate >= 0) { echo"<td>$StartDate</td> \n"; } } } echo"</tr>"; } //End Table Row echo "</table>"; ?> <hr width="200"> <form action="cal.php" accept-charset="UNKNOWN" enctype="application/x-www-form-urlencoded" method="GET" > <?php echo "<select name=\"Month\">"; for($m=1;$m<=12;$m++){ $selected = ""; $longDate = date("F", mktime(0,0,0,$m,1,$Year)); if ($Month==$m){ $selected = "selected "; } echo "<option value=\"$m\" $selected>$longDate</option> \n"; } echo "</select>"; echo "<select name=\"Year\">"; $yeartoday = date(Y); $yearplus1 = date(Y)+1; for($y=$yeartoday;$y<=$yearplus1;$y++){ $selected = ""; $longDate = date("Y", mktime(0,0,0,1,1,$y)); if ($Year==$y){ $selected = "selected \n"; } echo "<option value=\"$y\" $selected>$longDate</option> \n"; } echo "</select>"; ?> <input type="submit" value="go"> </form> </div> </body> </html> This works. In your above post you missed $ on for($y=yeartoday;$y<=$yearplus1;$y++){ ... yeartoday
  7. Line 83 $yeartoday = date(Y); $yearplus1 = date(Y)+1; for($y=yeartoday;$y<=$yearplus1;$y++){
  8. Ok then, is this even possible to do
  9. Hey guys. I have this peice of code below which creates numbers from 1-99 for each record in my form. Example: Num Name 1 Dane 2 Milk 3 Shake 4 Pig <select name='squad_number[<?php $i; ?>]' class="input"> <?php for ($a=1; $a<=99; $a++) { if($a<10) { $val="$a"; } else { $val=$a; } echo "<option value='$val'"; if ($val==$Squad_PlayerRow['squad_number']) { echo " selected"; } echo ">$val</option>"; } ?> </select> Once submitted, it updates the database setting the relevant fields to the number selected from the form above. However i need to add error checking to it. If, for example: Example: Num Name 1 Dane 2 Milk 1 Shake 4 Pig You will see "Dane" and "Shake" each have the number "1", and i want that to return an error saying that you can not use the same number twice basically. Im using: if (eregi ('^[[:digit:]]{1,2}$', stripslashes(trim($_POST['squad_number'][$i])))) { $squad_number = $_POST['squad_number'][$i]; } else { $squad_number = FALSE; $errors[] = 'Please enter a correct team number.'; } To check if that value in the select menu is actually a number between 1-99, and this works fine. How would i create a error checking to find wether a number has been used twice. Thanks
  10. If the user.. i.e. Myself, has chosen the same number twice from: <select name='squad_number[<?php $i; ?>]' class="input"> <?php for ($a=0; $a<=99; $a++) { if($a<10) { $val="$a"; } else { $val=$a; } echo "<option value='$val'"; if ($val==$Squad_PlayerRow['squad_number']) { echo " selected"; } echo ">$val</option>"; } ?> </select> Num: Name: 1 Dane 2 Milk 3 Cow 1 Pig ^^ Number 1 has been chosen twice, so its wrong. Num: Name: 1 Dane 2 Milk 3 Cow 4 Pig ^^ This would return fine.
  11. There is 1 select box per line in the array. Which is squad_number[$i]. My code works perfectly without error checking. Im just wanting to find a way to check that in the array of squad_number[$i], a same number hasnt been chosen twice...
  12. Basically i have a form with numbers from 0-99. Which is below. <select name='squad_number[<?php $i; ?>]' class="input"> <?php for ($a=0; $a<=99; $a++) { if($a<10) { $val="$a"; } else { $val=$a; } echo "<option value='$val'"; if ($val==$Squad_PlayerRow['squad_number']) { echo " selected"; } echo ">$val</option>"; } ?> </select> And when i click submit it goes to update.php and updates fine without any error checking. However if there are two numbers that are the same in value squad_number[$i] then i want error checking to say that you cannot choose the same number twice. if (eregi ('^[[:digit:]]{1,2}$', stripslashes(trim($_POST['squad_number'][$i])))) { $squad_number = $_POST['squad_number'][$i]; } else { $squad_number = FALSE; $errors[] = 'Please enter a correct team number.'; } if ($_POST['squad_number'][$i] == $_POST['squad_number'][$i]) { $squad_number = FALSE; $errors[] = 'Two players can not have the same number.'; } else { $squad_number = $_POST['squad_number'][$i]; }
  13. Ive got with this aswell if ($_POST['squad_number'][$i] == $_POST['squad_number'][$i]) { $squad_number = FALSE; $errors[] = 'Two players can not have the same number.'; } else { $squad_number = $_POST['squad_number'][$i]; } But it throws up the two players can not error.
×
×
  • 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.