Jump to content


Popular Content

Showing most liked content since 10/23/2017 in all areas

  1. 1 point
    I don't think your question is worded correctly, $_POST is available on every request but your browser will only send one request at a time. Meaning you can only submit one form at a time. Anything that you want to be submitted all needs to be in the form. Of course, you can use Javascript to add or remove form elements if you want to build an interface like that. But each request to the server is only 1 request, you don't send multiple requests at the same time other than if you're using ajax to send a bunch of requests, but even so that's not the best idea. If you find yourself sending multiple requests in a short period you probably need a more efficient design, requests have overhead. If you're just asking how you can structure a page with multiple forms where you can figure out which form was submitted, there's a post about that here: http://w3schools.invisionzone.com/topic/12509-php-tips-and-tutorials/ I would assume that the trigger would update the timestamp, but the final word there is to just test it.
  2. 1 point
    Use ALTER, its described here https://dba.stackexchange.com/questions/62051/alter-table-rename-a-column
  3. 1 point
    It just sets a variable to another value. That value comes from $_GET, which holds all of the values that were included in the URL.
  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
    Yes, you need the same number and type of columns returned. You don't need to use the same table aliases necessarily, but it makes sense to use the same column names. That's not a correct assumption, if you remove the table aliases but keep them in the list of columns you'll get an error indicating that it doesn't know what p or c is. In that specific example, I don't think so, I think those aliases only apply to the select query where they are used. I could be wrong about that though, you might be able to use one in the other select query, but I don't think that would work. Yes. It won't, it's just being explicit about what you're asking for. If you wanted each ID from the two tables separately, for example, you should give each one a unique alias instead of returning 2 columns with the same name. If you change the data type of a column and there is existing data, MySQL will attempt to convert the data to the new data type. There are various rules for converting data between types. This is also called casting. You can also explicitly convert data during a SQL query, there are functions to do that. Those are the same functions that MySQL would use if you change the data type of a column.
  6. 1 point
    It looks like you're missing the FROM keyword here: SELECT * parent_table
  7. 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.
  8. 1 point
    I always use a single numeric ID as the primary key unless I have a really good reason to do anything else, like if it is only a lookup table with 2 columns and then I make both columns primary. The ID is used internally by the database only and would never need to be changed, I do not use it as an identifier that anyone else would need to know. If you want to give your podcasts a number for people to identify them, make that another database field other than the ID. If you want a revision number, make that another database field. That way the ID will refer to a specific episode and revision. For as long as I've been doing this I haven't found a great use case for not just using an auto-increment primary key. No, it's one of storage. A char field always stores the maximum number of characters that the field allows. A varchar only stores what is necessary but has a maximum length. See here for storage requirements. Note also that an int field always uses 4 bytes regardless of the length you gave it. If a number has a smaller range than use one of the smaller int types. I agree, and that is what char fields do, they always store the maximum number of characters. You would only use a char field if the values will always be the same length, like for a GUID. So why not utf8_unicode_ci? Do you want to allow people to have the same username with different capitalization or characters that look the same but are different unicode code points? That's what using utf8_bin would allow, it looks at binary data only and does not take into account case or whether two characters have the same meaning but are different code points. It's just a question about data normalization. Databases have been around for decades, we have this figured out now. If there is a one-to-one relationship, that goes in a single table. If there is a one-to-many relationship, that's a parent and child table. If there is a many-to-many relationship, that's 2 tables with a third lookup table. The database is specifically designed to work with this kind of data, let it do its job. Don't increase the time required to insert, update, or select data because it's less complex for you. Data storage should be optimized for a computer, not a person. You can display it however you want it to show up, but make it easy for the database to do its job. That should be an auto-increment primary key. There's no reason to store a counter like that in a table, you can use SQL to get the count and then it's always going to be correct and you don't have to worry about updating it when things change. The way that's set up now, if you select the rows and order them by ID then it makes the count redundant, you don't need to store that data. I do use columns like that for display order if I want to allow the display order to be specified (as opposed to ordering by date or some other field), where it will be a sequential series, but if you're only storing the count there's no reason to do that.
  9. 1 point
    The body ends at </body>, nothing except the closing </html> tag should be after that. If you put code in the head that you want to run when the page is finished loading, use a document load or ready event listener to run that code when the page finishes loading. Or, put it at the end of the body (but still inside the body) after you include all of the script files.
  10. 1 point
    VARCHAR almost always takes less space than CHAR, because it allows fewer characters than the limit while CHAR requires the full space to be occupied. If you put a smaller string in a CHAR field, it pads the rest with null bytes. If you put the string "Hello" in a CHAR(150) field, what you essentially have in the table is "Hello\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
  11. 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.
  12. 1 point
    Let's start off at the very beginning. These are your requirements: But you have another requirement: So to summarize your requirements: Display popups on the page any time it loads except under the following conditions: The user arrived on the page from clicking that image. The user has refreshed the page. Now we have to determine the following: How do we know that the user clicked on that image? How do we know that the page was refreshed? The resulting logic should be very simple: if(!clickedOnImage() && !pageRefreshed()) { showPopups(); } function clickedOnImage() { // Return true if and only if the image was clicked // Return false otherwise } function pageRefreshed() { // Return true if and only if the page was refreshed // Return false otherwise return performance.navigation.type == 1; } function showPopups() { // All the code that creates the popups is in here // This code is irrelevant to the problem we're solving } How do you want to detect that the request came from the image? Is it alright to pass data in a query string or hash in the URL? You could make the image a link with the following href attribute: href="overview.html?fromimage=1" and then use the location.search property in Javascript to check for that value. Another option, if you only care that it came from the page that the image is on rather than the image itself, is to check the document.referrer property. clickedOnImage() returns true of document.referrer is " http://www.grammarcaptive.com/single_payment_acknowledgment.php "
  13. 1 point
    Place the JavaScript code between <head>..</head> OR <body>...</body> not outside of these.
  14. 1 point
    You have PHP session code in a html page? is it setup to run php code in html document?
  15. 1 point
  16. 1 point
    You misspelled onclick on this line <button onklick="compare()">Check</button>
  17. 1 point
    It probably makes sense to use ajax to submit the data to the server, that way you don't have to refresh the page. There's plenty of information about ajax online. When you build that page in PHP and write out the button to call the function to run the ajax request, you can pass the board ID to that function. If you don't want to use ajax then you can have your PHP form processing code on the same page, all of the PHP code like that should go on the top of the page before you display anything.
  18. 1 point
    You could use a sessionStorage variable to only open the popup once per session. I'd have to look into this in more detail later.
  19. 1 point
    I've been pretty busy so I've just been answering short questions that don't need a lot of research. I think you probably intended to do an assignment here instead of a comparison. if(typeof navtype != "undefined" && navtype !== null) { performance.navigation.type === 1; } I actually have never worked with the performance.navigation object, so I don't even know what it's for. I'll look it up once I have the time.
  20. 1 point
    If you're showing multiple boards and forms on the page then yeah, you need to add the board ID to each form to make them unique. You can make it a hidden input, or add it to the form action URL.
  21. 1 point
    That's a very broad question. It depends on how you want to classify them. You could classify them by hardware, by operating system, by server software or countless other features. By hardware there's a limitless amount of server configurations given the amount of memory, storage and processing. You can also distinguish between physical servers, virtual servers or server clusters. By operating system the two main categories would be Windows and Linux. Under Windows there are several versions, Linux has a whole lot of different distributions. The two biggest server software packages are Apache and IIS. IIS usually only runs on Windows servers.
  22. 1 point
    For that specific page only you could try .page-id-139 .breadcrumb-wrap li.trail-item.trail-end { display: none; }
  23. 1 point
    Usually when i have this problem i use text shadow of contrasting colour to the text colour itself.
  24. 1 point
    CSS can't put gradients on text. Perhaps you can make your gradients more subtle so that the text isn't hard to read on it.
  25. 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', ''); } }); }); });
  26. 1 point
    You could do that, that should make those variables available in the global scope, but that's kind of a roundabout way to do that, to use Javascript to append a script block. Javascript is already running, you can just set things directly. I mentioned this in another topic, but if you start by declaring those variables in the global scope then you can just set them directly later. So put a script block on the page and define those variables when the page starts, and then in the ajax callback just set the variables directly instead of writing a new script block. It just seems like a roundabout way to have Javascript write a script block when you can do things in Javascript directly, it's already running. Instead of global variables, you might also consider using sessionStorage or localStorage to store things like that.
  27. 1 point
    You can change the width of the row class to be a percentage smaller than 100%, but you're going to need to add various rules for the different page sizes so that on a smaller device it would either be full width, fewer items per row, etc.
  28. 1 point
    1. Success and complete are just a jQuery thing, but if you're using jQuery that is correct. Those functions get called once the request is complete. In the case of plain AJAX, the readystatechange event handler is what's executed when the request is done. 2. The HTML must already be loaded if Javascript should interact with it, but that usually is the case since AJAX is usually called after the page has finished loading. Note that if you change the DOM using innerHTML or jQuery's html() method any references to HTML elements from that page region that were stored in variables will no longer work even if they have the same ID or class name as before. You will need to load them again using a jQuery selector or DOM methods such as getElementById(). 3. That's correct. 4. AJAX doesn't import Javascript variables. It can return data that may be interpreted as a Javascript object. jQuery will automatically parse JSON for you into an object, but that object is only accessible as a parameter in the complete() method of the AJAX request.
  29. 1 point
    in the AREA TAG example (Try it Editor) I would like to suggest to add a title attribute to the alt attribute so that the names of the areas appear in the result, which is NOT the case actually.
  30. 1 point
    in the AREA TAG example (Try it Editor) I would like to suggest to add a title attribute to the alt attribute so that the names of the areas appear in the result, which is NOT the case actually.
  31. 1 point
    That's easy enough to verify. Set up PHP to use an error log, and you can use the error_log function to write anything you want to it. You can make those changes at runtime, although I prefer to set these options in php.ini. ini_set('log_errors', 1); ini_set('error_log', __DIR__ . DIRECTORY_SEPARATOR . 'error.log'); error_reporting(E_ALL); Just make sure that PHP has write access to that error.log file, it will be in the same directory as your PHP script. Then you can use error_log to write whatever data you want to the error log. error_log('$_GET: ' . print_r($_GET, true); error_log('$_POST: ' . print_r($_POST, true)); If I use my browser's developer tools I can see that it sends a request to http://www.grammarcaptive.com/_utilities/php/podcast.php?data_json=[[""%2Cnull]] That %2C would be a comma, so data_json is an array that contains another array which contains an empty string and null. Your query_str variable is an empty string because window.location is http://www.grammarcaptive.com/podcast_dev_copy.php, window.location.search is empty. So pair is an array with 1 element (an empty string), pair[0] is an empty string, and pair[1] is null because it doesn't exist. This doesn't have anything to do with event.preventDefault, that has specific behavior that has nothing to do with ajax.
  32. 1 point
    Some text editors replace standard quotes ("") with curly quotes (“”) which messes up the code. Check your text editor settings to make sure it's not doing that to your quotation marks. If there isn't a setting for that in your text editor then try looking for another one, there are plenty of free ones out there.
  33. 1 point
    if you looked at html through developer tools (i used firefox) you will see <div class'hidden_info'="">...</div>, clearly something is wrong! and it won't apply styling cause it does not exist, looking at code that produces this, it shows </div><div class'hidden_info'> which shows the '=' sign is missing, the browser will try its best to determine what you want, but its not perfect.
  34. 1 point
    It doesn't really matter where you define those functions since there's going to be a delay before they get used (e.g., some action will send an ajax request, the page will get updated, then the functions will be used based on user interaction). You should probably just put them in a Javascript file that gets included on the page in the head with other things that can go in the head. But you'll need to make sure that the functions will get executed when the user does whatever you're checking for. If you're checking for a click event, then you can use jQuery to attach the event handlers so that the elements don't need to be on the page yet, you can do that by delegating the event handlers. You do that by specifying a selector when you attach an event handler using the on method: http://api.jquery.com/on/ So, for example, you would attach the event handler to a div that is eventually going to contain the dynamic content, but use a child selector to say that only buttons with the class "click-1" inside that div should receive the click events. As long as the container element exists you can attach those event handlers before the dynamic content is loaded, you would attach them in the ready handler.
  35. 1 point
    One way is to put a hidden form element in each form with a different value that you can check to find out which form was submitted. http://w3schools.invisionzone.com/topic/12509-php-tips-and-tutorials/?do=findComment&comment=96606
  36. 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
  37. 1 point
    So what's your idea of coding a comment section? Before we can help you and eventually give you some code examples you need to show us some code too, we can't just give you the code without you doing something first because this way you won't learn to do it by yourself.
  38. 1 point
  39. 1 point
    AHH, but then it would not be just a CSS framework without JavaScript.... I know, its stupid, because without JavaScript provided with the templates for example, the templates would not work! HAD THE SAME DISCUSSION.
  40. 1 point
    A lot of questions asked here in this forum can be answered simply by reading the tutorials, and most often what people are asking are actually examples in the w3school main website. Some questions are even extremely similar, but yet people ask the same questions all over again.That "please-read-the-tutorial-first" message pinned at every forum apparently DOES NOT work.I firmly believe that this forum is created to answer questions that the w3schools main website does not answer.I do not have a solution for this. But this would just serve as a precaution. Because basically when this forum grows. Then a lot new topics will be started.Then probably, we will be reading a bunch of repetitive questions being asked all over and over and over again.And please forum members, please dont post for the sake of increasing your post count. Post for the sake of answering questions being asked.And if you wish to promote your website here, we cant/wont stop you with it, but please do it in an ETHICAL way. There is no excuse for not having any manners/ethics.And lastly, this forum, in my humble opinion, is used for answering questions (or some code snippets) not for asking for full/complete scripts.This is just my opinion. You might think i'm wrong, but really i think i am right with this one. You just have to agree with me here.
  41. 1 point
    For many people, tutorials aren't explained in a way to them, where they can actually understand what they are saying, whereas if you had a human who can actively explain how to do something, like a javascript function to resize a window, then that should be fine.That is my opinion and I shall stick by it. ;O