Skip to content
CoursesWeb Forum

Stuck on your code? Ask the CoursesWeb forum.

23 threads, 74% answered. Search before you ask. The answer is usually here.

Sections
  1. •

    How do I give Copilot project instructions so it stops guessing my stack

    I maintain a handful of client sites. Plain PHP 8.3 with PDO, no framework, MariaDB, and vanilla JavaScript on the front end. Copilot Chat in VS Code keeps...

    3replies
  2. •

    Why does my footer float up into the middle of the page when content is short

    Attempt number 5 at this and I am still stuck, so I am asking. My portfolio has a header, a main section and a footer. On the pages with a lot of text it is...

    2replies
  3. ✓

    Should a clickable thing be a button or a div with onclick

    I am a designer moving into front end code, and I am rebuilding a pricing toggle from a design file. The developer before me wrote it like this: It looks right...

    HTML Structure and SemanticsNoor A.Answered
    4replies
  4. ?

    How do I get the value of the selected radio button in JavaScript

    I am building a tiny quiz page for my coding club. Each question has three radio buttons and a Check button. I tried this:

    JavaScript and the DOMOdalys F.
    0replies
  5. •

    ChatGPT gave me a fetch example that works locally but fails with a CORS error online

    hi everyone, im making a little game site with a high score table. i asked chatgpt for the code to load the scores and it gave me this fetch:

    3replies
  6. ✓

    Flexbox items will not wrap onto the next line on mobile

    Hello. I am building a row of product cards with flexbox. On desktop it is fine. On my phone (375px wide) the cards do not go to the next line. They stay in...

    CSS Layout: Flexbox and GridGaelle R.Answered
    5replies
  7. •

    Is it still worth learning jQuery in 2026 if I maintain an old site

    Some background. In 2011 I wrote a hobby site for my model railway club: table layouts, a lot of jQuery for the slideshow, the menu and a little form check. It...

    4replies
  8. •

    My PHP contact form sends a blank email when someone submits it

    I keep a small ordering page alive for my family's restaurant and I added a contact form to it last night. When I fill it in and press Send, the email arrives...

    3replies
  9. ✓

    In what order should I learn HTML, CSS, JavaScript and PHP?

    Learn them in this order: HTML first, then CSS, then JavaScript in the browser, then PHP with MySQL. Each layer builds on the one before and gives you...

    Learning Path and First ProjectsTeodora VanceStaff answer
    1reply
  10. ✓

    What is an MCP server and do I need one as a beginner?

    An MCP server is a small program that lets an AI application reach an outside system, such as files, a database or an issue tracker, in a standard way. You do...

    AI Coding Assistants and MCPCallum IwuStaff answer
    1reply
  11. ✓

    Can I trust code that ChatGPT or Copilot writes while I am learning?

    Treat it as a draft from a fast helper that sometimes sounds sure and is wrong. It is useful for explanations and first versions, but you are the one who runs...

    AI Coding Assistants and MCPCallum IwuStaff answer
    1reply
  12. ✓

    How do I fix Cannot use import statement outside a module in Node.js?

    Node.js is treating your file as CommonJS, where import is not allowed. Tell Node the file is an ES module: add "type": "module" to the nearest package.json...

    Node.js and Server Side JavaScriptCallum IwuStaff answer
    1reply
  13. ✓

    How do I convert a stdClass object to an array in PHP?

    Cast it with (array) $obj to get an array of its properties. That only converts the top level, so nested objects stay objects. If the object came from...

    PHP Forms, Sessions and BasicsCallum IwuStaff answer
    1reply
  14. ✓

    How do I use prepared statements with mysqli or PDO in PHP?

    Write the SQL with a placeholder where each value goes, prepare it, bind the values separately, then execute. The database treats the values as data, never as...

    MySQL Queries from PHPCallum IwuStaff answer
    1reply
  15. ✓

    How do I handle GET and POST form data safely in PHP?

    Read GET data from $GET and POST data from $POST, then treat every value as untrusted. Check that it exists, check its type and length, and escape it with...

    PHP Forms, Sessions and BasicsCallum IwuStaff answer
    1reply
  16. ✓

    What does mysqli_query() expects parameter 1 to be mysqli mean?

    It means the first value you gave mysqliquery() is not a database connection. Usually the connection variable is empty, false, or a different type, because the...

    Error Messages ExplainedCallum IwuStaff answer
    1reply
  17. ✓

    Why is my CSS rule ignored? How does specificity decide which rule wins?

    When two rules set the same property on one element, the browser scores each selector and the higher score wins. An id counts most, then classes, attributes...

    CSS Styling and SelectorsTeodora VanceStaff answer
    1reply
  18. ✓

    How do I convert old jQuery code to plain JavaScript?

    Convert it one habit at a time, not all at once. Replace $() with document.querySelector or querySelectorAll, .on() with addEventListener, .addClass() with...

    jQuery and Older Front End CodeTeodora VanceStaff answer
    1reply
  19. ✓

    How do I clear a form after sending it with fetch or AJAX?

    Call the form's reset method after the server has answered successfully, not before. Stop the normal submit with preventDefault, send the fields with fetch and...

    JavaScript Events, Timers and FetchTeodora VanceStaff answer
    1reply
  20. ✓

    querySelector or querySelectorAll: which one should I use?

    Use querySelector when you need one element: it returns the first match, or null if there is none. Use querySelectorAll when you need every match: it returns a...

    JavaScript and the DOMTeodora VanceStaff answer
    1reply
CoursesWeb Forum. Questions and answers on learning web development: HTML, CSS, JavaScript, PHP, MySQL, Node.js and AI coding help.