Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. var is what you use to declare variables in JavaScript. The "" means: set variable(var) x to an empty string. x = x means: Each time through each loop, variable x will be concatenated with: x + "The number is " + i + "<br>"; In other words, when it's done, x will look like this: "The number is 0<br>The number is 1<br>The number is 2<br>The number is 3<br>The number is 4<br>. When x is then set to the innerHTML of "demo", it will look like this:The number is 0The number is 1The number is 2The number is 3The number is 4
  2. Don E

    hide image url

    Try adding this between $down_file = "http://mysite.com/images/pics/3.jpg"; and header("Content-Disposition: attachment; filename=pic.jpg"); : header('Content-Description: File Transfer');header('Content-Type: image/jpeg'); If still doesn't work, make sure path is correct and/or fopen wrappers have been enabled in the php.ini file.
  3. Not sure why you're getting the warning message but from my understanding that is legal.. Have you tried surrounding the above in parenthesis and see if you get the warning message? if ( ($result = $conn->query($query)) ) Or try: if (($result = $conn->query($query)) != false)
  4. Looks like you have to escape the the single quotes for subcat: echo 'var div = document.getElementById(\'subcat\');';
  5. Don E

    garbage collector

    Yes. There you should find the memory setting that is allowed for a PHP script. Search for: memory_limit
  6. Looks you forgot to assign n to: window.open("default.asp");var n = window.open("default.asp");
  7. window.close() from my understanding only works when you open a new window with window.open(). It will not close the current window not unless it was created/opened from window.open().
  8. Welcome.Some of the issues with DW is what I mentioned above but I guess the main issue would be depending on it to do everything for you, which is in my opinion an issue because you don't have full control over everything and are not learning anything really. Tables in themselves are not out dated, but for designing a layout for a webpage/site, tables are out dated. DIV's are not outdated.
  9. Are you using DW for your site? The HTML and JS above looks like DW. (Dreamweaver)This may or may not be the what's causing the problem, but the lay out for your site is using absolute positioning. What that does is it takes your elements you place on the page and takes them out the "flow" of the page thus why clear: left probably didn't work. When it comes to doing page layout for a site, it is recommended in todays' best practice to avoid using "positioning" as much as you can and use margins, padding, floating etc instead. Positioning is like a last resort. With positioning, you have to precisely tell each element where on the page it will be place as you done, but that's where they'll sit no matter what. So if the user resizes their browser window or something like that, they will remain put and not adjust naturally to the reiszing. This is because you've taken the elements out of the "natural flow" of the page. Tables are also of the past when it comes to layout for a site. Today they're really only used for displaying tabular data.I use Dreamweaver sometimes as well but only in the "cod view". When using it in the design view, it generates the HTML, CSS, JS for you but a lot of this can be what some would considered "bad" generating of code for you. It depends though I would assume on the version of DW you're using and if they updated their code generating to what's considered standard and best practices when it comes to web design/development. Just thought I would put that out there for ya.
  10. From the HTML you posted, there is no closing </div> tag for: <div id="name-topnav-wrap">
  11. Books may not be as good as hands-on tutorials, even though many of them supply exercises, tutorials etc for you, but for me.. it has been books first. The only problem is, you may find out dated books, or books filled with errata but if you find yourself a really good book, you can learn a lot just from one book. The internet courses/tutorials as well can have errors etc as there was/is some in the w3schools. Some may even teach you bad practice. For example, when I learned about setinterval function in JS some time ago online, an internet source demonstrated how to pass parameters for the function to it and that is the way I used it when it came to that but not to long ago in a recent thread Fox(Ingolme) pointed out that method may not work in most/all browsers, and he was right. He recommended a different method posted to the OP by another user. (http://w3schools.invisionzone.com/index.php?showtopic=45116) So all in all, it's whatever floats your boat I guess. But as for the forums.. one can just be a spectator(reader) here and learn more in one place than they would in several or more places. That's why I when it comes to posting, this is the only web dev forum I participate in... but yes.. Google... is an alternative
  12. One way to do it would be to store the image names(like Bluefire_Dragon_Baby.png for example) in a database table instead of the image it self. Then for the page where you need the images, query the database table that has the image names and place them in the src attribute of the img tag along with making sure it points to the directory that has the images; for example /images. Another way would be to store the actual image files in the database.
  13. Posting the HTML part where you think the issue is.
  14. Are you saying when you hover over the button that is suppose to show the drop down menu, that doesn't show.. ? Or.. do you mean when you do that, the whole menu itself disappears? Whole menu as in the drop down part only or the whole menu itself?
  15. Don E

    Contact Form

    It is writing the errors because you need to have the PHP code execute/run after the form has been submitted. For example, just an example: <?php if(isset($_POST['submit'])) //this gets set when the submit button is clicked and the code below runs{ $errors = ''; $myemail = 'example@example.com'; $name = $_POST['name']; $email_address = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; if( empty($name) || empty($email_address) || empty($subject) || empty($message)) { $errors .= "\n Error: all fields are required"; } if (!preg_match( "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email_address)) { $errors .= "\n Error: Invalid email address"; } if(empty($errors)) { $to = $myemail; $email_subject = "ORMT: $subject"; $email_body = "Name: $name\n Email: $email_address\n Message\n $message"; $headers = "From: $myemail\n"; $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); echo "<p>Thank you for your interest, we will be in contact soon.</p>"; } } ?>
  16. Don E

    header ()

    Glad that thescientist brought up the BOM. Lastnight after I left here, it came to mind and was reluctant to get back on and post about that. I had a similar problem with that, with the program I was using It was saving with BOM even though I specifically set it to save without BOM. Finally switching over to another editor and saving properly, it fixed the problem.With DW though, default settings from my understanding save UTF-8 without BOM, but I could be wrong. West, you might want to check the settings in DW.
  17. Hey rcwombat, Instead of having many separate html pages for each product basically, what you can do is insert all your product information into a database via tables within the database. Then on the main product page of your site, you can query the database to get certain information about a product based on what the user clicked on to get information for. All of this can happen on one (same)page without even using ajax actually. Or you can have it set up where you show the product details on a separate page all together, just the details info about the product and even open it in a separate window so that the main product page is still up so that the user can go back to it.This would require you to understand/learn a server side language like PHP and databases, ie MySQL.
  18. Don E

    header ()

    Do you have any HTML output anywhere that is not coming from PHP? For example: <!doctype html><html><head></head><body> <?php if(!empty($name) && !empty($email)) { header(); //this can cause an error because above we have HTML output } else { echo '<p class="error">Please insert all required fields. Click back and try again.</p>'; } ?></body> </html> What is the error displaying now after making changes?
  19. Don E

    header ()

    If you are requiring/including on to your main page and within that included file you're echoing something and then use header() in the main page somewhere down the line, yes you're likely to get that header problem.
  20. Don E

    header ()

    Are you including a page on the main page and on that included page you're echoing something? If so this can cause the error as well. niche is suggesting you post the section of code that you think is giving you the problem; not just the error message
  21. Don E

    header ()

    I see. Also, echoing something before the header() call may result in the headers already sent error as well.
  22. Don E

    header ()

    If you have session_start(); and somewhere down the line a header() on the same page, that is probably the issue.
  23. Don E

    header ()

    From my understanding, including just includes a page(file) into the current page. If you're processing user info for example, checking all is valid and correct, then executing an include file to send the user to the members page, it will from my understanding just include that particular file on the current page(file) and not actually take them to a whole other page.
  24. What's going on here: <td class="mod_bakery_cart_td_quantity_f" id="{ITEM_ID}" $id-xx = id> The if condition doesn't look right.. did you mean something like this: <?php if($id-xx == 39) { ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" readonly="readonly" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <?php }else{ ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a> <?php } ?> Are you working with some kind of template system by any chance?
  25. Don E

    hard drive folder

    Do you have a directory called "pics" with images/files inside it?
×
×
  • Create New...