<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en"
         xmlns:mml="http://www.w3.org/1998/Math/MathML">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher">BJCR</journal-id>
      <journal-title-group>
        <journal-title xml:lang="en">British Journal of Contemporary Research</journal-title>
        <abbrev-journal-title xml:lang="en">BJCR</abbrev-journal-title>
      </journal-title-group>
      <issn>2979-8582</issn>
      <publisher>
        <publisher-name>Bexford Publishing Ltd</publisher-name>
        <publisher-loc><uri>https://bexfordpublishing.co.uk</uri></publisher-loc>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="publisher-id">BEX_JUL_26_037</article-id>
      <article-id pub-id-type="doi">10.67693/BJCR-D756D3BR</article-id>
      <article-categories>
        <subj-group xml:lang="en" subj-group-type="heading">
          <subject>Meta-Analysis</subject>
        </subj-group>
      </article-categories>
      <title-group>
        <article-title xml:lang="en">A Comparative Analysis of SQL Injection and XSS Vulnerabilities: From Exploitation to Secure Implementation in PHP Applications</article-title>
      </title-group>
      <contrib-group content-type="author">
      <contrib corresp="yes">
        <name-alternatives>
          <name name-style="western" specific-use="primary">
            <given-names>Orji Cyrus Ebere MCPN</given-names>
          </name>
        </name-alternatives>
        <email>cyrus.orji@imopoly.edu.ng</email>
        <bio xml:lang="en"><p>Department of Computer Science, Imo State Polytechnic Omuma Nigeria, Nigeria</p></bio>
      </contrib>
      <contrib>
        <name-alternatives>
          <name name-style="western" specific-use="primary">
            <given-names>Ukachukwu, Theddius N</given-names>
          </name>
        </name-alternatives>
        <email>theddius.ukachukwu@imopoly.edu.ng</email>
        <bio xml:lang="en"><p>Department of Computer Science, Imo State Polytechnic Omuma Nigeria</p></bio>
      </contrib>
      <contrib>
        <name-alternatives>
          <name name-style="western" specific-use="primary">
            <given-names>Anumudu, Damain U</given-names>
          </name>
        </name-alternatives>
        <email>damian@nncaf.edu.ng</email>
        <bio xml:lang="en"><p>Nigeria Navy College of Accounts and Finance Owerrinta, Nigeria</p></bio>
      </contrib>
      </contrib-group>
      <pub-date date-type="pub" publication-format="epub">
        <day>10</day>
        <month>08</month>
        <year>2026</year>
      </pub-date>
      <volume>1</volume>
      <issue>3</issue>
      
      
      <pub-history>
        <event event-type="received">
          <event-desc>Received: <date date-type="received">
            <day>06</day>
            <month>07</month>
            <year>2026</year>
          </date></event-desc>
        </event>
        
        <event event-type="accepted">
          <event-desc>Accepted: <date date-type="accepted">
            <day>14</day>
            <month>07</month>
            <year>2026</year>
          </date></event-desc>
        </event>
      </pub-history>
      <permissions>
        <copyright-statement>Copyright (c) 2026 Orji Cyrus Ebere MCPN</copyright-statement>
        <copyright-year>2026</copyright-year>
        <license xlink:href="https://creativecommons.org/licenses/by/4.0">
          <license-p>This work is licensed under a Creative Commons Attribution 4.0 International License.</license-p>
        </license>
      </permissions>
      <abstract><p>Abstract:
SQL Injection (SQLi) and Cross-Site Scripting (XSS) persist as key security vulnerabilities in web applications, continuously featured in the OWASP Top 10. This research offers a thorough comparative investigation of these vulnerabilities by developing a dual-version PHP/MySQL web application-one designed to be vulnerable and the other safely implemented. The research illustrates SQL injection exploitation through authentication circumvention, UNION-based data retrieval, and Boolean-based blind injection methods, in addition to stored and reflected cross-site scripting assaults. The susceptible version utilizes insecure coding methodologies, such as string concatenation in SQL queries, unsanitized output, raw password storage, and absent access controls. The secure version employs prepared statements via PDO, output encoding with htmlspecialchars(), bcrypt for password hashing, session-based authentication, CSRF tokens, and extensive security headers. Experimental findings indicate that the secure implementation effectively neutralizes all exhibited attack avenues, attaining a 95% enhancement in security compared to the susceptible version. The automated testing suite, created with cURL and PHP, programmatically checks both versions, underscoring the significance of including security testing into the development lifecycle. This research offers pragmatic, evidence-based recommendations for developers creating secure PHP applications and enhances the scholarly discussion on online application security.</p></abstract>
    </article-meta>
  </front>
  <body/>
</article>