Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. The web root is the folder on the server which contains your website. It could be called "www", "htdocs", "html" or a variety of other names. Anything inside that folder can be accessed through HTTP with a URL. If the file is outside the web root, you won't need htaccess to protect it because it's already inaccessible.
  2. CSS and, by extension, W3.CSS take care of styling HTML. How the HTML was generated (using PHP, handwritten or otherwise) isn't really relevant to how it's used. If you're generating HTML with PHP then be sure to give the correct classes to the elements. My recommendation is to separate the HTML from the actual business logic and put it into self-contained template files which are included using PHP after everything has been processed.
  3. There's an :after pseudo-element with a background color the same as the page's background color which is positioned in front of an unsplit border.
  4. I'd have to see your code and what the validation errors say to tell you how to fix it. If you're using microdata attributes it's not going to validate because it's using non-standard attributes. I recommend JSON-LD for structured data.
  5. It says in your editor that the exception occurred in LoginTest.java at line 77. You should check to see if the variable row1 is null.
  6. The console should tell you exactly on what line the exception occurred.
  7. You're going to have to tell me what line its on, but usually that means you tried to use an object that wasn't initialized.
  8. The W3Schools tutorials for PHP and SQL have all the information you need. If you need help with something specific in the code you can ask questions about it here.
  9. The syntax source: availableTags is not proper Javascript. If "source" is meant to be a variable you would write source = availableTags; Even if you do assign something to a variable named "source", you're not using the variable anywhere so it wouldn't do anything.
  10. Unless specifically programmed otherwise, the server will serve the same content to everybody. If you have a PHP file that can manipulate files or the database then it's open for everybody to use and is an easy attack vector on your website, if you want to prevent other people from using it you will have to add some form of authentication. In summary, nothing is stopping me from sending a POST request to your web host.
  11. 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.
  12. A super global is available during the execution of the process. What do you mean by passing it to another file? If the file is included, it has access to all the superglobals of the file that included it.
  13. The PHP GD library can't open TIFF files, but it looks like ImageMagick can. If you don't have access to ImageMagick then you'll have to go through the tedious work of building a TIFF reader that parses binary TIFF files and extracts information from them.
  14. The RSS file can go anywhere you want, you just have to tell people where to find it. As I mentioned earlier, you can tell browsers where to find a feed by putting a <link> tag in your HTML page. There's no real best practice as to where to place your RSS feed files. I think RSS feeds have to use absolute URLs in the <link> tags including protocol and domain name to point to the location of the files. If you want a URL like "/feed" for your RSS feed you would have to use URL rewriting on the server, a regular URL would look like this instead: "/feed.xml" or "/feed.rss".
  15. Ingolme

    Tabbed modals

    It looks like the openCity() method takes into account all the tabs in the document rather than the ones inside the modal, you should update the openCity() function to select tabs inside the specified model which you can do by either checking ancestor nodes of the clicked element or passing the ID of the modal as a parameter to the openCity() function. You also need to change this line: document.getElementsByClassName("tablink")[0].click(); You have to call the click() method of the first "tablink" in each modal rather than calling it only on the first one in the whole document.
  16. Ingolme

    Tabbed modals

    I would need to see your code to figure out what the problem is.
  17. Do you know how to write PHP code for MySQL queries?
  18. How are you writing your PHP? PHP has several different database libraries, which one are you using?
  19. e.preventDefault() stops the form from submitting which would reload the page. e.currentTarget points to the form itself, which is the element that fired the submission event. You need to understand Javascript events. Here's the description of addEventListener() and the use of the currentTarget property of the event object: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget I'm amazed there isn't a proper simple tutorial online that explains addEventListener() and the event object clearly. I created the query variable to make a query string to send to the server. The query string contains all the form data in key-value pairs like this: "firstname=John&lastname=Smith". This is how you send form data in a way that the server can understand it. The encodeURIComponent() is used to put values into a URL so that the data arrives properly to the server. For example, the "&" symbol is used to separate fields and "=" is used to associate keys with values, so those symbols need to be encoded. This has nothing to do with security, security is handled by PHP. In Javascript, when a function is defined inside another function it has access to the local variables of that other function, it also can only be used from inside the function that contains it.
  20. Just adding "/feed" to a URL won't show the feed. You have to manually put your feed XML in that URL and have your server send the correct content-type type header of application/rss+xml. Like I said, most content management systems will generate this link for you, but if your website isn't using a content management system or the one you're using doesn't have that feature then you will have to create the URL yourself. I can't verify that it's a common practice to use "/feed" for the feed URL, but I know that the CMS I've been working with does that.
  21. Which part of this are you having trouble with? Surely you know how to convert an IF statement to PHP.
  22. Many CMS will generate the feed link, but it's not created automatically by the browser or server. The feed URL should point to the XML file itself. On your website you can add a <link> tag to indicate that there's a feed so that the RSS icon appears in the navigation bar: <link href="... Feed URL ..." rel="alternate" type="application/rss+xml" title="Give a title to your feed">
  23. Browsers provide a Geolocation API, but there's no way to guarantee that it will work properly if the user does not have a GPS. In order to respect privacy, the user is first asked whether they want to share their location with the website, there is no way around that.
  24. Create another page that's written in English and make a regular hyperlink to that page.
  25. Some RSS readers may embed the podcast in the feed if you have an <enclosure> element, so I would suggest using both <link> and <enclosure> elements to point to the podcast. The <link> element of the <channel> should link to a page where the channel resides, that is a collection of podcasts. The <link> of an <item> would link to an individual podcast. Ideally each podcast should have one page on your site, but if you just want to link to the MP3 I can't tell you if there are any restrictions on that. Namespaces may give you more options, but the elements of each namespace will only work on the software that supports it, for example only iTunes may use the iTunes namespace elements. Here's the official specification of RSS with a description of all the elements: https://cyber.harvard.edu/rss/rss.html
×
×
  • Create New...