Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Don E

    true statement

    It may be because $_POST is a super global array and it's considered 'set' all the time regardless if anything is in it or not. Probably be better to check if something is set inside the $_POST array like: isset($_POST['submit']);You can use the empty function to check if $_POST has anything inside once the form is submitted. function filled_out() // $_POST is global, no need to pass it as a parameter { if (!iempty($_POST)) { return true; }}
  2. Look for recent threads/post made by jimfrog and birbal in regards to that. They are very informative and can give you an idea as to how to get started. Here are a couple:http://w3schools.invisionzone.com/index.php?showtopic=45096 http://w3schools.invisionzone.com/index.php?showtopic=44854This is very helpful as well(thanks to justsomeguy):http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579
  3. Welcome.Try adding the following to the style sheet called: style.css body { background-image: url("http://www.sfntv.com/BackGroundImage.jpg"); background-repeat: repeat-y; padding-bottom: 10px; background-position: center top;}
  4. Because it is an image of a certain width and height and it's background-position is center top. So for the page, actually the body element, it's saying basically to center the image in the body element and place it at the top of the body element. Then repeat it y, which is to repeat it vertically. The content area(s) are set in width using pixels. So when stretch the browser to a bigger size, this too stays in place with the image behind it. This is the image they used. If you notice the black space in the middle, that's where they place the content to sit. To cover that space takes about 950px width. When they created the image, they knew what they wanted the width of the image to be along with the content areas width as well.
  5. Color as in the text that's displayed for the button or the background color? form#styleInput input { background-color: blue; color: white;} <form id="styleInput"> <input type="button" value="this is a styled text button" /> </form> That should do it and works in IE8 too. It also works even when type="submit".
  6. They used one image that's 1480 width and 65 height and positioned it center top and to repeat-y. This was applied to body element. body { background-image: url("images/BackGroundImage.jpg"); background-position: center top; background-repeat: repeat-y; .... } Then they had the centered content area(s) on top of that which equal about 950px width thus showing the mesh holes you see on the sides of the centered content area(s) which I have to say gives it a pretty cool effect.
  7. You can change the <p> elements to buttons: <button type="button">Click to get my index.</button> <div>div element</div> <button type="button">Click me too...<button><br/> <button type="button">And me.</button> It should work. Make sure to declare a Doctype as well for the page. Edit: Same procedure basically works with the way you intended. Just modified a bit: <!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title> <script type='text/javascript'> function indexNum() { var y = document.getElementsByName('button') for(var i = 0; i < y.length; i++) { y[i].indexNumber = i; y[i].onclick = function() {alert(this.indexNumber);}; } } </script></head> <body onload="indexNum();"> <input type="button" name='button' value='button 0'/><br> <input type="button" name='button' value='button 1'/><br> <input type="button" name='button' value='button 2'/><br> <input type="button" name='button' value='button 3'/></body></html>
  8. Change: document.getElementById("a").onclick = alert_two("HelloWorld"); To: document.getElementById("a").onclick = function () {alert_two("hello world");}; That should solve the problem when clicking on the hello world button. It won't alert "hello world" but instead only when clicking on 'Press Me' button as intended. Works in Chrome and FireFox.
  9. Try putting the functions in the head of the document like the following and remove the parenthesis from alert_two() for onclick. What it's doing is, when it reaches that it executes. By removing it, you instead have it set where it will wait til the button is clicked on and then it will run the alert_two() function. <!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title><script type="text/javascript">function show(){ document.write('<button id="a">Press Me</button>'); document.getElementById("a").onclick = alert_two;} function alert_two(){ alert("two");}</script></head> <body><button onclick="show()">HelloWorld</button> </body></html>
  10. Don E

    image sprites

    One thing about sprites is how to get the exact position for that particular image(icon)... Sometimes it can be a task resulting in half an icon to appear sometimes..
  11. Are you getting any errors displayed or checking for errors?Not sure if it's the problem but try to unquote desain and see if you get different results. I don't think its necessary to have the table name in (single)quotes.
  12. JSG, So you're saying when checks are done like the following, it really isn't good practice because of being able to spoof the mime type? if($_FILES["file"]["type"] == 'image/jpeg' || $_FILES["file"]["type"] == 'image/pjpeg' || $_FILES["file"]["type"] == 'image/gif' || $_FILES["file"]["type"] == 'image/png' ) { ....} And instead you only check the extension as it's done like so for example?: $allowedExts = array("jpg", "jpeg", "gif", "png");$extension = end(explode(".", $_FILES["file"]["name"]));if( in_array($extension, $allowedExts) ){ ...} Thanks.
  13. Glad it works. Only reason why I asked if you were using IE is because with some versions, no matter if the image is a progressive jpeg or a regular jpeg, IE returns ''image/pjpeg" for $_FILES["file"]["type"].
  14. Thanks for the input. I'll def consider this.
  15. Something like: SELECT image_names FROM image_table WHERE images_names = 'Bluefire_Dragon_Baby.png' That should select that particular image. To query/select all the images, you can do something like: SELECT image_names FROM image_table The table is called: image_table and within this table there is a column called image_names that contains all the image names. This is just an example.
  16. Hey everyone, The following seems to only work in FireFox but not in other browsers; the font doesn't get styled in others except FireFox. What would be the recommended way or technique to make it work in most/all browsers? <select name="fontType" > <option selected="selected"></option> <option style="font-family:Arial;" value="arial">Arial</option> <option style="font-family:'Comic Sans MS';" value="comic">Comic-Sans</option> <option style="font-family:DejaVu-Sans;" value="dejavu">DejaVu-Sans</option> <option style="font-family:Courier;" value="cour">Courier</option> <option style="font-family:Georgia;" value="georgia">Georgia</option> <option style="font-family:Gothic" value="gothic">Gothic</option> <option style="font-family:Helvetica;" value="helvetica">Helvetica</option> <option style="font-family:Impact;" value="impact">Impact</option> <option style="font-family:Tahoma;" value="tahoma">Tahoma</option> <option style="font-family:'Times New Roman';" value="times">Times New Roman</option> <option style="font-family:'Trebuchet MS';" value="trebuc">Trebuchet</option> <option style="font-family:Verdana;" value="verdana">Verdana</option></select> Thanks.
  17. Try adding to the allowed extensions array "pjpg" or/and "pjpeg" as well as adding to the if statements: $_FILES["file"]["type"] == "image/pjpeg".Just wondering, are you using internet explorer to run the above? If so, what version?
  18. Trying using words with spaces instead and see if you get the same results. Do basically what you did in the other content boxes by using the placeholder text.
  19. I meant maybe why you're not getting any results is because $date is being displayed as 2012, 10 11 when the date column contains dates that display like this instead: 2012-10-11. So try this: $date = date('Y-m-d');
  20. $date = date('Y, m d'); displays as: 2012, 10 11
  21. Don E

    getting the client Ip

    Yes that is why you're seeing that because of developing locally. Try making your server accessible from outside connections, then using another ISP, like a friends or cafe... or your mobile phone if you have one using the carriers connection(not wifi because it may connect to your local home wireless connection if you have one), you should see the actual IP address when using the above.
  22. tnd1000 is using something else, not Dreamweaver if I recall.
  23. No actually, what I have seen is what I showed you according to some JS books/tutorials out there; examples they used. It seems to work fine. Just stating.
  24. Hey Fox, Why is this syntax incorrect: window.onload = function time_func() {I have seen a lot of JavaScript that have something like:window.onload = function init() { alert("Hello"); // just an eample }
×
×
  • Create New...