Jump to content

Nicholas

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by Nicholas

  1. First I'll need to understand variable variables... The example on that page seems as if you could achieve the same thing with .= . Can someone explain further these lines: At this point two variables have been defined and stored in the PHP symbol tree: $a with contents "hello" and $hello with contents "world". Therefore, this statement: <?php echo "$a ${$a}"; ?> produces the exact same output as: <?php echo "$a $hello"; ?> i.e. they both produce: hello world. ------------------------------------------------------- I don't want seperate variables... Would echoing $a give "hello world"?
  2. Well it seems there are errors in the code. After enabling all errors, and the having them displayed... error_reporting(E_ALL); ini_set('display_errors','On'); $num = 1; do { if (isset($_POST["event.$num"])) { $accept.$num = $_POST["event.$num"]; $id.$num = $_POST["hidden.$num"]; $num++; $set = true; } else { $max = $num; $set = false; } } while($set); guestLogin($username,$password); for($num = 1;$num <= $max; $num++) { if ($accept.$num == 'accept') { // Line 100 $query = "UPDATE calendar07 SET accept = '1' WHERE id='" . $id.$num . "'"; $result = mysql_query($query); if ($result) { print 'Calendar updated for event id ' . $id.$num . '. The event is ' . $accept.$num . 'ed.'; } } }
  3. jesirose: If there aren't any apparent code errors, I guess there isn't a problem. I just assumed that this wouldn't work as I coded it as pseudo-code, not expecting it to actually be correct.
  4. Thanks for the quick response. And good eye on the =/== bit. Technically, what I posted was exactly the area that you need to see. But I'll trim it down for clarity... Better? case 'pendCalendar': // Get all the calendar events that haven't been accepted yet, and display them ... <form action="admin.php?action=updateCalendar" method="post"> ... // Connect to the database etc... // The fun part: looping through the results $num = 1; while($fetch = mysql_fetch_assoc($query)) { <input name="hidden_' . $num . '" type="hidden" value="' . $fetch['id'] . '> // Notice: hidden_$num will be dynamic <td style="padding: 5px;" valign="top"> <select name="event_' . $num . '"> // Again, a dynamic name <option value="accept">Accept Event</option> <option value="deny">Refuse Event</option> </select> } break; case 'updateCalendar': $num = 1; do { if (isset($_POST["event.$num"])) { $accept.$num = $_POST["event.$num"]; $id.$num = $_POST["hidden.$num"]; $num++; $set = 'true'; } else { $max = $num; $set = 'false'; } } while($set='true'); break;
  5. I it possible to have variables concatenated together? For instance, in a loop you've got something like this: $variable = "multipleSomethings"; for($num=1;$num<=10;$num++) { $variable.$num = "multipleSomethings" . $num; } echo $variable1; // "multipleSomethings1" echo $variable2; // "multipleSomethings2" See what I'm saying? Now try to understand my code. case 'pendCalendar': // Get all the calendar events that haven't been accepted yet, and display them print '<div class="para">' . '<h1>Pending Calendar Additions</h1>' . 'The following are requests from coaches which have not yet been approved.<br />' . 'Please check the information for accuracy, and then decide whether or not to accept the request.<br />' . '<strong>Be sure to check whether there are existing events that might cause a confliction.</strong><br /><br />' . '<form action="admin.php?action=updateCalendar" method="post">' . '<table cellpadding="0" cellspacing="0" style="border: 1px solid #666;" width="100%">' . '<tr>' . '<td style="background: #999; padding: 3px;" width="25%"><strong>Event Date:</strong></td>' . '<td style="background: #999; padding: 3px;" width="20%"><strong>Event Location:</strong></td>' . '<td style="background: #999; padding: 3px;" width="30%"><strong>Event Description:</strong></td>' . '<td style="background: #999; padding: 3px;" width="25%"><strong>Accept?</strong></td>' . '</tr>'; guestLogin($username,$password); $query = mysql_query( "SELECT * FROM calendar07 WHERE accept='0' " ); $num = 1; while($fetch = mysql_fetch_assoc($query)) { print '<input name="hidden_' . $num . '" type="hidden" value="' . $fetch['id'] . '>'; print '<tr>' . '<td style="padding: 5px;" valign="top">' . $fetch['month'] . ' ' . $fetch['day'] . ': ' . $fetch['time'] . '</td>' . '<td style="padding: 5px;" valign="top">Field ' . $fetch['field'] . '</td>' . '<td style="padding: 5px;" valign="top"><em>Requested by: </em>' . $fetch['leader'] . '<br />' . '<em>Brief Summary: </em>' . $fetch['desc'] . '</td>' . '<td style="padding: 5px;" valign="top"><select name="event_' . $num . '">' . '<option value="accept">Accept Event</option>' . '<option value="deny">Refuse Event</option>' . '</select>' . '</td>' . '</tr>'; } print '<tr>' . '<td colspan="4" style="text-align: right;"><input type="submit" value="Submit" /></td>' . '</tr>' . '</table>'; break; case 'updateCalendar': $num = 1; do { if (isset($_POST["event.$num"])) { $accept.$num = $_POST["event.$num"]; $id.$num = $_POST["hidden.$num"]; $num++; $set = 'true'; } else { $max = $num; $set = 'false'; } } while($set='true'); break;
  6. No problem. It was never a necessity for the site, just perhaps easier for the user.
  7. I guess I'll just stick with the drop down menus then...
  8. Mind pointing me in the direction of a few?
  9. Wondering if this is possible. I've highlighted an example below: [img]http://img152.imageshack.us/img152/179/untitled12ll.png[/img] [size=8pt](Thanks to ImageShack for [URL=http://imageshack.us]Free Image Hosting[/URL])[/size] I want to achieve this in a HTML form. I'll be using it for time as well, but not specific enough to require seconds. I'd need this setup: HH:MM AM/PM. Though AM/PM could be chosen through a drop-down... Just wondered if it's possible, or if I would be better off just allowing text to be entered. Thanks for the help.
  10. I've got close to 30 or so photos on my site, and I'd like them to be displayed in sets of 10, with a "Previous" and "Next" link allowing progress backward or forward through the pictures. You've all seen it, but can you help me to do it? Here's what I have: [quote]             # -------------------------------------------------             #  photography page content             # -------------------------------------------------             case 'photography-s':               print '<div align="left">' . "\n";               connect($error, $type); [color=red]# CONNECT TO THE DATABASE[/color]               print '<h1>my photography (<a href="http://hobbes.cjb.cc/art.php?page=photography-s">standard</a> | <a href="http://hobbes.cjb.cc/art.php?page=photography-p">panoramic</a>)</h1><br/>' . "\n";               print '<table cellpadding="0" cellspacing="0" width="100%">' . "\n" .                             $_SESSION['end'] = "10"; [color=red]# SET WHAT VALUE WE NEED TO END AT [/color]               $start = ($_SESSION['end'] - 9); [color=red]# AND WHAT WE START AT[/color]               $end = $_SESSION['end']; [color=red]# SIMPLER FORM...[/color]               $open = '<a href="#" onClick="MyWindow=window.open(\'';  [color=red]######################[/color]               $mid = "','MyWindow','scrollbars=yes,";                              [color=red]## THESE ARE "SHORTCUTS"[/color]               $close = "'); return false;\">";                                          [color=red]## IF YOU WILL[/color]               $img = '<img class="img" border="0" src="';                      [color=red]######################[/color]                             for ($id=$start;$id++;$id<=$end) { [color=red]# SET UP A FOR LOOP TO GET THE DESIRED RANGE OF ID'S[/color]                   $result = mysql_query("SELECT title, thumb, image, description, height, width FROM art_photo WHERE id ='" . ($id) . "'"); [color=red]# QUERY THE DATABASE FOR THE SPECIFIC ID'S[/color]                   $photos = mysql_fetch_assoc($result); [color=red]# AND PLACE THAT INTO THE ARRAY "PHOTOS"[/color]                   print $photos; [color=red]# A TEST...[/color]                 print '  <tr>' . "\n" .                         '      <td height="120" width="160">' . "\n"; [color=red]# THE FOLLOWING COUPLE OF LINES SET UP THE CELLS CONTAINING THE PHOTOS AND DESCRIPTIONS[/color]                 print          $open . $photos["image"] . $mid . 'width=' . $photos["width"] . ',height=' . $photos["height"] . ',left=105,top=120' . $close . $img . $photos["thumb"] . '" alt="' . $photos["title"] . '" title="' . $photos["title"] . '"/></a></td>' . "\n" .                         '      <td>' . "\n" .                                   $photos['desc'] . "\n" .                         '      </td>' . "\n" .                         '  </tr>' . "\n";                 }                 print '  <tr>' . "\n" .                         '      <td style="text-align: left;"><a href="http://hobbes.cjb.cc/art.php?page=photography-s"></td>' . "\n" . [color=red]# REWIND THE START ID[/color]                         '      <td style="text-align: right;"><a href="http://hobbes.cjb.cc/art.php?page=photography-s"></td>' . "\n" . [color=red]# ADVANCE THE START ID[/color]                         '  </tr>' . "\n" .                         '</table>' . "\n";             break; [/quote] Any help is greatly appreciated.
  11. Sorry if I came across rudely. Meant no harm. You were trying to help me!
  12. The current combination of username and password is set to "test" for both, so I don't know why it would be affected differently... But you are indeed correct, works like a charm now. Thanks so much thorpe. ;D @ Crayon: read my code. I've printed both the variables entered and from the file, and checked them against each other.
  13. When the user accesses index.php?action=login, $username and $password variables are defined through a form: [code] case 'login':                         print '<div class="para">' .                                 '<h1>Please enter your username and password.</h1><br/>' .                                 '<form action="http://www.ucjrd.com/index.php?action=redirect" method="post">' .                                 '<table cellspacing="2" cellpadding="0" width="300">' .                                 '  <tr>' .                                 '      <td><strong>Username:</strong></td>' .                                 '      <td><input type="text" size="12" maxlength="12" name="username" style="textbox">' .                                 '  </tr>' .                                 '  <tr>' .                                 '      <td><strong>Password:</strong></td>' .                                 '      <td><input type="password" size="12" maxlength="12" name="password" style="textbox">' .                                 '  </tr>' .                                 '  <tr>' .                                 '      <td colspan="2" style="text-align: right;"><input type="submit" value="submit"></td>' .                                 '  </tr>' .                                 '</table>' .                                 '</form>' .                                 '</div>';                         break;                       case 'redirect':                         $username = $_POST['username'];                         $password = $_POST['password'];                         admin($username,$password);                         break; [/code] Then the stored username and password are retrieved from a file and compared to the user's... [code] function admin($user,$pass) {         $filename = "******.txt";         $file = fopen($filename,"r");         $set_user = fgets($file);         $set_pass = fgets($file);         fclose($file);         if ($user == $set_user && $pass == $set_pass) {           $_SESSION['logged_in'] = "true";           print '<div class="para">' .                   '<h1>Login Successful</h1><br/>' .                   'Thank you for logging in. <a href="http://www.ucjrd.com/index.php?action=edit">Please click here to continue.</a>' .                   '</div>';         } else {           $_SESSION['logged_in'] = "false";           print '<div class="para">' .                        '<h1>Login Error</h1><br/>';                   print $_SESSION['logged_in'] . '<br/>';                   if ($user == $set_user) {                     print 'Usernames are the same<br/>';                   } else {                     print 'Usernames are not the same<br/>';                   }                   if ($pass == $set_pass) {                     print 'Passwords are the same<br/>';                   } else {                     print 'Passwords are not the same<br/>';                   }           print "Existing: $set_user and $set_pass<br/>" .                   "Entered: $user and $pass<br/><br/>" .                   'There was an error when checking your username and password. <a href="http://www.ucjrd.com/index.php?action=login">Please review your username and password.</a>' .                   '</div>';         } [/code] Yet this yields the error message. As you can see, I've done a bit of debugging to narrow down my problems. The password is checked properly, and rings true when it is and false when it isn't. The username on the other hand, is always considered wrong. Am I missing something? Can anyone help me fix this annoying comparison issue? Thanks so much.  ;D
  14. [quote author=akitchin link=topic=99174.msg401016#msg401016 date=1153461573] to make the nav links extend the width of their containing cell, all you have to do is change their tags to: [code]<a href="blah" style="display: block;">[/code] they will then span the width of their container.  i tried this with web developer toolbar's edit HTML function, so i know it works. i'll add some comments too, since i took the time to look at the site.  nothing stands out at me as being bad.  i like the colours, the simplicity, and the clean lines.  nicely done.  RCT is addicting, i'll add. [/quote] AWESOME, thanks so much. 448191, I'll play around with gradients in Photoshop. If I like it, I'll add it. Thanks for looking and commenting, everyone.
  15. [url=http://hobbes.cjb.cc]hobbes.cjb.cc[/url] Sorry to bump, but I've finished the design of the site. Most of the content is also finished. I've addressed two of the three points you've made, though the third (regarding extending the clickable area of the navigation bars all the way to the right) is relatively impossible. I have a transparent pixel stretching to size, and it has to be the same size for each link. because it uses the padding attribute of css, the maximum distance is decided by the link with the most characters. this happens to be the ziehen.deviantart.com link. because of this link, the rest of the links must also have the same padding on their right sides. because they're all shorter than that link, however, you get space on the far right that isn't clickable because it isn't covered by the transparent image. hopefully that made sense. my coding/design practices may be a bit unusual. i'd appreciate your comments, though. the layout was a concept i threw together in photoshop which somehow became a reality. it's my most technically advanced website, though it may not appear as such. the main file is over 400 lines, and growing constantly as i add more content. it uses PHP extensively, as a mediator between pages and to repeat tedious actions. i'm proud of the programming side of things. content wise, it has the most information i've ever given in a personal website. i have 3 pages describing some of my major hobbies, four pages within the art catagory, and then four more pages within the rct catagory. i encourage you to check out my photography, as that's the section i'm most proud of and have spent the most time updating. the rct section will hopefully grow with time, but i suppose that depends on how much i improve with each passing park/design. anyway, thanks so much for viewing. comments/criticisms welcome
  16. [url=http://hobbes.cjb.cc/valcrt]hobbes.cjb.cc[/url] Well, it has been awhile since I've posted here but I'm continuing to learn and develop my knowledge of programming languages. The site uses PHP for nearly everything, including global $_GET variables for those neat little URLs and case/switch functions to distribute the appropriate page throughout the site. I'm still adding content, but I have alot of photos on there as well as some information about myself. I'd appreciate your comments about the site, good or bad, as well as help getting the left panel to stay aligned to the top of the cell... I can't figure out why it isn't, as I've put in valign's all over the code... :-\ Thanks for looking.:)
  17. Thanks for you're help. I won't have the chance to play with this though, so I just put up all the content for now. When I get the opportunity, I'll have to review your code to understand what you're doing. Thanks again though.
  18. Depending on the page... [quote]Warning: Missing argument 1 for frontpage() in /home/nick/public_html/practice/content.php on line 37 *  Line 37:      function frontpage($day) {[/quote] [quote]Warning: Missing argument 1 for schedule() in /home/nick/public_html/practice/content.php on line 110 *  Line 110:      function schedule($day) {[/quote] For one, the variable isn't being passed through the function. For two, the if statements aren't working properly to make the decision as to which statement is true.
  19. I'm having trouble with the date function of PHP. I'm trying to have my script recognize what day it is so that different content can be displayed automatically. I won't be able to check/update the page manually soon, so I want the script to do it for me. I simply set up a variable ($day) that takes the numerical day of the month (date("j");). I then used if statements to check the different scenarios I have layed out, and put in the different content for those scenarios. But to no avail... [code]     $day = date("j");     function frontpage($day) {           navigation();           if ($day == 2) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Monday, July 3rd at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Plyometric jumps, Pro agility run (12x), 150 pushups, 200 abs</li>' .                 '</ul>';           }           if ($day == 4) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Wednesday, July 5th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Funnel run, 15 minutes of touches, leg workout, 150 pushups, 200 abs</li>' .                 '</ul>';           }           if ($day == 6) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Friday, July 7th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> 30/30 Fartlek run for 15 minutes</li>' .                 '</ul>';           }           if ($day == 9) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Monday, July 10th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Plyometric jumps, speed/accelleration (C), 150 pushups, 200 abs</li>' .                 '</ul>';           }           if ($day == 11) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Wednesday, July 12th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Speed/accelleration (B), leg workout, 25 minutes of touches, 150 pushups, 200 abs</li>' .                 '</ul>';           }           if ($day == 13) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>No practice for Friday, July 14th</strong></li>' .                 '</ul>';           }           if ($day == 16) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Monday, July 17th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Plyometric jumps, speed/accelleration (A), 25 minutes of touches, 150 pushups, 200 abs</li>' .                 '</ul>';           }           if ($day == 18) {                            print '<h1>Next Practice:</h1>' .                 '<ul>' .                 '  <li><strong>When:</strong> Wednesday, July 19th at 9:00 AM</li>' .                 '  <li><strong>Where:</strong> Marysville High School Track</li>' .                 '  <li><strong>What to Bring:</strong> Flats, cleats, ball, water, etc</li>' .                 '  <li><strong>Exercises:</strong> Funnel run, leg workout, 30 minutes of touches, 150 pushups, 200 abs</li>' .                 '</ul>';           }     }         function schedule($day) {           navigation();           if ($day >= 25 && $day <= 1) {           print '<h1>This week\'s schedule is as follows:</h1>' .                 '<h2>Sunday, June 25</h2>' .                 '<ul>' .                 '  <li>40/20 Fartlek for 15 minutes</li>' .                 '  <li>20 minutes of touches on the ball</li>' .                 '  <li>150 pushups, 200 abs</li>' .                 '</ul>' .                 '<h2>Monday, June 26</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At MHS fields 6:00 PM to 7:30 PM</li>' .                 '  <li>25 minute run</li>' .                 '</ul>' .                 '<h2>Tuesday, June 27</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> Open field with Delaware and Dublin Coffman at Dublin Coffman from 6:00 PM - 8:00 PM</li>' .                 '  <li>Meet at the high school at 5:30 to car pool.</li>' .                 '</ul>' .                 '<h2>Wednesday, June 28</h2>' .                 '<ul>' .                 '  <li>25 minute run</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '  <li>Leg workout</li>' .                 '</ul>' .                 '<h2>Thursday, June 29</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At MHS fields 6:00 PM to 7:30 PM</li>' .                 '  <li>Funnel Run</li>' .                 '  <li>Pro Agility (12x)</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>' .                 '<h2>Friday, June 30</h2>' .                 '<ul>' .                 '  <li>25 minute run</li>' .                 '  <li>Plyometric jumps</li>' .                 '</ul>' .                 '<h2>Saturday, July 1</h2>' .                 '<ul>' .                 '  <li>2 mile run (timed)</li>' .                 '  <li>Email results of run to Kirsch: <a href="mailto:mksoccer4@yahoo.com">mksoccer4@yahoo.com</a></li>' .                 '  <li>Practice with a friend</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>';           }           if ($day >= 2 && $day <= 8) {           print '<h1>This week\'s schedule is as follows:</h1>' .                 '<h2>Sunday, July 2</h2>' .                 '<ul>' .                 '  <li>Run for 30 minutes</li>' .                 '  <li>20 minutes of touches on the ball</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>' .                 '<h2>Monday, July 3</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At MHS fields 6:00 PM to 7:30 PM</li>' .                 '  <li>Plyometric Jumps</li>' .                 '  <li>Pro Agility Run (12x)</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>' .                 '<h2>Tuesday, July 4</h2>' .                 '<ul>' .                 '  <li>Off. Go do something!</li>' .                 '</ul>' .                 '<h2>Wednesday, July 5</h2>' .                 '<ul>' .                 '  <li>Funnel Run</li>' .                 '  <li>15 minutes of touches on the ball</li>' .                 '  <li>Leg workout</li>' .                 '  <li>150 pushups, 200 abs</li>' .                 '</ul>' .                 '<h2>Thursday, July 7</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At Delaware. Meet at 5:30 PM at MHS to carpool</li>' .                 '  <li>Performance Run</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>' .                 '<h2>Friday, July 8</h2>' .                 '<ul>' .                 '  <li>30/30 Fartlek run for 15 minutes</li>' .                 '</ul>' .                 '<h2>Saturday, July 1</h2>' .                 '<ul>' .                 '  <li>2 mile run (timed)</li>' .                 '  <li>Email results of run to Kirsch: <a href="mailto:mksoccer4@yahoo.com">mksoccer4@yahoo.com</a></li>' .                 '  <li>Practice with a friend</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>';           }           if ($day >= 9 && $day <= 15) {           print '<h1>This week\'s schedule is as follows:</h1>' .                 '<h2>Sunday, July 9</h2>' .                 '<ul>' .                 '  <li>Run for 30 minutes</li>' .                 '  <li>25 minutes of touches on the ball</li>' .                 '  <li>150 pushups, 200 abs</li>' .                 '</ul>' .                 '<h2>Monday, July 10</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At MHS fields from 6:00 PM to 7:30 PM</li>' .                 '  <li>Plyometric Jumps</li>' .                 '  <li>Speed/Accelleration (C)</li>' .                 '  <li>150 pushups, 200 abs</li>' .                 '</ul>' .                 '<h2>Tuesday, July 11</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> With Delaware and Dublin Coffman, at MHS fields from 6:00 PM to 8:00 PM</li>' .                 '</ul>' .                 '<h2>Wednesday, July 12</h2>' .                 '<ul>' .                 '  <li>Speed/Accelleration (B)</li>' .                 '  <li>25 minutes of touches on the ball</li>' .                 '  <li>Leg workout</li>' .                 '  <li>150 pushups, 200 abs</li>' .                 '</ul>' .                 '<h2>Thursday, July 13</h2>' .                 '<ul>' .                 '  <li><strong>Open Fields:</strong> At MHS fields from 6:00 PM to 7:30 PM</li>' .                 '  <li>Plyometric jumps</li>' .                 '  <li>150 pushups, 150 abs</li>' .                 '</ul>' .                 '<h2>Friday, July 14</h2>' .                 '<ul>' .                 '  <li><strong>Varsity Camp (invite only): </strong>Meet at MHS from 6:00 PM to 8:00 PM. <font color="#CC0000"><strong>($25 fee)</strong></font></li>' .                 '</ul>' .                 '<h2>Saturday, July 15</h2>' .                 '<ul>' .                 '  <li><strong>Varsity Camp (invite only): </strong>Meet at MHS from 6:00 PM to 8:00 PM</li>' .                 '</ul>';           }     } [/code[ Please help! ??? Thanks all.  :) [/code]
  20. Alright, here is a visual explanation of my problem: [img src=\"http://img142.imageshack.us/img142/9921/untitled26mw.png\" border=\"0\" alt=\"IPB Image\" /]
  21. Alright, I've done that but the error still exists. My page is valid XHTML 1.0 Transitional, but Firefox still pushes the buttons out of their cells. Yesideez, I'll try to get an image of what I'm referring to up later tonight, I have a soccer game to official right now. Thanks for the help though, both of you.
  22. First off, I'm not positive that this is a PHP related issue, but I believe it is based on a key observation. When echoing a string of HTML, when one ends a line within a cell, the code automatically adds a space of some sort. I'm not sure why this is, but it may be the result of outlining code. The tabs are, for whatever reason, being picked up in the final result and causing unwanted gaps. The subnavigation (links saying "Web Site Design, Atheletics, and Photography") [a href=\"http://hobbes.cjb.cc/interests.php\" target=\"_blank\"]on this page[/a] have the aformentioned spaces to the left hand side of the cell when viewed in Internet Explorer. There also appears to be a space on the top of the cell when viewed in Firefox (more on this later). The code for these is as follows: [code] function subnav() {           global $page;           $background = 'background: #533A1D url(\'./images/bg_light.png\'); color: #FFF; font-weight: bold; height: 30px;';           $separator = '<img src="./images/sep.png" alt="">';           # i'm skipping a bit of code that doesn't apply here...           if ($page == 'interests') { // Sub-navigation used on the "interests" page                echo '    <tr>';                echo '         <td style="' . $background . ' padding-left: 15px;" width="100%">';                echo '              <a href="interests.php#webdesign" id="subnav">Web Site Design</a>' . $separator;                echo '              <a href="interests.php#athletics" id="subnav">Athletics</a>' . $separator;                echo '              <a href="art.php#photography" id="subnav">Photography</a>';                echo '         </td>';                         } }[/code] As you can probably see (well, hopefully, I'm not sure anyone follows my coding logic;) ), there is quite a bit of tabing there, but no spaces. Be sure to note that each echo is ended where the code would be naturally ended in HTML. In otherwords, where there would normally be a Return / Escape character, I've ended the echo. On a different page, I tried something different to see if my theory was correct: as it turns out, it was (sort of, anyway). The result of the following code can be seen [a href=\"http://hobbes.cjb.cc/interests.php\" target=\"_blank\"]on this page[/a]. [code] function subnav() {           global $page;           $background = 'background: #533A1D url(\'./images/bg_light.png\'); color: #FFF; font-weight: bold; height: 30px;';           $separator = '<img src="./images/sep.png" alt="">';           # i'm skipping a bit of code that doesn't apply here...           if ($page == 'art') { // Sub-navigation used on the "art" page                echo '    <tr>';                echo '         <td style="' . $background . ' padding-left: 15px;" width="100%">';                echo '              <a href="interests.php#graphics" id="subnav">Graphic Design</a>' . $separator .                                      '<a href="interests.php#3d" id="subnav">3-Dimensional</a>' . $separator .                                        '<a href="art.php#photography" id="subnav">Photography</a>' . $separator .                                      '<a href="http://ziehen.deviantart.com" id="subnav">ziehen.deviantart.com</a>';                echo '         </td>';           } }[/code] Note that these two code segments are within the same function, I haven't defined it twice. I just put the same couple of lines at the top of each to ensure easier reading. Also note that there is only one echo for the links, rather than the multiple echos used previously. As can be seen on the page, there is no space to the left of the cell. Interesting, no? Apparently, either the tabing used to outline the code or the echo statements themselves are adding space to the HTML returned through the server. When viewing the page source, all that can be seen between the links is spaces, which are the result of the tabs. Generally, such spaces aren't interpreted by the browser... right?:confused: While this problem doesn't make much sense to me, it doesn't bother me too much either. The simple and hassle-free solution is just to use one echo statement rather than ending each line and beginning anew. My real question is, where is the space on top coming from? There isn't any space when viewing using Internet Explorer, but in Firefox there is a definate space between the top of the cell and the link held within it. Also interesting: this space doesn't cause overlap, it actually pushes the link outside the cell. I know this type of "layering" can be done using specific CSS x or y coordinates, but I wasn't aware that something would just go outside its border without expanding the entire holding cell. To explain myself in better detail, I have a CSS id which is as follows: [code]     a#subnav {           background: #533A1D url('./images/bg_light.png');           color: #CCCCCC;           font-weight: bold;           height: 30px;           padding: 8px 8px 5px 8px;           text-decoration: none;      }           a#subnav:hover {           background: #40260D url('./images/bg_dark.png');           color: #CC0000;      }[/code] As such, in the code, the links using this id are larger than normal, the padding applied to them makes them more of a button. The hover simply changes the color so a user can see the "button". I find this CSS to be very helpful, as rollover images can be very time consuming to set up properly. So now that you know how my sub-navigation works, can anyone tell me why Firefox adds a space to the top, then pushes the link outside its cell? Thank you to anyone who helps, I really appreciate it.:)
  23. Calvin and Hobbes are liscensed, yes, and I obviously do not have permission to use them. They are my favorite comic, however, and I've always included an image from them on my websites. I don't see any problems with it, as I'm not claiming it as my own nor profiting from the image in any way besides that it is aesthetically pleasing. If Ucomics asks me to take it down, I will do so willingly. But if anything, the only thing my header image could do is interest people in Calvin and Hobbes as you've reminded me to link the image to the Calvin and Hobbes main site, as I usually do. And I doubt that Ucomics is one of the 150 hits I've recieved (which is much less, as my counter is does not count by unique visitors). Thanks for the comment about my graphics, by the way. --------- I'm unsure of whether or not to create a new topic, but I'll post here and a mod can split this if need be. I have a question though, regarding the use of PHP's [b]case/switch[/b]. I would like to have my images on my art page link to something like this: [a href=\"http://hobbes.cjb.cc/art.php?id=hot_air_balloon\" target=\"_blank\"]http://hobbes.cjb.cc/art.php?id=hot_air_balloon[/a] I know this is achieved through the use of $_GET variables and the switch function, but I have no idea where to start with these, and the topics/tutorials I've found are far too vague for me to understand. Would someone be willing to guide me through achieving this effect?
  24. Thank you both for the replies! mark, the "Best viewed with Firefox" is, in my opinion, necessary because using IE results in the navigation working awkwardly. I've used CSS to change the position of the background image, but IE can't refresh the image fast enough (I guess...), so a white block is shown before the over-image shows. As for the PHP Powered bit, it's kind of ironic because all I've used PHP for is includes and the counter. I'm still working on learning the language, so eventually the site will deserve that statement. And I'll work on improving content. I use my xanga to communicate with my friends, for the most part, so this site is mostly for myself or online friends who share my interests in web design or gaming. The Calvin and Hobbes image above the navigatioin, however, will probably stay. I do see your point about it pushing everything down, and from a web developer's point of view, that can be a major problem, but from an artistic view, I think the size is perfect. I wish there was some way to have both the size of the image and still have room for the content, but my design's narrowness makes this nearly impossible. mike, I'll definately consider adding descriptions of the art to the page, perhaps having the images open in a window with restricted size that allows for both the image and a description to show, then also offers the option of viewing the image full-size. As I mentioned above, I'm still working on the content, though this is more of a hobby site than a personal site, if that makes sense. Again, thank you both for the comments! If anyone else has anything to add, I would appreciate your posts as well. :)
  25. [b][a href=\"http://hobbes.cjb.cc\" target=\"_blank\"]hobbes.cjb.cc[/a][/b] I've had this site for awhile, though I recently re-designed the appearance. I find the combination of narrow width, vibant colors, and smooth images to create a generally pleasent look, and I believe the site is rather "elegant," if you will. I encourage your criticisms, not only on the site's design, but also on any content that you may find interesting. There's several pieces of my artwork from school available to look at, as well as some parks from RollerCoaster Tycoon 2, and other such items that interest me. Thanks for your comments. :)
×
×
  • 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.