Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davej

  1. The use of a certificate and forced SSL is the current "gold standard" for protecting net traffic. There are also other guidelines that you should follow. See... http://php.net/manual/en/security.php http://dev.mysql.com/doc/mysql-security-excerpt/5.1/en/ https://www.owasp.org/index.php/Cheat_Sheets#tab=Master_Cheat_Sheet http://stackoverflow.com/questions/85816/how-can-i-force-users-to-access-my-page-over-https-instead-of-http --edit-- The problem with the idea of another "layer" of encryption is that you would not want to give this job to Javascript or any other code that might potentially be modified by an attacker.
  2. Well, you haven't provided your html so it isn't easy to guess what you are doing. The basic idea is to hide or show the slideshow, and you can use media queries to do that, but you'll also need to have the individual images on the page in a vertical arrangement so that they can also be hidden or unhidden. @media screen and (max-width: 640px){ /* CSS to display vertical image collection and hide slideshow div */ } @media screen and (min-width: 641px){ /* CSS to display slideshow div and hide vertical image collection */ }
  3. Well, obviously you fix the first few errors and then see what happens. Line 714 and 719 look bad. Do you see the obvious errors on those lines? Line 819 is also bad. You can't have a css comment extend outside the </style> tag and the comment marks on line 806 would cancel it anyway.
  4. Where can you learn HTML and CSS ? http://www.w3schools.com/html/default.asp http://www.w3schools.com/css/default.asp
  5. Css can be used in three ways... http://www.w3schools.com/css/css_howto.asp ...and if you want to use the same css as the styling for several different html files then of course it makes sense to put that css in a separate file.
  6. See... https://validator.w3.org/nu/?doc=http%3A%2F%2Fpeterborough.fm%2F
  7. I don't think it would be too difficult to accomplish with media queries. If the width is less than some amount simply hide the slideshow div and display all the images.Since the slideshow div is hidden the Javascript click event won't fire.
  8. Typeof can tell you what a variable is, but the closest semi-equivalent is probably JSON.stringify() https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof --edit-- I see that console.log() provides the same functionality (to the console) if you separate its parameters with commas.
  9. i and arr are declared as parameters of the function, so they are declared inside that function... function helper(arr, i) { } And of course 'argument' is a special object that is used only when you need to pass an arbitrary or varying number of parameters to a Javascript function... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FFunctions_and_function_scope%2Farguments
  10. Rather than delete it why not post a brief summary of what you learned?
  11. davej

    <div> visibility

    preventDefault just as you would if the form failed to validate, although that may not even be necessary. http://www.w3schools.com/jsref/event_preventdefault.asp
  12. I don't see $Website being defined. Also a form can be submitted without pressing the submit button. Also you should avoid using a raw $PHP_SELF See... http://www.w3schools.com/php/php_form_validation.asp http://www.w3schools.com/php/func_mail_mail.asp --edit 2/28 10am cdt Oops. I see $Website was commented out.
  13. Okay, but then you have to consider... 1+1+1+1+1+1+1+1+1+1 = 10 ...and really for any positive integer the addends would simply be the set of all smaller positive integers.
  14. davej

    masonry layout

    I don't understand what is so tricky about this. Yes, you would need to allow the photos to find their own height, and you would need to use photos of exactly matching size, but there must be something else I'm not considering?
  15. The trick is that it doesn't really work, because of rounding problems, so cheating is involved.
  16. document.write() is destructive. There are various other methods that are not destructive. For example see .innerHTML.
  17. Well, I would suggest that you try to clean up the problems that the w3c validator complains about... https://validator.w3.org/ I might also suggest that you use 'strict mode' in your code... http://www.w3schools.com/js/js_strict.asp
  18. Why don't you search the web for other people who do this stuff?
  19. Where do you declare i? Are you checking the browser console for any other errors? This example page seems to generate a total... <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>title</title> <style> </style> <script> window.onerror = function(a,b,c){ alert('Javascript Error: '+a+'\nURL: '+b+'\nLine Number: '+c); return true; } </script> <script> 'use strict'; function PrintItem(number,photo,item,price) { var formatprice="$"+price+".00" if(photo===1){ document.write("<tr style='background-color:tan;'>"); } else{ document.write("<tr style='background-color:deepskyblue;'>"); } document.write("<td>"+counter+"</td><td>"+item+"</td><td>"+number+"</td><td align='right'>"+formatprice+"</td>"); if(number>0){ document.write("<td align='right'>Buy:"); } else{ document.write("<td align='right'>Order:"); } counter++; total=total+number; //alert('running total:' + total); } </script> </head> <body> <form action="" method="post" onsubmit="return formCheck(this);"> <input type="hidden" name="Form" value="Papa's Order Form" /> <table width="700" border=4 bgcolor="black" cellpadding=5 cellspacing=0 style="box-shadow: 10px 10px 5px darkslategray;" summary="Main"> <tr><td> <table border=4 width=100% bgcolor="tan" cellpadding=10> <tr><td style="text-align:justify; font-size:16px;">If an item has a tan background, there is a photo associated with that item. To see a photo of any item, click the 'Photos' button in the menu above. I can customize any item I make by woodburning on the item (such as your name or your favorite team) for an additional charge of $2.00 per item. To order any item, enter your personal info below and then enter a quantity in one or more boxes and click 'Submit'. If any item indicates there are none 'On Hand', you can order that item but it will take more time to receive the item since I will have to make it before it is available. If you include a PayPal e-mail address, you are agreeing for me to charge your paypal account and I will send you an invoice via PayPal. If you don't have a PayPal account or want to pay by money order, I will e-mail you an invoice so you can send me a money order (no checks please). If you can pick up the item, you can avoid postage charges. If I have to mail it to you, I will charge exact postage.</td></tr> </table> <table width=100% border=4 bgcolor="deepskyblue" cellpadding=5 cellspacing=0> <tr><td colspan=2>Name:</td><td colspan=3 align="right"><input name="name" size=40></td></tr> <tr><td colspan=2>Address:</td><td colspan=3 align="right"><input name="address" size=40></td></tr> <tr><td colspan=2>City/State:</td><td colspan=3 align="right"><input name="city/state" size=40></td></tr> <tr><td colspan=2>Zip Code:</td><td colspan=3 align="right"><input name="zip" size=40></td></tr> <tr><td colspan=2>Phone:</td><td colspan=3 align="right"><input name="phone" size=40></td></tr> <tr><td colspan=2>E-mail:</td><td colspan=3 align="right"><input name="email" size=40></td></tr> <tr align="center"><th width=50>#</th><th width=480>Description</th><th width=50>On Hand</th><th width=50>Price</th><th width=70>To Order</th></tr> <script> 'use strict'; var header="Papa's Order Page"; var notoc=0; var fontnumber=0; //font number of page header var countfile="suorder"; //used for page counter var showaddbookmark=1; //if 1 then print note about bookmarking var coupon=1; //Change this to 1 to present alert about using a coupon var counter=1; var pictures=1; var total=0; /**/ var category = ['cat1','cat2','cat3']; var name = ['name1','name2','name3']; var onhand = [1,2,3]; var photo = ['photo1','photo2','photo3']; var project = ['proj1','proj2','proj3']; var price = [22,33,44]; //var total = 0; var coupon = ""; var i; /**/ //PrintItem(number,photo,item,price,shortname); for (i = 0; i < price.length; i++) { if (category[i]!=="") { document.write("<tr><td colspan=5 align='center' style='background-color:gray;'>"+category[i]+"</td></tr>"); } PrintItem(onhand[i],photo[i],project[i],price[i]); document.write("<input name='"+name[i]+"' size=2></td></tr>");/* the qty field */ } document.write("<tr style='background-color:lightblue;'><td colspan=2 style='text-align:right;'>Total items on hand:</td><td colspan=3 style='text-align:left;'>"+total+"</td></tr>"); </script> <tr><td colspan=2>Text you want woodburned ($2.00 extra):</td><td colspan=3><input type="text" name="Woodburn text" size=39 /></td></tr> <tr><td colspan=2>PayPal e-mail:</td><td colspan=3><input type="text" name="PayPal" size=39 /></td></tr> <script> if (coupon==1){ document.write("<tr><td colspan=2>Coupon:</td><td colspan=3><input type='text' name='Coupon' size=39 /></td></tr>"); } </script> <tr><td colspan=2>Comments:</td><td colspan=3><textarea name="Comment" rows="5" cols="30"></textarea></td></tr> <tr align="left"><td colspan=2 valign="top">Security code:</td><td style="font-size:12px; text-align:center;" colspan=3><img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image"><a href="#" style="background:deepskyblue;" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false"><br>Reload Image</a></td></tr> <tr align="left"><td colspan=2>Retype code:</td><td align="center" colspan=3><input type="text" name="captcha_code" size="25" maxlength="6"></td></tr> <TR><td colspan=2> </td><TD ALIGN=CENTEr VALIGN=TOP colspan=3><input type="submit" value="Submit" /> <input type="reset" value="Reset" /></TD></tr> </table> </td></tr> </table> </form> </body> </html>
  20. The difference is that a certificate has been installed... https://support.microsoft.com/en-us/kb/324069
  21. I don't see where the global variable total is declared and initialized to zero.
  22. You don't seem to be able to describe what you want, so how are we supposed to guess?
  23. Put a temporary visible border on each div and float all of them left.
×
×
  • Create New...