Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. There's nothing that works in all browsers. There are a few non-standard selectors: Firefox has ::-moz-range-progress, Internet Explorer has ::-ms-fill-lower. There's no equivalent in other browsers. If you want a slider that works well in all browsers you'll have to build it from scratch using Javascript.
  2. The rowCount() method usually only tells you how many rows were updated or deleted in the most recent query. See details here: http://php.net/manual/en/pdostatement.rowcount.php If you want to check that there were any results, you should use the fetch() method. Since all you're doing is checking that a row exists, it is inefficient to select *, because that's pulling all of the data in the row, which you don't need. Instead you should count the rows. // Count rows where the user exists $ck=$flash->prepare("SELECT COUNT(*) AS `amount` FROM `data` WHERE `user`=:user_name AND `password`=:password "); $ck->bindParam(':user_name',$user_name); $ck->bindParam(':password',$password); $ck->execute(); $row = $cf->fetch(PDO::FETCH_ASSOC); if($row['amount'] > 0) { header('Location: http://www.example.com/'); }
  3. An <audio> element just holds one single audio file. There may be a Javascript program that's changing which file the element plays, but I'm not seeing it in the code you showed. There are variables and functions that have not been declared, so this is clearly not all the code. I can't give any help without seeing all the code related to the sound player.
  4. In what way is it not working? What is the expected result and what is the result you actually got?
  5. My interpretation of that would be that Tor actually lacks support for web fonts and is, therefore, not following standards.
  6. Have you checked to see what the contents of the dataString variable look like? var dataString = JSON.stringify(name,email,mobile); I don't think it translates into the POST variables you're expecting.
  7. I think you might want to add a "#" to the id selector in these lines of code: $("#" + id + ' span.word_limit').text(max); $("#" + id + ' textarea').on('keydown', function(e) { $("#" + id + ' span.display_count').text(words); $("#" + id + ' span.words_remaining').text(max-words); To write to the console, it's console.log()
  8. If you give the boxes a fixed height with CSS it will work. The alternative is to use the flexbox layout system, which is a little complicated. Your image files are much too large, they take a long time to load. You should create resized thumbnail versions of them to show on the page.
  9. The CSS and HTML will work as intended. I do not know how jQuery's getScript() method works, their documentation does not make it clear what is passed to the callback function, it just says "data" but that could refer to the file's contents, or something else. In any case, the following line of code will do nothing because it's local to the callback function: var wordmax = jsonData; You need to do something with the wordmax variable if you want it to work. If wordcount.js has a function in it, you could pass wordmax to that function as a parameter, but considering that wordmax contains data that's already in wordcount.js, you probably shouldn't have to do that. Another thing to note is that the order in which the HTML, CSS and JS are returned from your function calls is unpredictable because they are asynchronous. The JS might load first and try to manipulate HTML that does not yet exist.
  10. I can't think of a place right now that teaches all that aside from colleges. Perhaps code academy. To start off, you have to distinguish between server-side technologies and client-side technologies. On the client-side, HTML is for the page's structure. CSS is for the page's appearance and Javascript is for interactive features on the website. On the server-side, you have a language that does data processing, such as PHP, and a language to store and retrieve data: SQL. Communication between the client and the server is done with AJAX. Usually data is sent to and from the server using JSON. Communications between servers are usually done with either JSON or XML. XML is very outdated, though, so I would not use it. In general, just don't use XML, it's only good to know because often you have to deal with outdated systems in a software development job.
  11. It's not something I can put together in five minutes, you need to be proficient with CSS to make this work. You haven't made your requirements clear enough either. Your slideshow only has images, their slideshow has text and links, and you haven't specified the exact behavior you want from the images. Since your slideshow doesn't have any content in it you're going to have to give a fixed height to the slides, otherwise there will be no space for the background image. You'll have to set the background size to "cover" and set the background attachment to "fixed". This is the bare minimum: <div class="carousel-inner"> <div class="item" style="background-image:url(/sites/default/files/insu.jpg)"></div> <div class="item active" style="background-image:url(/sites/default/files/ins.jpg)"></div> </div> .carousel .item { background-repeat: no-repeat; background-size: cover; background-attachment: fixed; }
  12. Yes, to begin with, wrap all your array keys in quotation marks, that's the correct way to do it. You should show the block of code where the parse error is occurring. It's not in the code that you've posted here and that is likely why this is not working. Given the message, I'd imagine a semi-colon is missing on the previous line.
  13. The site you're linking to is using background images rather than <img> elements in their slideshow, they're using a lot of Javascript as well.
  14. Do you have an example of some of the error messages?
  15. Ingolme

    numRows

    I was under the impression it was MySQLi, which does use num_rows for SELECT statements.
  16. Ingolme

    numRows

    You need to add some debugging statements. You have to try to find out what your code is doing and why it's not working properly. // Are we getting the correct e-mail address? var_dump($email); $stmt = $conn->prepare("SELECT id FROM users WHERE email = ?"); if(!$stmt) { // Was the query valid SQL? echo 'SQL error: ' . $stmt->error . '<br>'; } $stmt->bind_param("s", $email); $success = $stmt->execute(); if(!$success) { // Did the query execute properly? echo 'MySQL error: ' . $conn->error . '<br>'; } $numRows = $stmt->num_rows; // Is this a number or is it null? var_dump($numRows); $stmt->close(); if($numRows > 0) { $error = "Your Email is already in use. Please try another."; $conn->close(); }else{ // all good $conn->close(); }
  17. Ingolme

    numRows

    Have you verified that the variable $email contains the correct value?
  18. Ingolme

    numRows

    What does "not working" mean? Are you getting any error messages?
  19. FontAwesome isn't related to W3Schools. Here is their website: https://fontawesome.com/. It requires all of the files to work properly because the files are used for compatibility with different browsers. Personally, I like fast and efficient websites, which is why I don't rely on third party libraries for most of my content.If I need just two icons I will create them myself, or find a site that offers free icons individually. In the web development world you have to choose between efficient or easy. Due to their generalized nature you can never expect third party libraries to be efficient.
  20. Yes, you can pass values through the query string. They will be accessible through the $_GET array.
  21. Included files must have <?php ?> blocks around the code.
  22. Most certainly it's violating copyright. It's two years out of date, so the content may not be as accurate as the current W3Schools website.
  23. You can either look for a setting to prevent it from converting quotation marks, or you can find a more reliable code editor, there are plenty of free ones.
  24. My guess is that your editor is using curly quotes ( “ ” ) instead of regular quotes.( " " )
  25. The real_escape_string() function is not needed for prepared statements, in fact it will probably add unnecessary backslashes which make the query not return the expected results.
×
×
  • Create New...