Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Thank you very much, can you provide the code here? if this can be applied to the banner, what about the thumbnails? they are not background images.
  3. If you set min-height and that height is not proportional to the image, cover will increase in height AND width till it fills completely the container height, this will cause left/right edges of background image beyond that of container edges, clipping it down. Might be better to use img tag rather than background image, as you can set it to 100% width, height auto; and let it control the height of its containing element.
  4. Yesterday
  5. Screenshot from Mac is here: https://snag.gy/2RNMxI.jpg The desired effect is like this: https://snag.gy/zYNUXi.jpg Thank you.
  6. Hello Gurus, I have a homepage here: http://venushomedesign.com/ . Here are the issues: 1. The banner is not displayed completely on my screen (21", 1920x1280) 2. from a Mac it shows completely twisted: not only banner is showing only the middle 2/3 part of the banner, but all the thumbnail pictures are not in the original ratio (squeezed) I have attached two screenshots here for the reference. It would be greatly appreciated if someone can help me to sort it out, thank you very much in advance.
  7. dsonesuk

    Table has error

    The problem is visibly there in plain sight! compare it to the one in the example files, and maybe book an appointment at spec-savers. The character position they indicate ')' usually directly follows the error in question. EYES WIDE OPEN!
  8. Html

    Table has error

    mysqli_connect('mysqlserverlink','user','pass','db',) This is for connect_db Parse error: syntax error, unexpected ')' line 3
  9. Html

    Table has error

    They are all in htdocs, there is an incudes folder with header, and footer html, with a <p> tag each. That is it. I see, I didn't know about that, I couldn't of guessed. Now line 3 is the problem, I thought may the ) was the problem as it states, no change. Ah I see, so there are example files, could it be the spacing of the code? n ) and so on?
  10. The last example I wrote is a bit more complicated at the processor level, I was just showing an alternative way to do things. It is probably best to have the declaration inside the each() callback as I said initially. You're mostly correct, with a couple of differences due to the way scope and references work. 2) If the space does not have an object yet, it behaves as you said and puts the object in that space. If there was already an object in that space, the variable entry is changed to point to a new space in memory and the new object is placed there instead. The old object remains exactly where it was as long as there is a pointer to it from somewhere, like the entryArr array. 3) The value is not retrieved from the storage space, instead the array just contains a reference to that space in memory telling it that the object is there. This distinction is important, because the error you had initially occurs because all of the array elements had pointers to the same piece of memory meaning that changing one of them would change all of them. I've attached a short diagram explaining basically how the memory works in this situation. It's not 100% accurate, but it would take at least a semester course to teach the details.
  11. OK. I think I have it. Using your last example as my heuristic template, then 1) Create a space in memory called entry. var entry; 2) Fill that space with a new object called entry with each iteration of the $.each() function. entry = {}; // Create a new instance of an object and place it in the reserved memory for(var property in propertyArr) { var prop = propertyArr[property]; entry[prop] = object.prop; // Set the properties of the object } 3) From that storage space retrieve the current value of entry (the just created object) and add it to a predefined array called entryArr. entryArr.push(entry); Is this correct? Roddy
  12. No, it is the same function. Every time the program enters a function, new memory is allocated for it. When the program leaves the function all of the memory used by the function is freed unless there are pointers to it from another part of the program, such as the array that was declared outside.
  13. dsonesuk

    Table has error

    The file is supposed to be outside the folder where other php, html files are stored for security reasons, if you have set this up the same and bothered to read and understand, you would see it starts with '../' this indicates the file 'connect.db.php' is not in the same folder but outside. These are the example files, which include header,footer.html files where they are placed in relation to each other' http://ineasysteps.com/wp-content/uploads/2016/07/SRC.zip
  14. You appear to be saying that each iteration of the same function is a different function. Have I understood correctly? Roddy
  15. Ingolme

    Table has error

    The leading slash is looking for the file at the root of the server. You almost never need to start a path name with a slash. You have to replace that with the actual path to the file. If the file is in the same directory as the current PHP file, then removing the slash will fix the problem. If it is in a sub-directory then you need to put the name of the sub-directory in the path. Where is connect_db.php in relation to the current PHP file you are writing?
  16. The problem before is that you created only one object and on each iteration you changed the properties of that object and added a new pointer to it from the array. What you really need to do is to create a new object on each iteration. You can recreate the variable every time because it is inside its own function. Another option would be to declare the object outside and initialize it inside the loop: var entry; // Reserve memory for storing objects $.each(inputArr, function(key, object) { entry = {}; // Create a new instance of an object and place it in the reserved memory for(var property in propertyArr) { var prop = propertyArr[property]; entry[prop] = object.prop; // Set the properties of the object } entryArr.push(entry); // Add a pointer to the new object at the end of the array }); return entryArr; They both do the same thing but for different reasons.
  17. That was it! Thank you, Ingolme. Now, if I could only understand it. There appears to be much more involved in this case than a simple matter of scope. How is it that I am able to recreate the same variable over and over again? Roddy var entry = {}:
  18. I request an evaluation of the following web page, especially on the use of semantic elements: https://jsfiddle.net/SSteven/qt9d2sfw/ Specifically: 1) At the top, 2 images are supposed to be displayed. (Currently, their alt text is displayed.) I have treated this as the <header>. I have used "float: left" to display both images horizontally. Is the code for the header element and its sub-elements OK? 2) The top menu has been displayed in an <nav> element, which has been styled along with its sub-elements. 3) The "side menu" has been included in an <aside> element. 4) The <main> element contains an <article> element, which has the main content. Both the "side menu" and the <main> element are floated horizontally. 5) Finally, there is a <footer> element. Basically, I'd like to ask: 1) Is the use of the semantic elements correct? 2) Is their styling done correctly or is there a better way? I'd also like to ask about indentation guidelines for HTML code. I have indented the HTML code. What is the normal practice? Thanks.
  19. Html

    Table has error

    Other than the missing i, what else? That isn't the solution. blah blah directory of free web host.
  20. dsonesuk

    Table has error

    Right! you have a error message, you have the line, look and find out why the error exists! its there in plan sight, errors do not fix themselves, and if errors exist nothing will work.
  21. Html

    Table has error

    That is after the trying the create_forum page, line 5 it also states. mysql_set_charset($dbc, 'utf-8');
  22. Html

    Table has error

    Well there is no includes folder or footer.html. There is no tutorial on that. I guess I'll have to just try something.
  23. dsonesuk

    Table has error

    You need to enable display of errors, any errors will cause the page to fail I'm surprised your editor did not pick it up. The spelling of include is wrong in this case, and yes if you include a none existent file, that too will cause an error causing the code to fail.
  24. Html

    Table has error

    Ah, I see. I tried editing both pages, nothing. <?php $page_title = 'forum' include('includes/header.html'); require ('/connect_db.php'); $sql = 'SELECT * FROM forum'; $result = mysql_query($dbc, $sql); if ( mysqli_num_rows($result)>0) { echo '<table><tr><th>Posted By</th> <th>Subject</th><th id="msg">Message</th></tr>'; while ($rows=mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo '<tr><td>'. $row['first_name'].''. $row['last_name'].'<br>'. $row['post_date'].'</td><td>'. $row['subject'].''. $row['message'].''. } echo'</table>'; else { echo '<p>There are currently no messages.</p>'; } echo'<p><a href="post.php">Post Message</a></p>'; mysqli_close($dbc); incluide('includes/footer.html'); ?> There is no actual footer.html or anything, I doubt that would matter. <?php require ('/connect_db.php'); if (mysqli_ping($dbc)) { echo 'MySQL Server', mysqli_get_server_info($dbc) 'on', mysqli_get_host_info($dbc); } ?> That was correct already.
  25. If user logs out, clear sessions. OR https://stackoverflow.com/questions/7127153/php-how-can-i-block-direct-url-access-to-a-file-but-still-allow-it-to-be-downl
  26. dsonesuk

    check if server and client are connected

    document.getElementById("ping1").style.color = "red";
  27. s_avinash_s

    check if server and client are connected

    Hi Now am successfully able to get it. if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; } else { document.getElementById("ping1").innerHTML = "Connected"; } Disconnected and connected , i need to change color. How can i do that
  1. Load more activity
×