Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Location

himynameismark's Achievements


Newbie (1/7)



  1. Wow, such a simple fix was giving me a massive headache! Thanks for that explanation. I didn't even think to add z-index to the footer... Apparently the padding on the main div once it was long enough to where I had to scroll to see the full footer made it overlap the footer, rendering my links unclickable.
  2. Yeah, I forgot about that warning. Since posting this here, I have changed the span tags to div tags. Have you tried to hover over all the links and make sure they work? At first glance, everything seems to work fine. I just tested in FF, IE9, Safari, and Opera. Somehow IE9 was the only browser it worked in. If it comes down to it, I may have to post how I actually have the codes set up (with my PHP include and functions). I took out the dimension styles on my CSS, and in the <textarea> element, switched the cols attribute to "62" and rows is still "". When I put a number in rows, the links break. When I leave rows blank, the links work. When I have height and width declared in my CSS, the links break.
  3. I have validated both my HTML and CSS. My HTML passes with no warnings or errors. When I validate my formStyle.css file as CSS3, the only errors are vendor extensions for the border-radius (for older Mozilla and Webkit based browsers). My style.css file validates as CSS3, with only warnings stating that the color and background color are the same in multiple parts, like when I have the blue background behind the header navigation and the blue footer with white text, and a white background for the rest of the page. I have figured out that removing any type of dimensions from the textarea in the form stylesheet seems to do the trick, but it looks hideous when I do that. I tried correcting that by inputting values for rows and cols in the HTML. I have them as rows="" cols="" currently, as they are required attributes according to the HTML validator. When I do this, it has the same effect as having dimensions set in the CSS file. Leaving it as default rows and cols just looks ugly... Any idea why adding dimensions would mess up footer navigation? If I insert links directly in the content div, they work. Any links in my footer div fail with this though.
  4. Hi. I have a website using a PHP require_once template that I created myself. I required the template file in my head, and it has functions to include the header, top navigation, and footer (which includes a smaller navigation menu as well). The whole website works like a charm, except for the footer navigation on the contact page. It works perfectly fine on all other pages, as well as when I comment out the textarea on the form. I have been studying and experimenting with HTML and CSS for some time now, and have never run into this problem. If I put a link immediately after the submit button, it works fine. But the navigation in the footer is rendered as text rather than links when my form has the textarea. Here is my HTML, pulled from View Source so as to show what each PHP function is doing, rather than having to post the PHP template file as well: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><!-- Title --><title>Brink Roofing Division</title> <!-- Meta Information --><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><meta name="author" content="Mark" /> <!-- Stylesheets --><link rel="stylesheet" type="text/css" href="css/style.css" /><link rel="stylesheet" type="text/css" href="css/formStyle.css" /> <!-- !IE7 Fix --> <!--[if !IE7]> <style type="text/css"> #container { display: table; height: 100%; } </style> <![endif]--></head><body><div id="container"> <div id="header"> <div class="content"> <a href='index.php'><img src='images/brinklogo.jpg' alt='Brink General Contractors' /></a> <ul id='header_nav' class='menu'> <li><a href='index.php'>Home</a></li> <li><a href='about.php'>About</a></li> <li><a href='services.php'>Services</a></li> <li><span class='current_page'>Contact</span></li> </ul> </div> </div> <div id="main"> <div class="content"> <!-- Form --> <form method="post" action=""> <!-- Name --> <div class="line"> <div class="label"> <label for="name"> Name: </label> </div> <div class="input"> <input type="text" id="name" name="name" tabindex="1" /> </div> </div> <!-- E-Mail --> <div class="line"> <div class="label"> <label for="email"> E-Mail: </label> </div> <div class="input"> <input type="text" id="email" name="email" tabindex="2" /> </div> </div> <!-- Subject --> <div class="line"> <div class="label"> <label for="subject"> Subject: </label> </div> <div class="input"> <input type="text" id="subject" name="subject" tabindex="3" /> </div> </div> <!-- Message --> <div class="line"> <div class="label"> <label for="message"> Message: </label> </div> <div class="input"> <textarea id="message" name="message" tabindex="4"></textarea> </div> </div> <!-- Submit --> <div class="line"> <div id="submit"> <input type="submit" id="send" name="send" tabindex="5" value="Send" /> </div> </div> </form> </div> </div></div> <div id="footer"> <div class="content"> <span class='left'>© Brink General Contractors <br />Website by Mark Little</span> <span class='right'> <ul id='bottom_nav' class='menu'> <li><a href='index.php'>Home</a></li> <li>|</li> <li><a href='about.php'>About</a></li> <li>|</li> <li><a href='services.php'>Services</a></li> <li>|</li> <li><a href='contact.php'>Contact</a></li> </ul> </span> </div></div></body></html> And my main CSS file: @charset "UTF-8";*{ margin: 0; padding: 0;} html, body{ margin: 0; padding: 0; height: 100%; background-color: #ffffff; font-family: Tahoma, sans-serif;}/* Div */#container{ position: relative; display: block; margin: 0 auto; min-height: 100%; width: 100%;} #header{ position: relative; display: block; margin: 0 0 -136px 0; height: 136px; border-bottom: 2px solid #0c71b7; background-color: #ffffff; z-index: 2;} #main{ position: relative; display: block; padding: 150px 0 80px 0; z-index: 1;} #footer{ position: relative; display: block; margin: -60px auto 0; height: 60px; width: 100%; background-color: #0c71b7;} .content{ position: relative; display: block; margin: 0 auto; width: 970px; overflow: auto; padding: 0 5px; height: 100%;} #footer .content div { position: relative; display: inline-block; width: 250px; height: auto; margin: 10px 0 0 0; } #footer .left { float: left; } #footer .right { float: right; } /* Navigation */ul.menu{ position: relative; display: inline; margin: 0; padding: 0; float: right; list-style-type: none;} ul.menu li{ position: relative; display: inline; margin: 0 5px 0 0; padding: 0; float: left;} ul.menu li:last-child{ margin: 0;} ul.menu li a{ position: relative; display: block; margin: 0; padding: 0; width: 100%; text-decoration: none; color: black;} /* Header Nav */ul#header_nav { position: absolute; bottom: 0; right: 5px; } ul#header_nav li, ul#header_nav li a, ul#header_nav li span { width: 100px; background-color: #0c71b7; border-top-right-radius: 5px; border-top-left-radius: 5px; } ul#header_nav li span { display: block; background-color: #000000; } img{ border: none;} /* Text */ul#header_nav li, ul#header_nav li a, ul#header_nav span{ text-align: center; text-decoration: none; color: #ffffff; font-weight: bold;} #footer, #footer a{ font-size: 12px; color: #ffffff;} #footer a:hover{ text-decoration: underline;} And my form CSS file: @charset "UTF-8";form{ position: relative; display: inline; float: left; width: 490px; height: auto;}/* Div */.line{ position: relative; display: block; width: 490px; height: auto; overflow: auto; margin: 0; padding: 15px 0 0 0;} .line:first-child{ padding: 0;} .line .label{ position: relative; display: inline; margin: 0; padding: 0; width: 60px; height: auto; float: left; clear: left; text-align: right;} .line .input{ position: relative; display: inline; margin: 0; padding: 0 0 0 10px; width: 420px; height: auto; float: left; clear: right;}/* Input */input[type="text"]{ position: relative; display: block; width: 200px; height: 20px; border: solid 2px #0c71b7; border-radius: 5px; -moz-border-radius: 5px;} textarea{ position: relative; display: block; min-width: 400px; max-width: 400px; width: 400px; min-height: 250px; max-height: 250px; height: 250px; border: solid 2px #0c71b7; border-radius: 5px; -moz-border-radius: 5px;} /* Text */label{ font-size: 14px;} input[type="text"], textarea{ font-size: 12px; font-family: Tahoma, Geneva, "sans-serif"; padding: 3px 5px 3px 5px;} input[type="text"]:focus, textarea:focus{ border: solid 2px #999999;} input[type="submit"]{ position: relative; display: block; width: 90px; height: 30px; float: right; margin: 0 5px 0 0; font-weight: bold; background-color: #0c71b7; color: #ffffff; border: 1px solid #0c71b7; border-radius: 5px; -moz-border-radius: 5px;} input[type="submit"]:hover{ background-color: #000000;} input[type="submit"]:active{ background-color: #999999;} Any help would be greatly appreciated! I have tried putting a line break after the textarea. That was the only kind of answer I found on Google. I have also tried to put the form in a fieldset, thinking that may work. Nothing seems to work except for eliminating the textarea, which isn't exactly logical. Thanks,Mark
  5. I am working on a blog for a friend's website. Upon testing the database which holds her blog posts (for security issues and whatnot), and dropping random rows from it, I have noticed that the id field does not re-organize itself. The way I will be displaying her posts (5 per page, with previous and next buttons) depends on the id being in order and with no gaps. Is there any way I can put in a script using PHP or MySQL to organize these in case of a row being removed once the blog goes live? Also, I have noticed that I can put in one entry, drop it, and then when I test another one the id starts back at 2. The only way to get it to start at 1 again that I have seen is going into PHPmyAdmin and emptying the table. Thanks,Mark
  6. Nevermind, I figured that out. It's essentially the same thing as $last_artist, but there is also a counter: if ($prevfirstletter != $firstletter) $counter = 1;else $counter++; And then at the end of the while loop, $prevfirstletter == $firstletter; Then I altered the code to change my first starting with each letter to: if ($counter == 1) echo "<tr><td><a name='" . $firstletter . "' />" . $artist . "</td>";else echo "<tr><td>" . $artist . "</td>;
  7. Okay, now I have another question regarding the same page. I know how to find the first letter of each artist, but is there a way that I can find the first instance of the first letter being _? I want the users to be able to browse the list by first letter, so they can click a-z or # and it brings them directly to the top of the list starting with whatever letter they click.
  8. That's very similar to something I had already tried, except I didn't think to add the $last_artist = ''; line above the loop. That works, thank you!
  9. I am working on a website for a company who does Karaoke and they need a song list. I have a sample page of a few songs selected from a sample database I set up. The MySQL and PHP I used organize the artists (removing the word "the" from the artist name), and then the songs when the artist has multiple songs on their list. However, when the artist has multiple entries in the database, I only want their name to appear in the first instance. For example: Adam Ant - Goody Two ShoesThe Beatles - Eleanor Rigby__________ - Hey Jude__________ - The Long and WInding RoadBlondie - Call Meetc. (obviously, this will be much more structured when appearing on the web page) As opposed to: Adam Ant - Goody Two ShoesThe Beatles - Eleanor RIgbyThe Beatles - Hey JudeThe Beatles - The Long and Winding RoadBlondie - Call Meetc. Here is my code as of now: <?php//Link to Database$link = mysql_connect('localhost','root','') or die("Could not connect!");$dblink = mysql_select_db('songlist') or die("Could not find database!"); //Order by Artist and Song, Removing THE from Artist$query = mysql_query("SELECT * FROM songs ORDER BY TRIM(LEADING 'The ' FROM artist), song"); //Start Tableecho "<table>"; //While Loopwhile ($row = mysql_fetch_array($query)) { //Declare Variables $artist = $row['artist']; $song = $row['song']; //Display Song List echo "<tr><td>" . $artist . "</td><td>" . $song . "</td></tr>"; } //End Tableecho "</table>"; //Close Connectionmysql_close($link);?> What should I add to get the desired effect? Thanks in advance,Mark
  10. I am working on coding a blog by hand for a friend (partially because she doesn't like Wordpress, partially because I want to know that I am capable of hand coding an easily-customizable blog). I just finished her login page yesterday, importing her username and password directly into a database using phpMyAdmin. What should I do for security precautions to protect the database from being hacked? I have been trying to find tutorials on MySQL and PHP security, but I'm having trouble finding one that fits my needs as I have never worked with a database on a live website before.Thanks in advanceMark
  11. Thanks! I don't know why I didn't think about that before. I guess I was trying to make it more complicated than it actually is.
  12. I am writing a script to register users for a client's website. I have almost all of the validation done using PHP. I will write some Javascript for it too, to check it before the user submits if he or she has Javascript enabled. However, in the case that the user does not have Javascript enabled, I am trying to write a PHP script to reload the form to show errors.In my form, I have a div over each input selection explaining the error, each with it's own specific id. In my validation, I have an error[] array where each part of the array is a form input. For example, error[firstName]. By default, the error divs are hidden. Is there any way I can go into the CSS using PHP and show the error divs based on which input boxes show errors in the validation script when the form reloads?Thanks,Mark
  13. I am setting up a registration form for a website I am about to start, and in order to help my client with some demographics, I have discussed with him setting up a Birthday field in his form. I know it's possible and not very difficult to do what I'm looking for in Javascript, but I want to know if it's possible to do this in PHP, as I am trying to use as little Javascript as possible.I have it set up as:Birthday: (drop-down select Year) (drop-down select Month) (drop-down select Day)Is it possible to determine how many days to add to the Day select list based on which month the user selects using PHP only to loop a certain amount of years and the days in the month? If not, can I use one PHP file for all three selects and create a variable for the number of days in each month, so when one is selected the number of days will change?For example, all in one file I would have <?php $year = date("Y"); $days_in_month = 0; $day = 1; // Year echo ("<select id='year' name='year'>"); echo ("<option>Year</option>") while ($year >= 1925) { echo ("<option>" . $year . "</option>"); $year--; } echo ("</select>"); //Month echo ("<select id='month' name='month'>"); echo ("<option>Month</option>"); echo ("<option>January</option>"); echo ("<option>February</option>"); echo ("<option>March</option>"); echo ("<option>April</option>"); echo ("<option>May</option>"); echo ("<option>June</option>"); echo ("<option>July</option>"); echo ("<option>August</option>"); echo ("<option>September</option>"); echo ("<option>October</option>"); echo ("<option>November</option>"); echo ("<option>December</option>"); echo ("</select>"); //Day echo ("<select id='day' name='day'>"); if ($days_in_month > 0 && $days_in_month != 28) { while ($day <= $days_in_month) { echo ("<option>" . $day . "</option>"); $day++; } } elseif ($days_in_month > 0 && $days_in_month = 28) { if ($year / 4 = 0 !($year / 100 = 0 && $year / 400 != 0)) $days_in_month = 29; else $days_in_month = 28; while ($day <= $days_in_month) { echo ("<option>" . $day . "</option>"); $day++; } } else echo ("<option>Day</option>"); echo ("</select>");?> Except in the Month select, I will also include the $days_in_month declaration for each month. If this is possible, where exactly would I include that for each month? Even if that is not possible, and I have to resort to Javascript, with the last nested if statement (where I determined whether or not it is leap year), is there a better way to write that code? Or did I get it right? For those who don't know, it's any year that is divisible by 4 but not divisible by 100 UNLESS it is also divisible by 400.Thanks in advance,Mark
  14. That first block of code I posted is in the <head></head> tags. I tried to save it as an external PHP file when I wrote it though, and it failed to bring in my WP stuff for some reason.
  15. I successfully have WordPress on the site that I am currently trying to finish. My whole goal was to display the posts, titles, and dates on my actual page rather than in my WordPress blog. This required two PHP codes. The first one, in the header, looked something like this: <?php // Include Wordpress define('WP_USE_THEMES', false); require('./mdblog/wp-load.php'); query_posts('showposts=5');?> My first question is: Is it impossible to load an external PHP script in the header? If not, how would I do that? Because the script didn't work for me when I had it as external and tried to include it.Now, the second script. <?php if (have_posts() ) : while (have_posts()): the_post(); ?> <!-- Header --> <div class="blogHead"> <!-- Title --> <div class="blogTitle"> <span class="blogTitle"> <?php the_title(); ?> </span> </div> <!-- Date --> <div class="blogDate"> <span class="blogDate"> <?php the_date(); ?> </span> </div> </div> <!-- Content --> <div class="blogContent"> <?php the_content(); ?> </div> <?php endwhile; ?><?php endif; ?> Now, I'm not sure if this code is that important to what I am trying to do. I would like the PHP script to find if there are more posts than the five showing (as defined in the first script), and if there are, I want a button that says "Older Posts" at the top and the bottom of the content box so that a user can click that and it takes them to the next 5 most recent posts, and on and on. Obviously there will also be a "Newer Posts" button enabled once you click the Older Posts button.Also, I think it would be good to have an Archive page with a list of every post by the title, sorted by the date it was posted. I think based on what I have and the little bit I've done with PHP before, I can probably do this pretty easily.
  • Create New...