Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. BrainPill

    get session cookie value from the browser

    Sorry I do not get it. Do you try to say that I need $_SESSION variables to make a website visitor unique? I suppose it is possible to store a user_id in a session var called $_SESSION['user_id'] = '12345abc'; but are you trying to say this is the proper solution for tracking website visitors? If an ipnumber has multiple devices connected to this single ipaddress I will not be able to distinguish them correctly. My assumption is that a browser cookie gives that possibility and for that reason I want to extract them.
  3. dsonesuk

    Automatic index.html loading

    You usually have the website logo linking to index. page, as well as a nav link.
  4. Cristiano

    Automatic index.html loading

    I'm not sure whether to use the include method or an index link inside each page (but probably the latter). Anyway, thanks to both of you.
  5. dsonesuk

    get session cookie value from the browser

    A session or cookie? They are not the same. The session when set lasts until the browser is closed and not stored on the users device. A cookie holds data and is stored on the user device until a set expiry date. You should use $_SESSIONS https://www.w3schools.com/php/php_sessions.asp
  6. BrainPill

    get session cookie value from the browser

    If I make a session cookie en store this in the database and I want to compare this database value with the value in the browser of the client, which kind of code do I need then to read the session cookie from the browser ? It is for a visitor counter. I don't know where to start exactly. Are there more possibilities? When I google it I get SE results telling that I have to use request headers in combination with CURL. I am not really familiar with it, so what is the best set up? I am building a visitor counter and besides ip number I would like to use a unique session_id alphanumeric that lasts until the user removes the cookie. Assuming this is the proper procedure I would like to figure out how it works and what code is used. Or is there an easier way to do this?
  7. smus

    Creating Dynamic Checkbox Names

    if pDiscussed is of boolean type, you don't need quotes around the true value. Try checked = "checked" as well What is stored in i variable? Is that (pDiscussed(i)) an array element?
  8. JMRKER

    date format change

    Is this a change from your original request? Is the time expected to be the time of the date selection? If not, where is the time selection supposed to be collected from? What kind of time intervals - 0 to 23 hours? - any minutes/seconds required? Difficult for me to envision solution with current information provided. Sorry
  9. dsonesuk

    Having difficulty creating popup descriptions

    If want multiple popups, the original script is only for a single pop-up per page. For multiple, use below https://www.w3schools.com/code/tryit.asp?filename=FWD99BV7TNYI The toggle is mentioned in this code also, elem.children[0].classList.toggle("show"); it toggle the class name 'show' so the css associated with this class takes effect .popup .show { visibility: visible; -webkit-animation: fadeIn 1s; animation: fadeIn 1s; } This also triggers the animation fadeIn @-webkit-keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} } @keyframes fadeIn { from {opacity: 0;} to {opacity:1 ;} }
  10. Yesterday
  11. dsonesuk

    Automatic index.html loading

    There is a html/JavaScript option, I wouldn't personally use it, in preference to server side script option https://www.w3schools.com/howto/howto_html_include.asp As I know server side would always work, while html/JavaScript relies on JavaScript being enabled.
  12. Funce

    Automatic index.html loading

    I see, you'll probably need a server side language like PHP instead. I've misunderstood your issue.
  13. Cristiano

    Automatic index.html loading

    It's well beyond my current skill level.
  14. Cristiano

    Automatic index.html loading

    I created the site http://cristianopi.altervista.org/as_old/ and the file .htaccess: RewriteEngine on RewriteCond %{REQUEST_URI} !^as_old/index.html$ RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$ RewriteRule .* /as_old/index.html [L,R=302] but when I click a link on the index page, the index page itself is loaded into the iframe (instead of the page in the link).
  15. Funce

    Having difficulty creating popup descriptions

    What's your code looking like? It sounds like the document.getElementById("MATCH") isn't matching up with your <div id="MATCH">
  16. I wish to create popup descriptions for my website. I followed the example on W3Schools' "How to Create Popups" page at https://w3schools.com/howto/howto_js_popup.asp. The example included Javascript code. However, the popup didn't work on my site as it did in the example. A script error message appeared saying "unable to get property 'toggle' of undefined or null reference". I looked for a Javascript function in the page source code that would refer to the toggle script, but couldn't find one. I don't know Javascript so I need a little help supplying the requisite function. Can someone help?
  17. Funce

    Universal selector

    You'll need to do H1, h2, h3 and so on https://stackoverflow.com/questions/7539125/can-i-target-all-h-tags-with-a-single-selector
  18. dsonesuk

    Automatic index.html loading

    What you would normally do is use a server language such as php, create a single page with navigation only, with all links with home/index link page first. With this single nav page this can be included in all the other pages, just by using <?php include 'nav.php'; ?> the navigation would be inserted into that page, and any other php page using that code. amending the nav.page, means that amendment would instantly show that amendment for all page using that code also. This gives all the links to other page, on each page, i think this is what you are looking for? yes!
  19. Funce

    Automatic index.html loading

    Have you tried using an .htaccess file? https://stackoverflow.com/questions/17709500/how-to-redirect-all-pages-only-to-index-html-using-htaccess-file-and-not-redirec
  20. dsonesuk

    Universal selector

    As they are part of the same document, representing main title heading and sub headings of importance, No! not really, as they, would come under the same parent element. IF they were scattered anywhere, then they are not used as they were properly intended.
  21. Html

    user id

    Okay, I will respond as soon as the free host is up again, there appears to be downtime. At least I have got this corrected, partially. Thanks
  22. iwato

    A Flexible PHPMailer Factory Class with Traits

    This has already been achieved elsewhere, separately and differently, for each case. I am sure that the five lines of code of which you speak are included in the code that I have described above, else the code would not perform its most essential task. These lines of code, however, are hardly the purpose of my having gone through the trouble of writing the code. This said, do you find any errors in that what I have presented beyond those which Funce has already addressed? Roddy
  23. Funce

    date format change

    Have you seen: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time <input type="time" min="9:00" max="18:00" /> This one works on 24hr time.
  24. smus

    how make many id in one getElementById

    same thing in javascript: var test = document.getElementsByClassName("test"); for (var i=0;i<test.length;i++){ test[i].value = Dotoff; }
  25. smus

    Universal selector

    naive solution, because, hypothetically, headings might be scattered around the document. No, I was just wondering why developers invented such convenient thing, but did not apply it to tag names. Philosophical question
  26. Cristiano

    Automatic index.html loading

    Suppose that someone, after a search on google, finds the link: http://cristianopi.altervista.org/as/pred_irnss-1h.html. If he clicks the link, the page is loaded but he doesn't see the index, but he could be also interested in the other pages. For that reason I need to automatically load also the index.html page.
  27. justsomeguy

    user id

    That code is syntactically correct, but it doesn't do what you think it does. This reminds me of trying to actually speak a different language. My wife speaks Portuguese and Finnish. I feel like this is like me learning a few basic nouns and verbs and then trying to travel to Brazil or Finland and hold an entire conversation with someone without ever taking a class or reading a book, just watching a few videos of native speakers talking. Other than the fact that the code will actually execute now, even though it would show several warnings, your SQL query isn't going to return any results (or, more specifically, it's going to return every user who doesn't have an email address). Can you see why? Since that code will actually run, I suggest you actually run it, look at the warnings from PHP, and try to figure out what the problems are.
  1. Load more activity
×