Jump to content

Leaderboard


Popular Content

Showing most liked content since 06/26/2013 in all areas

  1. 2 points
    There's nothing formal to tell you things like that. People do it themselves, and it tends to illustrate the Dunning-Kruger effect. People who just recently started tend to rate themselves highly, and only when you get more into something do you realize how much you don't know. I wouldn't put any weight on things like that. If you want to evaluate someone's capabilities look for a portfolio or things they've actually finished.
  2. 2 points
    I don't know where there's a list. Generally you should never develop for specific devices, you should just make your layout flexible enough (with help of media queries) to wotk on any screen regardless of size. This is usually achieved by testing your page in the responsive mode of your browser and resizing the viewport until it breaks, then you add a media query to correct the layout. But for reference, I start off with a design for the following devices, then make extra adjustments later: Small mobile (iPhone 4):Up to 374px (I usually use this just for specific elements that didn't fit) Mobile or small mobile in landscape): Up to 767px Tablet portrait: 768px Tablet landscape: 1024px (breakpoint usually between 800px and 900px) Desktop: 1025px and above Some people make designs for large desktop computers (1440px and above), but that's up to you. In general, there isn't one specific strategy for responsive design, this is just the approach from the companies I work with.
  3. 2 points
    Like astralaaron said using closest class and the index class in jquery you can get the index of the tr, have a look at the fiddle. https://jsfiddle.net/8hL46ftj/ hope this helps $('img').click(function(){ alert($(this).closest('tr').index()) })
  4. 1 point
    I misread what you wrote, I thought you wrote "there is no such thing as scope". Yes, SQL queries have a scope.
  5. 1 point
    That server is redirecting one URL to another, it sounds like you want the URL that it redirects to. You might need to use a library like cURL to send a request to that URL and get the headers back. The redirection URL will be in the Location header.
  6. 1 point
    If it's returning the code then the server is not executing the file. Maybe the web server doesn't support ASP, maybe it's just not configured correctly.
  7. 1 point
    Just set the second to the first selected value, because the second has no onchange event to it, it acts as normal with ability to override first $(function() { $('#item_podtype_exp').on('change', function() { $('#itunes_podtype_exp').val($(this).val()); }); }); If you wish to disable previous values in second from selected value in first $(function() { $('#item_podtype_exp').on('change', function() { $('#itunes_podtype_exp').val($(this).val()); var first_sel_val = $(this).val(); $('#itunes_podtype_exp > option').each(function() { if (parseInt($(this).attr('value')) <= parseInt(first_sel_val) || $(this).attr('value') === "") { $(this).prop('disabled', 'disabled'); } else { $(this).prop('disabled', ''); } }); }); });
  8. 1 point
    What happens when you increase the width of your window? Is your viewport large enough to see both tables side-by-side? I ask this, because this is how you have them positioned with your CSS. .scColl {position:absolute; top:0; left:0; width:1050px; height:2000px; border:2px solid red;} .scTot {position:absolute; top:0; right:0; width:250px; height:2000px; border:2px solid red;} Both DIV elements are position top:0. One is positioned left:0 and the other right:0. This should produce a row, not column effect. Yes, XMLHttpRequest is a reserved word, but the variable to which you assign the returned object is not. It will not disturb your code to name the returned object differently. In fact, it will increase your ability to manipulate what is returned. Find the icon in the bottom right corner of any entry and pass your cursor over it. it is there where you will find the trophy. Roddy
  9. 1 point
    If $(this).attr('id') returns the correct ID, then this (and the jQuery-wrapped $(this)) refer to the same element. There's no reason to get the ID from the element, then get the element again. You already have it, you're getting the ID from it.
  10. 1 point
    You have to build it or hire somebody to build it for you. A PHP script will work if your server supports PHP, but there are tons of other server-side languages with which to build your website.
  11. 1 point
    That is mainly done by using JavaScript https://www.w3schools.com/howto/howto_js_slideshow.asp but you may need to ask permission before using another sites images first.
  12. 1 point
    It's fine to use that style to refer to the current page. PHP's magic constants wouldn't help though, there's not one that refers to the current URL. You can build the URL from the $_SERVER array, but it's not necessary if you're just linking to the current page.
  13. 1 point
    Unfortunately this site has no connection with the administrators of w3shools.com, posting this error here, won't receive any attention to fix this error, but I suggest you go to 'About' page on W3schools.com then at bottom of page, click report error link.
  14. 1 point
    That's because you set it to false right before you alert it. Go back and look at the code I posted, notice how the variable definitions are outside the load handler. They first get defined with those default values, maybe at some point later down the page PHP will redefine them, and then once the page finishes loading the rest of the Javascript runs, using either the default values or the values that were set by PHP.
  15. 1 point
    I haven't tested how jQuery handles that, but I assume that it's only going to execute whatever code was just added to the page. The rest of the code on the page will be executed when the browser gets to that point. I'm referring to the 2 links you posted above. The direct link does not have that link to #60, the "proxy" link does even though they go to the same page. Why, because it's longer? There's nothing unmistakable about 60, as far as the computer is concerned. 60 is also unique and unmistakable. Both 60 and any hash will convert to binary values that are unique, the computer will not confuse them with each other. So they are both values in the same address space of all binary numbers, one of them is just an enormous number but that's the only real difference, they're just numbers. Why would one of them be said to be a quantitatively "better" number than another? Hashes are really only used for one thing - verification. Passwords are stored as hashes and then the hashes are computed to verify that the entered password matches the stored one, or a file might be distributed along with a checksum hash to verify the integrity of the file, that the file you actually saved is the one they distributed, there was no error in transmission. Hashes don't really offer anything as identifiers that you can't get with any other numeric value, and a hash is just a numeric value represented in a different base. One problem I see with using both a hash and an ID is that people cannot find the pages if they only know the ID. If I think you said something great in podcast 60 and I want to share it with someone else, I can't just check the URL and figure out where the ID goes in the URL, I also need to know some long hash that I can't calculate just by knowing that the podcast was number 60. So the only thing I can do is try to find a link to that page somewhere else, I can't just type it in manually. If that's your goal, if you're trying to add some sort of protection against people being able to figure out the URL for any podcast, if you're trying to control access in some way where they need the specific URL and not just the ID, then that would be the result of requiring the hash to be in the URL. Don't think of it like that, PHP and Javascript don't share any values or anything like that, the only relationship is that you're using PHP to output Javascript code. They don't run in the same address space, they don't even run on the same computer (PHP runs on the server, Javascript runs in the browser). As far as PHP is concerned, it's all just text being sent to the browser, PHP doesn't care whether it's Javascript text or HTML text or any other kind, it's just output. So all you have to do is output that Javascript code outside of the element that is being cloned or copied. I can't specifically tell you how to do that, I'm not looking at everything that you are. I assume you have templates or something with all of that stuff in it, so just make sure the Javascript code to copy the content is not part of the content that gets copied.
  16. 1 point
    The act of adding the new HTML content (it does not matter that the content came from somewhere on the page) causes the browser to execute whatever Javascript is in there. The Javascript that is in there tells it to replace the HTML content again, and that keeps happening until the browser gives up. The position of the PHP code is not relevant as far as the browser is concerned, the position of the Javascript code is relevant. Don't put the Javascript code to do the replacement inside the HTML that gets added, it needs to go outside of the element that you're copying. Now, if you need to change the PHP code to get the Javascript code to show up somewhere else, then do what you need to do. I would expect that you only have to change something inside the template though. It's always better to produce the final version the first time, instead of spending time to produce an intermediate version which then needs to spend more time to produce the final version. Redrawing the page in the browser is a fairly expensive process (relatively speaking), it's best to limit how many times you're telling the browser to draw the page. Browsers have gotten a lot better at that over the last decade, but it's still a good practice to try to just produce the final page the first time. That's just how the browser handles it. The HTML on that page is not valid, there's not much point trying to figure out how or why the browser is going to handle invalid HTML when you should just produce valid markup. The first link causes the Javascript loop and error in the console. That link only shows up when clicking from the other page, right? Why do you use a hash, what's the point? If you have the podcast ID shouldn't that be enough to uniquely identify it?
  17. 1 point
    Use a separate field in the table to specify the sort order, and when you insert the data make the sort order field whatever order you want to retrieve the data.
  18. 1 point
    I remember when blink was phased out, Mozilla made a big announcement out of it. It used to work in all browsers, but was deprecated and later removed.
  19. 1 point
    Text-decoration: blink,, is unlikely to be supported in all browsers, as some find if it irritating rather than a useful pleasing feature. You can use css3 animation, to achieve the same effect, similar to using animation to scroll text, which deprecated marquee element used to do.
  20. 1 point
    It's common to use ajax to send a request for partial content and fill that in on the page. I don't know if jQuery's load method will automatically execute any Javascript sent with the HTML, but if not that's something else to consider. A common practice would be to return a JSON structure with an HTML part and a Javascript part, where you would add the HTML then execute the Javascript.
  21. 1 point
    In your function declaration you wrote J instead of I.
  22. 1 point
    The length is 3. The indexes go from 0 to 2. That is 3 elements, which is why the length is 3. 0, 1, 2 -> that's 3 elements.
  23. 1 point
    dsonesuk is referring to using <a> tag. Like: <a href="edituser.php?cust_id=n">Edit User</a>
  24. 1 point
    If sessions are set up to only use cookies, then the session ID is stored in the cookie, and either used as part of the filename (if the default session file handling is enabled) or otherwise saved so that the server can look up a session by ID. If the session has not expired and been deleted then the session ID should point to the session data. If cookies are turned off then the session ID can be passed around through page URLs, but that is terrible security. PHP should be configured so that sessions.use_cookies is on, and sessions.use_only_cookies is on. It's also good to have sessions.cookie_secure on if your site uses HTTPS, and sessions.cookie_httponly on. Session_write_close isn't really affected by whether or not cookies are being used. The only time that cookies have any effect on that kind of thing is if you're starting a session for the first time and also redirecting, sometimes I've seen the browser fail to set the session cookie but that was years ago, I assume that browsers have improved since then. Not true. Like the manual says: That's kind of a weird statement. I'm not sure what the point is. The browser is supposed to delete the session cookie when it closes, because it is a temporary cookie. The session expires after a period of inactivity matching the PHP settings. That's also phrased a little strangely, again I'm not sure what you're getting at. Normally you never need to use session_write_close. Like the manual says, the only thing it helps for is if you have multiple pages all loading inside different parts of a frameset, and in each one you would want to close the session as soon as that page is finished with it so that the other pages can open the session and run. It is not normal for the vast majority of scripts to use session_write_close. Also, the session_id function is not used to get session data, its only purpose, like the manual says, is to either get or set the current session ID. The browser doesn't know anything about sessions. The browser doesn't know what a "session" is, and it has no idea that PHP is a thing. The browser just sends cookies, cookies have been a part of the HTTP specification for a long time and PHP decided to use cookies to help support sessions in PHP. All the browser does is save and send cookies just like it does with any other cookie. If you want to know how cookies work in general, there should be a lot of documentation for that. When cookies are set they include the domain name and path, and some other settings, and if the browser requests a page which has matching cookies then it sends those cookies when it makes the request. Cookies are sent as part of the HTTP headers. The browser sends any cookie the server told it to set, as long as the cookies match the URL that the browser is requesting. Regardless of how session data is saved or destroyed, it's less secure because the alternative is to pass the session ID in the URL, and now anyone watching traffic can look at your URLs and hijack your session. Or if you copy and paste a URL to someone else, and don't know about something like a session ID, then that other person clicks the link and now they're logged in as you. There are any number of ways where passing the session ID in the plain-text URL might bite you in the butt. As long as your site is using HTTPS, then the headers sent by the browser and server are part of the encrypted data, so all anyone snooping on your traffic can see is the URL. They can't see any of the data payload, just which page you're requesting. Everything else is encrypted.
  25. 1 point
    I'm talking about the columns in the game table, not the gametag and gameplatform tables. The unique constraint on something like the gametag table should be the gameID and tagID, not an autonumber. The combination of the gameID and tagID is what needs to be unique, you wouldn't want multiple records with the same values for those fields. That's why it should be the primary key, and making it the primary key will also help with searching.
  26. 1 point
    How can I? I don't know what or how it is replacing the checkbox? it is not necessarily bootstrap on its own, could include jQuery. I can only give exact answer by seeing the problem in action by link to the page in question, to identify what element/class needs to be targeted.
  27. 1 point
    Yes, if you are only communicating via the internet, and not using a browser, but each language is different. You would not use the same code or probably even the same language in Windows as you would in Linux.
  28. 1 point
    Are you making an app, like those? If it was me, I would test for a connection to the app's servers and, if there is not one, then I would probably start by using a buffer to keep messages that are pending to be sent. If the app gets closed then I would write the buffer to permanent storage which I would check the next time it starts up.
  29. 1 point
    You want what to happen, an anchor to get created or edited or something? Like with most things, instead of finding something that tells you exactly how to do specifically what you want to do, you need to understand the basics and the theory yourself so that you can apply that to build what you want. You can start here, but there's a lot more information online about dragging and dropping. https://www.w3schools.com/html/html5_draganddrop.asp
  30. 1 point
    You'll have to link to a specific PHP file that's designed to display the source of a file. <a href="show-source.php?file=interface">Interface</a> <a href="show-source.php?file=class">Class</a> show-source.php <?php if(isset($_GET['file'])) { switch($_GET['file']) { case 'interface': highlight_file('./composer/php_rss_generator/RSSGenerator/ItemInterface.php'); break; case 'class': highlight_file('./composer/php_rss_generator/RSSGenerator/Item.php'); break; } } ?>
  31. 1 point
    Place both if conditions for setting modal and login to display none, in a single window.onclick function
  32. 1 point
    It is so much much easier to do it in PDO, why don't you use it ? And it is even more secure. dbconnection: try { $username = "db_username"; $password = "db_password"; $db = new PDO("mysql:host=localhost;dbname=your_dbname", $username, $password); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected !"; } catch (PDOException $e) { echo $e->getMessage(); } then your script to insert those values: try { $sql = "UPDATE users SET Username=:username, Email=:email, EmployeeID=:empid, Designation=:design, Password=:password WHERE Id = :id"; $stmt = $db->prepare($sql); $stmt->bindParam(":username", $username); $stmt->bindParam(":email", $email); $stmt->bindParam(":empid", $employee); $stmt->bindParam(":design", $designation); $stmt->bindParam(":password", $password); $stmt->bindParam(":id", $id); if($stmt->execute()){ echo "<font face='Verdana' size='2' color='green'> You have successfully updated your profile <br /> </font>"; } else { $msg = "<font face='Verdana' size='2' color='red'> There is some problem in updating your profile. Please contact site admin <br /></font>"; } } catch (PDOException $e) { print_r($e->getMessage()); } This is a clean way to do what you want but in PDO not MySQLi.
  33. 1 point
    It would transfer the problem to AJAX code, it depends on WHY the ajax php code was included in the form page if (isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )):include('../config.php'); will not run php code beyond this 'if' condition, if page reloads because JavaScript was disabled which prevents the form being submitted, it is no longer a JavaScript AJAX request. if (!isset( $_SERVER['HTTP_X_REQUESTED_WITH'] )):include('../config.php'); Will allow the php code within the form to be processed if JavaScript disabled, BUT! will prevent AJAX request being processed if JavaScript is enabled and it goes directly to ajax_comment.php
  34. 1 point
    The superglobal is like any other variable in the PHP process, it only exists during the time the script is running. If you want to store its value permanently somewhere you can use a database or write it to a file. If you want to store something for one user during a browsing session you can use PHP sessions.
  35. 1 point
    These Email = $Post('email'}; $Password = $Post('Password'}; are supposed to be $_POST['email']; AND $_POST['Password']; and the coloured names are suppose to match the values of name attributes of inputs you are trying to read <input type="text" value="username"><br> Password:<br> <input type="text" name="lastname" value="password"><br><br> AS you can see, they match neither, and one does not even have a name attribute which is required for ALL inputs, AND name values must match exactly as 'password' is treated differently to 'Password'.
  36. 1 point
    It looks to me like hiding the menu was not a mistake but a deliberate part of the design. The menu wouldn't fit as it is on a mobile screen. I can't check the code right now, I might get to it later. You should use your browser's inspector to see which CSS rule is hiding the menu.
  37. 1 point
    The save() and restore() methods are useful for that. save() remembers the current state, restore brings back the state of the last save() call. ctx.save(); // Remember the current state ctx.translate(100,100); ctx.fillRect(0,0,100,100); ctx.restore(); // Return to the previous state ctx.fillRect(100,100,50,50);
  38. 1 point
    Yep. The alternative is to not list the columns in the table and only give the values: INSERT INTO table VALUES ('val1', 'val2', 'val3') But, like I said, if you ever change the structure of that table then that query is going to break if you've changed the number of columns. It's best to just list everything out explicitly. You don't have to pay per character in your source code, make the code as obvious as possible so that it's easy to maintain. Ease of maintenance should always be a higher priority than something like how long the code is.
  39. 1 point
    If you're using mysqli in PHP then you still need to write the SQL code. mysqli is just an extension for using MySQL, it's not an abstraction layer like you would get with Zend Db or something where you're building PHP method calls instead of writing SQL queries.
  40. 1 point
    function myFunction(elem) { elem.nextElementSibling.classList.toggle("show"); var myDropdown = document.getElementsByClassName("dropdown-content"); for (var i = 0; i < myDropdown.length; i++) { if (myDropdown[i].classList.contains('show')) { if (elem.nextElementSibling !== myDropdown[i]) { myDropdown[i].classList.remove('show'); } } } } BUT! you do realise, the window onclick example (https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_js_dropdown) does not work in MS Edge, its so good of w3schools to give you an example that does not work in MS Edge and not tell you.
  41. 1 point
    You can store the query results in a multidimensional array check this https://www.w3schools.com/php/func_array.asp "example 4" you can then return the array .
  42. 1 point
    Any inline element, or block element using display: inline; turning it into a inline element will not respond to width, height applied, its width will be determined by content within it.
  43. 1 point
    If you check the network tab of your browser's developer tools, each time you click a color you'll see a request go out for an image. Here's one of them. http://hanes.scene7.com/is/image/Hanesbrands/HNS_HO5944_ChiliPepperHeather?defaultImage=Hanesbrands/HNS_HO5944_AwesomeBlueHeather&id=Cd9S33&wid=490&hei=622&fmt=jpg
  44. 1 point
    Use "==" for comparison. A single "=" is the assignment operator, which changes the value of the variable you're operating with. You can use a switch() statement as well to make your code more readable.
  45. 1 point
  46. 1 point
    Because they show as the order they are laid out from the beginning. There are several ways to do this, but will involve cloning the current hidden divs, in the order they were selected, removing the original hidden selected and then appending cloned divs in correct selected order.
  47. 1 point
    Events like these are applied to elements on loading of the page, if you place them in a function you apply the exactly the same event with same outcome again everytime the function is called, very inefficient, generally if these are placed in function you are doing it wrong. You don't even require the function, you just need to target the parent and then the newly created class references. function addFlowLine() { var table = document.getElementById("query_content_unexe"); var row = table.insertRow(0); row.insertCell(0).innerHTML = '<button class="up">up</button>'; row.insertCell(1).innerHTML = '<button class="down">down</button>'; row.insertCell(2).innerHTML = 'add'; } $("#unexe_table").on("click", ".up, .down", function() { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { row.insertBefore(row.prev()); } else { row.insertAfter(row.next()); } });
  48. 1 point
    Vi.. not unless I have to! Nano is superior, in my opinion. It is much easier to use and just as functional. I can't imagine a situation that I would use Vi, although, if I needed to, I can manage with it.unrelated: glad to see my list got added to the poll
  49. 1 point
    You should add Notepad++ to that list.
  50. 1 point
    If you posted here, you might find this intersting:http://w3schools.invisionzone.com/index.php?showtopic=456
×