Jump to content

dauzy

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dauzy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey guys needs some help here, I'm creating a site in php everything is pretty much done but there's only one thing left to be done. I need to make a link display as the active link on the page. Here's an example. Load page....(no links are active or home is active) clink on the contact page in the navigation menu....(that link becomes active and the link button becomes underlined and stays that way until another link is clicked. I was told that this can be done using javascript, but I have no experience with JS so can someone help me get started on this... Thanks... if code is needed just ask. thanks, Dauzy
  2. Sorry about double post >.< Accidentally pressed the "enter" button and some how last post got posted without me knowing.
  3. Hello, I've haven't been a member to this forum for more then 24 hours and I've already got some greatly appreciated help. But, now its the time again for me to ask for help. I used this a resource...my code follows this technique rather closely with some modifications to include a dynamic background change. http://video.about.com/php/How-to-Create-a-PHP-Calendar.htm Scenario: So, I need to make a PHP calendar....Easy enough right...but there one problem. I'm able to make the a "full" calendar but I need to modify the calendar to skip sundays... This means that all Sundays are excluded when making setting table. data. So... the calendar would look like this: July Monday Tuesday Wednesday Thursday Friday Saturday 1 2 3 4 5 7 8 9 10 11 12 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 30 31 Heres the php code that takes care of making the calendar.... //Create a varible directory, which holds information that is taken from the scan() funtion. $directory = scan(); //Variables for the day, month and year $date = time (); $day = date('d', $date); $month = date('m', $date); $year = date('Y', $date); //Finds the first day of the month $first_day = mktime(0,0,0,$month, 1, $year); //Calculates the day of the week that the first day is on $day_of_week = date('D', $first_day); //Sets the the day to a numerical value... Sun = 0...Sat = 6 switch($day_of_week){ case "Sun": $blank = 0; break; case "Mon": $blank = 1; break; case "Tue": $blank = 2; break; case "Wed": $blank = 3; break; case "Thu": $blank = 4; break; case "Fri": $blank = 5; break; case "Sat": $blank = 6; break; } //Calculates the days in the month $days_in_month = cal_days_in_month(0, $month, $year); $day_count = 1; //This while loop creates the blank spaces before the first day of the month. while($blank > 0) { echo "<td></td>"; $blank = $blank-1; $day_count++; } $day_num = 1; //This while loop is used to create a table row and table ddta. while($day_num <= $days_in_month) { //If the $day_num is included in $directory new table data with corresponded .jpg will be used. if(in_array($day_num, $directory)) { $event = "images/_calendar/July/calendar/".$day_num.".jpg"; echo '<td width="145px" height="145px" background="'.$event.'">'.$day_num.'</td>'; $day_num++; $day_count++; } else { //If $day_num is not included in $directory new table data will be displayed with the default.jpg echo '<td width="145px" height="145px" background="images/_calendar/July/calendar/default.jpg">'.$day_num.'</td>'; $day_num++; $day_count++; } //This will ensure table row in the calendar will only have 7 days to it. if($day_count > 7) { echo "</tr><tr>"; $day_count = 1; } } //This will ensure table row in the calendar will only have 7 days to it. while($day_count > 1 && $day_count <= 7) { echo "<td></td>"; $day_count++; } Thanks, Dauzy
  4. Hello, I've haven't been a member to this forum for more then 24 hours and I've already got some greatly appreciated help. But, now its the time again for me to ask for help. I used this a resource...my code follows this technique rather closely with some modifications to include a dynamic background change. http://video.about.com/php/How-to-Create-a-PHP-Calendar.htm Scenario: So, I need to make a PHP calendar....Easy enough right...but there one problem. I'm able to make the a "full" calendar but I need to modify the calendar to skip sundays... This means that all Sundays are excluded when making setting table. data. So... the calendar would look like this: Monday Tuesday Wednesday Thursday Friday Saturday
  5. Thanks Blade....what you told me worked well thank you very much =)!
  6. it echos out <td width="145px" height="145px" background= "<?php $something_real_good; ? >"3</td>
  7. Hello, I'm trying to calendar from a table and have the background change dynamically. The problem that I'm having is that I'm having trouble having the php code echo out a new table with the table data background take in a variable... Here's the code which probably help explain my problem. if(in_array($day_num, $directory)) { $something = "$day_num"; $something_good = ".jpg"; $something_real_good = "images/_calendar/July/calendar/" $good_stuff = $something_real_good.$day_num.$something_good; echo '<td width="145px" height="145px" background="<?php $something_real_good; ? >'.$day_num.'</td>'; <--- this is where i need help. $day_num++; $day_count++; } So when the code does the echo i want it to echo out if $day_num is 3... echo '<td width="145px" height="145px" background="images/_calendar/July/calendar/3.jpg">'.$day_num.'</td>'; and when it goes to the HTML it will bring up that picture in that directory as the background.... Thanks for the help, Dauzy
  8. Sooo I've been trying for hours to make picture dynamically change when needed...The probably I'm having right now is having the <td> take in a php variable in for a background. Heres my code: if(in_array($day_num, $directory)) { $something = "$day_num"; $something_good = ".jpg"; $something_real_good = 'background="images/_calendar/July/calendar/3.jpg"'; $good_stuff = $something_real_good.$day_num.$something_good; echo '<td width="145px" height="145px" <?php $something_real_good; ? >'.$day_num.'</td>'; $day_num++; $day_count++; echo $something_real_good; //echo $good_stuff; //echo $day_num; } else { echo '<td width="145px" height="145px" background="images/_calendar/July/calendar/default.jpg">'.$day_num.'</td>'; $day_num++; $day_count++; }
×
×
  • 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.