Jump to content

SmokingMan

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by SmokingMan

  1. I'm new to PHP also, that's why I asked
  2. I have tried using java script: <script language="javascript" type="text/javascript"> document.onload = function(){ document.getElementById('content').style.display='block'; } </script> <noscript>This page requires JavaScript to be enabled. Please enable it in your browsers settings.</noscript> <div id="content" style="display:none"> ... html </div> ...but with mixed results, and none that I liked. That's why I thought I'd see if PHP would do the trick for me. I need for people to have javascript enabled for all of the features to work. If they have javascript disabled, I want to re-direct them to a page to tell them they need to enable javascript. But I wasn't sure if PHP had the capability to check the user's browser settings and re=direct depending on the results.
  3. Can you use PHP to check a user's browser settings to see if javascript has been enabled, and then use a re-direct to another page if they have javascript disabled? I've looked over tutorials and on the PHP.net site and can't find any reference to this.
  4. I wanted to use the "onmouseover" and "onmouseoff" events to open a popup and close it. It works, but much to slowly. I was wondering if I put an image on the page and set the display property to "none" to hide it, would I be able to use the mouse events to change the style to "inline" to display it when the mouse triggers the event? And if so, would I need to set the "z-index" to be sure it displays on top of whatever part of the page it's on?
  5. SmokingMan

    Array question

    I want to teach myself to write a page at load from an array. That way all the would need to be changed would be the array entries. This would probably be better using an SQL database, but I want to learn this way first. I thought it would be a good excercise.What I want to write is a menu with the item, description, and price. I'm trying to figure out the best way to set up an array with this information. The best way I seem to be able to figure this out right now would be this: <?php $menu = array ( "first_item"=>array "first_item", "first_item_description", "first_item_price" ), "second_item"=>array ( "second_item", "second_item_description", "second_item_price" ), ); ?> ...and so on.Is this the best way to write a multi-dimensional array, or is there a better way? If my thinking is right, and that's always subject to interpretation , I would use a loop to go through each array using "echo" statements to write the code for each menu item. I know there's probably a better way to do this, but right now I want to learn how to do this using the data from an array. This is just an excercise, hopefully not in futility
  6. Thanks, I'm learning this in my spare time at home and sometimes the tutorials don't go into the depth I would like. So I'll probably have my fair share of stoopid questions for a while until I get a little more comfortable with PHP
  7. As I strive to learn PHP, I see two operators used in assigning values to arrays. They are "=" and "=>". I can't seem to find any explanation as to the differences between them and when one or the other should be used. Can someone clear this up for me?I know this is probably VERY simple, but to a newbie to PHP like myself...not so much.
  8. Thanks for the help. I only have a couple of hours on the weekends to try to work this. I appreciate the help.
  9. I'm new to PHP and am learning it at home in my spare time. In declaing variables the book gives three formats that can be used. The third one being deprecated "$HTTP_POST_VARS['variable']". The other two are $variable and $_POST['variable'].Does it matter which form is used, or does that depend on the version of PHP being run? The book says the short form requires the register_globals configuration to be on. Is this a default setting or would I need to check with the hosting service as to whether or not this setting is on or not. Or is this something I need not worry about?I'm very new at this so please be patient
  10. I'll have to ditto hand coding. I used to use FrontPage just for an ftp client. But I soon found HTML-Kit which I find very useful. It has plug-ins to help automate some of the coding, but it's still all done by hand. It also has ftp capabilities so you can upload your pages and is a free download. It's always better to do something right from the start without the easy shortcuts offered by programs such as FrontPage. You know it's done right and it's easier for someone to maintain down the road if you are no longer doing it. Of course that's as long as they're able to read code and haven't relied on FrontPage to do their coding
  11. I first learn about W3C when I first started to get interested in learning HTML. Someone on some long forgotten forum suggested W3C schools for the tutorials....and well.....the rest is history
  12. SmokingMan

    PHP4 vs PHP5

    I'm learning PHP on my own at home using an older (but free) book using PHP4. I was wondering if there are any major differences in the two versions. The book I'm using is"PHP and MySQL Web Development" by Luke Welling and Laura Thompson. It seems to be well written and it walks you through the examples and scripts so they are easy to understand. I was just curious as to what the differences in the two versions were.
  13. I stand corrected. I wrote that after about two hours of writing code, staring at my monitor, and my third glass of Sangria. I meant multiple lines on the title, and what the limitations on the title are as far as length goes. I'll check out the link, and try to stay away from the wine after looking at a monitor for too long.
  14. I have a title in an image attribute that is too long to display completely. Is there a way to force a line break in a tool tip so it can span two or three lines? Waht are the limitations on the length of a "title" attribute?Inquiring minds want to know
  15. I tried every variation I could think of. The padding I wanted for IE worked, but the rest of the style for that element is lost for all three browsers. There has to be a way other than using a script to check for what browser is being used and loading the appropriate stylesheet, isn't there?Here's the page: click here.Here's the CSS: .order-heading{ font-family: 'Trebuchet MS',Verdana,Tahoma,Arial,'Arial Black',Helvetica,'Century Gothic','Lucida Sans Unicode',Impact,sans-serif; text-align: center; font-weight: 800; color: #660000; font-size: 16px; text-decoration: none; width: 100%; } .order-instructions{ font-family: 'Comic Sans MS','Monotype Corsiva',cursive; font-style: italic; font-weight: 400; font-size: 13px; color: #660066; text-align: justify; text-decoration: none; margin: auto; width: 90%; } The "order-heading" class is where I want to add "padding-bottom: 15px;" for IE only. FF & Opera render this just fine.
  16. My formatting renders fine in Opera and FF, but not in IE 7 (surprise, surprise, surprise). I need to add some padding for IE only. I know there's a way to hide styles from everything but IE using something like "if ie" in the stylesheet. But I can't remember the syntax and how to use it. I don't need the padding for any browser other than IE, so I want the line "padding-bottom: 10px;" line to only be picked up by IE and ignored by everyone else. Can someone please refresh my memory on this? I've tried to search the forum, but I can't find anything.
  17. I have some links where the ":hover" doesn't work. It works with the links at the top of the page, but not with the links that return to the top of the page. All of these links are within the page. Here's the page: store menu.And here's the CSS: stylesheet.The only problem is with the "return to top" links. They display fine, they just don't change on hover.
  18. You might want to try moving the 'a:hover' below the 'a:visited'. Check out the W3C tutorial on this page.Hope this helps.
  19. I guess what it comes down to is; do you just want to get the pages done, or do you also want to actually be able to understand what you've done in the "rare" case that you may have to debug a problem. In my opinion, you should at least be able to grasp the basics of HTML & CSS.
  20. Where these WYSIWYG editors make it easier to put together a page, if you're concerned about standards (as everyone should be), the only way to be sure your code is standards compliant is to learn HTML & CSS. It's not hard to do. Also, it's always good to at least have a grasp of how HTML & CSS work together. W3C has very easy to follow tutorials that will at least get you familiar with basic coding. I use HTML-Kit for authoring my pages. It's a free download and a good program to use, but you need to be somewhat familiar with HTML & CSS. I would urge you to at least try to work through a few tutorials.
  21. I know the problem has to be somewhere in my CSS (I think). The block elements in the menu display as wanted in FF & IE, but they don't even come close in Opera. I'm sure there's a problem with the margins or floats, but I can't seem to pick it out. Here's a link to the page in question: click meAnd here's my CSS: .menu-category{ font-family: Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: italic; font-weight: bold; font-size: 16px; line-height: 23px; color: #330066; text-align: center; } /* id's for the in menu links */ #menu-cat1{} #menu-cat2{} #menu-cat3{} #menu-cat4{} #menu-cat5{} #menu-cat6{} #menu-cat7{} .menu-item{ font-family: 'Trebuchet MS',Verdana,Tahoma,Arial,'Arial Black',Helvetica,'Century Gothic','Lucida Sans Unicode',Impact,sans-serif; color: #000000; font-weight: bold; font-size: 13px; line-height: 18px; width: 260px; text-align: left; font-style: italic; margin-left: 25px; float: left; } .menu-item-size{ font-family: 'Trebuchet MS',Verdana,Tahoma,Arial,'Arial Black',Helvetica,'Century Gothic','Lucida Sans Unicode',Impact,sans-serif; color: #000000; font-weight: bold; font-size: 13px; line-height: 18px; width: 100px; margin-left: 10px; text-align: left; font-style: italic; float: left; } .item-price{ font-family:Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: italic; font-weight:bold; font-size: 13px; line-height: 16px; color: #000000; width: 60px; text-align: left; float: right; padding-right: 15px; } .item-description{ font-family:'Comic Sans MS','Monotype Corsiva',cursive; font-style: italic; font-size: 12px; color: #8b0000; width: 440px; text-align: left; padding-left: 15px; margin-left: 15px; clear: both; float: left; overflow: auto; } .cat-description{ font-family: 'Trebuchet MS',Verdana,Tahoma,Arial,'Arial Black',Helvetica,'Century Gothic','Lucida Sans Unicode',Impact,sans-serif; font-style: italic; font-size: 13px; color: #8b0000; width: 500px; text-align: center; margin-left: 35px; } #menu-links{ text-align: center; } .menulink-head{ font-family: Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: italic; font-weight: bold; font-size: 16px; color: #000000; text-decoration: none; } .menupage-link{ font-family: Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: normal; font-size: 12px; color: #660000; text-decoration: none; } #menu-links a:hover{ color: #ff0000; font-style: bold; text-decoration: underline; } .menu-return{ font-family: serif; font-size: 11px; color: #ff0000; text-decoration: none; margin-left: 5px; clear: both; } .menu-return a:hover{ font-weight: bold; text-decoration:underline; } Any ideas?
  22. Okay, I know this is basic stuff, but I seem to be having a mad cow moment. I am trying to link to locations on the same page, and have the links change styles on hover. The return to top link changes style but does nothing when clicked, and the links at the top don't change on hover and also do nothing. I've looked at the code and CSS and just can't figure out what's wrong here. I know it's something simple and will probably smack myself in the head when it's pointed out to me. But can someone look at the code and tell me where I've went wrong?XHTML: <div class= "menu-links" name="menu-links"> <div class= "menulink-head">Link To Menu Category</div> <a class= "menupage-link" href= "#menu-cat1" title= "Hot Dogs & Chili Buns">Hot Dogs & Chili Buns </a> <a class= "menupage-link" href= "#menu-cat2" title= "Nachos, Salads, & Soups"> Nachos, Salads, & Soups </a> </div> <div class="menu-category"><span name="menu-cat1">Hot Dogs & Chili Buns</span> </div> <div class= "cat-description"> <span>All hot dogs and chili buns come with mustard and onions. Ketchup and mayonnaise available upon request.</span></div> <div> <div class="menu-item"><span>Plain Hot Dog .....................................................................</span></div> <div class="item-price"><span>#1.50</span></div> </div> <div> <div class="menu-item"><span>Chili Bun ...........................................................................</span></div> <div class="item-price"><span>$1.75</span></div> </div> <div> <div class="menu-item"><span>Chili Dog ...........................................................................</span></div> <div class="item-price"><span>$2.00</span></div> </div> <div> <div class="menu-item"><span>Chili, Cheese ......................................................................</span></div> <div class="item-price"><span>$2.25</span></div> </div> <div> <div class="menu-item"><span>Chili, Cheese, & Peppers ........................................................</span></div> <div class="item-price"><span>$2.50</span></div> </div> <div> <div class="menu-item"><span>Chili, Cheese, & Slaw ............................................................</span></div> <div class="item-price"><span>$2.50</span></div> </div> <div> <div class="menu-item"><span>Chili, Cheese, Peppers, & Slaw ................................................</span></div> <div class="item-price"><span>$2.75</span></div> </div> <div> <div class="menu-item"><span>Fiesta Dog .........................................................................</span></div> <div class="item-price"><span>$2.00</span></div> </div> <div> <div class="menu-item"><span>Pizza Dog ..........................................................................</span></div> <div class="item-price"><span>$2.00</span></div> </div> <div> <div class="menu-item"><span>Polish Dog ..........................................................................</span></div> <div class="item-price"><span>$2.35</span></div> </div> <div> <div class="menu-item"><span>Quarter Pound Beef Dog .........................................................</span></div> <div class="item-price"><span>$2.50</span></div> </div> <div class= "menu-return"> <a class= "menu-return" href= "#menu-links" title= "Return to top">Return to top</a> </div> <div class="menu-category"> <span name="menu-cat2">Nachos, Salads, & Soups</span></div> <div class="cat-description"> <span>All Nachos include chili & cheese. All Nacho salads include chili, cheese, lettuce, tomato, onion, & salsa. Sour cream & peppers are extra.</span></div> CSS: .menu-links{ text-align: center; } .menulink-head{ font-family: Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: italic; font-weight: bold; font-size: 16px; color: #000000; text-decoration: none; } .menupage-link{ font-family: Georgia,'Bookman Old Style',Garamond,'Times New Roman',serif; font-style: normal; font-size: 12px; color: #660000; text-decoration: none; } .menupage-link a:hover{ color: #ff3399; font-style: italic; text-decoration: underline; } .menu-return{ font-family: serif; font-size: 11px; color: #ff0000; text-decoration: none; margin-left: 5px; clear: both; } .menu-return a:hover{ font-weight: bold; text-decoration:underline; } Here's a link to the page in question: http://site-test1.hotdog-hut.com/menu.php
  23. I think I have a headache. I code everything using XHTML Strict. I've never thought about this before, but for some reason I had this burning need to know. Thanks
×
×
  • Create New...