Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by davej

  1. This is terrible code. This is being taught in a class?
  2. Code written by you or by a trusted party?
  3. If you simply want to hide your Javascript code from people who are not logged in yet then I think there are easier ways to accomplish that.
  4. CSS doesn't make sense without HTML and Javascript doesn't make sense without HTML so the most obvious path is HTML -> CSS -> Javascript.
  5. I have no idea what you are trying to do. Why are you using names on anchor tags? See... http://www.w3schools.com/HTML/html_links.asp
  6. If you already use IP restrictions you could certainly add cookies, or limit polls to e-mail verified users, or perhaps use 3rd party logins.
  7. Seems very impractical. Why not use an available HTML/CSS feature such as drop-down menus, styled links or an image map? Here is your idea... <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>title</title> </head> <body> <h4>Type in "monkey" to jump to secret monkey.html</h4> Password:<br/> <input type="password" id="filename"> <input type="button" id="btn1" value="Go"> <script> 'use strict'; document.getElementById('btn1').onclick = function(){ window.location.assign(document.getElementById('filename').value.trim() + '.html'); } </script> </body> </html>
  8. You need server-side code to accumulate and store the results -- period.
  9. You need server-side code to identify the IP and to store the results on the server. Javascript can only store data locally.
  10. Where do you see any parens in the below examples? http://www.w3schools.com/sql/sql_select.asp
  11. Well, it would help if you corrected your syntax... <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>title</title> <style> #rel{ position:relative; width:50%; height:200px; border:1px solid blue; overflow:hidden; } #abs{ position:absolute; height:50px; top:20px; left:50px; background-color:red; overflow:hidden; } </style> </head> <body> <h2>This is h2 title</h2> <p>This is a paragraph</p> <div id="rel"> <div id="abs">this is absolutely positioned inside a relative block</div> </div> <h3>This is h3 near bottom</h3> </body> </html> You are correct that absolute positioning should ONLY be used inside relative positioning. PLUS it should ONLY be used when necessary, such as when you really need to position something on top of something else.
  12. ??? <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>title</title> <style> div{ margin:5px; padding:3px; } .post header{ width:200px; height:130px; border:1px solid #555; background-color: #479; } .post{ width:600px; border:1px solid #555; background-color: #bbb; } .post header div{ width:100px; } .post header .detail{ height:180px; width:400px; border:1px solid #555; display:none; } .post header:hover{ background-color: #6af; } .post header div{ cursor:pointer; } .post header div:hover .detail{ display:block; position:relative; /* puts overlay on top */ background-color: #ddd; } </style> </head> <body> <div class="post"> <header> Name: Bill<br/> Posts:123<br/> Gender:<br/> Location:<br/> Languages:<br/> <div>(See detail) <div class="detail"> This popup provides detail on this user Bill. </div> </div> </header> <p>lkjlkj jklkj jklkj lkjliou oiuy tuyt tt 78i7y poipoipoi yiuyiuy frytr rtytr rty trytr rtytr rty tyr eer tre oiuoiuoiu oiu iu uio iou uio iuui ouui iu kjkjhkjhkjh h h jh ytrytr t ytr rr tytrty</p> </div> <div class="post"> <header> Name: Sally<br/> Posts:213<br/> Gender:<br/> Location:<br/> Languages:<br/> <div>(See detail) <div class="detail"> This popup provides detail on this user Sally. </div> </div> </header> <p>lkjlkj jklkj jklkj lkjliou oiuy tuyt tt 78i7y poipoipoi yiuyiuy frytr rtytr rty trytr rtytr rty tyr eer tre oiuoiuoiu oiu ikl;k;lk oiuoiu uoiu oiu u oiuoiuuuytuyt uytuy tuyt ytuy u uio iou uio iuui ouui iu kjkjhkjhkjui yiu yuiuyiuiuyiu iuuy rrtyryt rtyr ytrgfdg dgfd dgf dfgfd rttre tretr tretr ert t ytr rr tytrtytyr eer tre oiuoiuoiu oiu iu uio iou uio iuui ouui iu kjkjhkjhkjh h h jh ytrytr r tytrt ytr rr tytrty</p> </div> <div class="post"> <header> Name: George<br/> Posts:2993<br/> Gender:<br/> Location:<br/> Languages:<br/> <div>(See detail) <div class="detail"> This popup provides detail on this user George. </div> </div> </header> <p>lkjlkj jklkj jklkj lkjliou oiuy tuyt tt 78i7y poipoipoi yiuyiuy frytr rtytr rty trytr rtytr rty tyr eer tre oiuoiuoiu oiu iu uio iou uio iuui ouui iu kjkjhkjhkjh h h jh ytrytr rtytr rty tyr eer tre oiuoiuoiu oiu ikl;k;lk oiuoiu uoiu oiu u oiuoiuuuytuyt uytuy tuyt ytuyt u uio iou uio iuui ouui iu kjkjhkjhkjh h h jh ytrytr r tytr yiuyiuy yui yiu yuiuyiuy iuyuiuy t ytr rr tytrty tyr eer tre oiuoiuoiu oiu iu uio iou uio iuui ouui iu kjkjhkjhkjh h h jh ytryt tytrt ytr rr tytrty</p> </div> </body> </html>
  13. Do you have the J/Connector installed? Can you successfully establish a connection to the database?
  14. Do you understand what binary numbers are? https://en.wikipedia.org/wiki/Binary_number Obviously... 1 OR 1 = 1 1 AND 1 = 1 1 OR 0 = 1 1 AND 0 = 0 etc... https://en.wikipedia.org/wiki/Bitwise_operation
  15. Where is this code from? What are you importing at the top of this file? Did you override the toString method in the Draw class? Do you also have a list class or is that a typo?
  16. What are you expecting it to print? It replaces special characters with entities such as described here... http://www.w3schools.com/charsets/ref_html_ascii.asp The global PHP_SELF is vulnerable to hacks. If you enter the actual file name then there is no risk.
  17. Then maybe... <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>title</title> <style> #wrapper{ text-align:center; width: 300px; } #wrapper,h3 { border:1px solid red; border-radius:10px; } .highlight{ background-color: #ff0; } h3{ cursor:pointer; } .clkchg:hover{ background-color:yellow; } </style> <script> window.onerror = function(a,b,c){ alert('Javascript Error: '+a+'\nURL: '+b+'\nLine Number: '+c); return true; } </script> <script> 'use strict'; window.onload = init; function init() { //document.getElementById('wrapper').onclick = replaceContent; document.getElementById('wrapper').addEventListener("click", replaceContent); } function replaceContent(evt){ var ele = evt.target; var cla = ele.className; if (cla.indexOf('clkchg') != -1){ document.getElementById('main').innerHTML = ele.innerHTML; } } </script> </head> <body> <div id="wrapper"> <h1 id="main">Hello</h1> <h3 class="clkchg">This is item A.</h3> <h3 class="clkchg">This is item B.</h3> <h3 class="clkchg">This is item C.</h3> <h3 class="clkchg">This is item D.</h3> </div> </body> </html>
  18. AFAIK data to and from the view passes through the controller. view <=> controller <=> model <=> datastore
  19. You can log into the command line console and then type... select user(); show variables where variable_name = 'port';
  20. Do you simply want to share a file, such as an Excel file?
  21. You want to display a table built from stored data -- but who creates this data? How often is it updated? Does every user see the same data?
  22. Also, is MySQL working fine on the console? And are you on a Mac or a pc?
  23. Ignoring PDO for a moment, does mysqli work? <?php error_reporting(E_ALL); ini_set('display_errors','On'); echo 'Php is running...'; echo '<br/>Connecting to MySQL... '; $dbcon = mysqli_connect('localhost','root',''); $dbname = 'test'; if (!$dbcon){ echo '<br/>Error: Unable to connect to MySQL.'; }else if(!mysqli_select_db($dbcon,$dbname)){ echo '<br/>Error: Unable to open '.$dbname.' database.'; }else{ echo '<br/>Connected to '.$dbname.' database'; } ?> I have my Apache server running on port 8080 and mysql on the default, which is 3306 and I use the above (except I have a root password).
  24. I use... $svr = "mysql:host=localhost;dbname=mydbname"; try { $pdo = new PDO($svr, $usr, $pwd); Make sure you turned on the pdo mysql extension in php.ini. Seems odd that you don't have a root password but I guess you've tested that in the mysql console.
×
×
  • Create New...