Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      Handling JavaScript Event Listeners With Parameters

      July 21, 2025

      ChatGPT now has an agent mode

      July 21, 2025

      Scrum Alliance and Kanban University partner to offer new course that teaches both methodologies

      July 21, 2025

      Is ChatGPT down? You’re not alone. Here’s what OpenAI is saying

      July 21, 2025

      I found a tablet that could replace my iPad and Kindle – and it’s worth every penny

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 21, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 21, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Execute Ping Commands and Get Back Structured Data in PHP

      July 21, 2025
      Recent

      Execute Ping Commands and Get Back Structured Data in PHP

      July 21, 2025

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 21, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 21, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      I Made Kitty Terminal Even More Awesome by Using These 15 Customization Tips and Tweaks

      July 21, 2025
      Recent

      I Made Kitty Terminal Even More Awesome by Using These 15 Customization Tips and Tweaks

      July 21, 2025

      Microsoft confirms active cyberattacks on SharePoint servers

      July 21, 2025

      How to Manually Check & Install Windows 11 Updates (Best Guide)

      July 21, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: The Variable Toggle

    CodeSOD: The Variable Toggle

    April 21, 2025

    A common class of bad code is the code which mixes server side code with client side code. This kind of thing:

    <script>
        <?php if (someVal) { ?>
            var foo = <? echo someOtherVal ?>;
        <?php } else { ?>
            var foo = 5;
        <?php } ?>
    </script>
    

    We’ve seen it, we hate it, and is there really anything new to say about it?

    Well, today’s anonymous submitter found an “interesting” take on the pattern.

    <script>
        if(linkfromwhere_srfid=='vff')
          {
        <?php
        $vff = 1;
        ?>
          }
    </script>
    

    Here, they have a client-side conditional, and based on that conditional, they attempt to set a variable on the server side. This does not work. This cannot work: the PHP code executes on the server, the client code executes on the client, and you need to be a lot more thoughtful about how they interact than this.

    And yet, the developer responsible has done this all over the code base, pushed the non-working code out to production, and when it doesn’t work, just adds bug tickets to the backlog to eventually figure out why- tickets that never get picked up, because there’s always something with a higher priority out there.

    [Advertisement]
    Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleZentyal Server is a unified network server Linux distribution
    Next Article CVE-2025-0632 – Formulatrix Rock Maker Web Local File Inclusion Vulnerability

    Related Posts

    News & Updates

    Is ChatGPT down? You’re not alone. Here’s what OpenAI is saying

    July 21, 2025
    News & Updates

    I found a tablet that could replace my iPad and Kindle – and it’s worth every penny

    July 21, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    I’ve been loving the upgrade to my favorite mobile controller, and there’s even a version for large tablets

    News & Updates

    CVE-2025-44861 – TOTOLINK CA300-POE Command Injection

    Common Vulnerabilities and Exposures (CVEs)

    NVIDIA AI Releases Introduce UltraLong-8B: A Series of Ultra-Long Context Language Models Designed to Process Extensive Sequences of Text (up to 1M, 2M, and 4M tokens)

    Machine Learning

    CVE-2025-5073 – FreeFloat FTP Server Buffer Overflow Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    LaunchDarkly adds new features to help developers release faster while mitigating risk

    May 14, 2025

    At its annual developer conference, LaunchDarkly announced a number of new features across its platform…

    U.S. Dismantles DanaBot Malware Network, Charges 16 in $50M Global Cybercrime Operation

    May 23, 2025

    Amazon Gaming Week 2025

    April 25, 2025

    Chinese Hackers Exploit Microsoft Exchange Servers to Steal COVID-19 Research Data

    July 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.