Monday, 2 November 2026

subscribe popup code in java script

 <style>


#subscribeFloat{


    position:fixed;

    left:-235px;

    top:50%;

    transform:translateY(-50%);


    z-index:9999;


    transition:0.4s;

}


#subscribeFloat:hover{

    left:0;

}


#subscribeFloat a{


    display:flex;

    align-items:center;

    gap:10px;


    background:linear-gradient(90deg,#ff9800,#ff5722);


    color:#fff;

    font-weight:bold;

    text-decoration:none;


    padding:14px 18px;


    border-radius:0 12px 12px 0;


    box-shadow:0 4px 15px rgba(0,0,0,0.25);


    font-size:16px;


    letter-spacing:0.3px;


    white-space:nowrap;

}


#subscribeFloat .icon{

    font-size:22px;

}


/* Mobile */


@media(max-width:768px){


    #subscribeFloat{

        left:-195px;

        top:70%;

    }


    #subscribeFloat a{


        font-size:13px;


        padding:10px 14px;

    }


}


</style>


<!-- Floating Subscribe Button -->


<div id='subscribeFloat'>


<a href="javascript:void(0);" onclick="goSubscribe()">


<span class='icon'>📩</span>


<span>Subscribe Newsletter</span>


<span class='icon'>➤</span>


</a>


</div>


<script>


function goSubscribe(){


    let currentUrl =

    window.location.pathname +

    window.location.search;


    window.location.href =

    'subscribe.php?url=' +

    encodeURIComponent(currentUrl);

}


</script>

Saturday, 10 October 2026

How to show popup once per session on link click

 Learn how to display a custom ad popup only once per session when a user clicks any link on your website using pure HTML, CSS, and JavaScript. This script intercepts the link click, shows the popup, uses sessionStorage to track the user, and smoothly redirects them to their destination.

Complete Code (HTML + CSS + JavaScript)

<!-- CSS Styling for Popup Overlay -->

<style>
#adquashPopupOverlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.75);
    z-index:999999;
    justify-content:center;
    align-items:center;
    padding:15px;
    box-sizing:border-box;
}

#adquashPopup{
    width:100%;
    max-width:500px;
    background:#fff;
    border-radius:14px;
    padding:15px;
    position:relative;
    text-align:center;
    box-shadow:0 10px 30px rgba(0,0,0,.35);
    animation:popupFade .3s ease;
}

#adquashPopup img{
    width:100%;
    display:block;
    border-radius:10px;
}

#adquashClose{
    position:absolute;
    top:20px;
    right:12px;
    width:36px;
    height:36px;
    line-height:36px;
    border-radius:50%;
    background:red;
    color:#fff;
    font-size:24px;
    font-weight:bold;
    cursor:pointer;
    user-select:none;
}

#adquashBtn{
    display:inline-block;
    margin-top:15px;
    padding:12px 24px;
    background:#ff6b00;
    color:#fff;
    text-decoration:none;
    border-radius:8px;
    font-weight:bold;
}

@keyframes popupFade{
    from{opacity:0;transform:scale(.9);}
    to{opacity:1;transform:scale(1);}
}
</style>

<!-- HTML Markup for Popup -->
<div id="adquashPopupOverlay">
    <div id="adquashPopup">
        <div id="adquashClose">&times;</div>
        <a href="https://gridbot.adquash.com/kucoin-dca-bot.html" target="_blank">
            <img src="https://aksharhanumandham.in/ads/kucoin.png" loading="lazy" alt="Advertisement">
        </a>
        <a href="https://gridbot.adquash.com/kucoin-dca-bot.html" target="_blank" id="adquashBtn">
            Visit Now
        </a>
    </div>
</div>

<!-- JavaScript Logic -->
<script>
(function(){
    if(sessionStorage.getItem("adquashPopupShown")){
        return;
    }

    let targetUrl="";
    const overlay=document.getElementById("adquashPopupOverlay");
    const popup=document.getElementById("adquashPopup");

    document.addEventListener("click",function(e){
        const link=e.target.closest("a");
        if(!link) return;

        // Popup ke andar ke links normal chalenge
        if(link.closest("#adquashPopup")) return;

        // Agar pehle hi dikh chuka hai
        if(sessionStorage.getItem("adquashPopupShown")) return;

        e.preventDefault();
        targetUrl=link.href;
        sessionStorage.setItem("adquashPopupShown","1");
        overlay.style.display="flex";
    },true);

    // Close button event
    document.getElementById("adquashClose").onclick=function(){
        overlay.style.display="none";
        if(targetUrl){
            location.href=targetUrl;
        }
    };

    // Outside click event
    overlay.addEventListener("click",function(e){
        if(e.target===overlay){
            overlay.style.display="none";
            if(targetUrl){
                location.href=targetUrl;
            }
        }
    });

    // Popup ke andar click hone par close na ho
    popup.addEventListener("click",function(e){
        e.stopPropagation();
    });
})();
</script>

Sunday, 2 August 2026

UPI QR Code generator code in html

Generate your own UPI QR Code easily with this simple HTML code.

Just copy and paste this code into your website or GitHub Pages, replace "yourupiid@amazonpay" with your own UPI ID, and save the file.

Enter the name and donation amount to create a custom UPI QR Code. Anyone can scan the QR code using any UPI app and make a payment directly to your UPI account.

No database, no server, and no setup required — it works completely on the browser.

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />


<title>UPI QR Code Generator</title>


<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>


<style>

    body{

        font-family: Arial, sans-serif;

        background:#f4f4f4;

        margin:0;

        padding:20px;

    }


    .container{

        max-width:420px;

        margin:auto;

        background:#fff;

        padding:25px;

        border-radius:12px;

        box-shadow:0 0 10px rgba(0,0,0,0.1);

        text-align:center;

    }


    h2{

        margin-bottom:20px;

    }


    input{

        width:100%;

        padding:12px;

        margin-bottom:15px;

        border:1px solid #ccc;

        border-radius:8px;

        font-size:16px;

        box-sizing:border-box;

    }


    button{

        width:100%;

        padding:12px;

        border:none;

        border-radius:8px;

        background:#0d6efd;

        color:#fff;

        font-size:16px;

        cursor:pointer;

    }


    button:hover{

        background:#0b5ed7;

    }


    #message{

        margin-top:20px;

        font-size:18px;

        font-weight:bold;

        color:#222;

    }


    #qrcode{

        margin-top:20px;

        display:flex;

        justify-content:center;

    }


    .upi-text{

        margin-top:10px;

        color:#666;

        font-size:14px;

    }

</style>

</head>

<body>


<div class="container">


    <h2>UPI QR Generator</h2>


    <input type="text" id="name" placeholder="Enter Name" />


    <input type="number" id="amount" placeholder="Enter Amount" />


    <button onclick="generateQR()">Generate QR Code</button>


    <div id="message"></div>


    <div id="qrcode"></div>


    <div class="upi-text">

        UPI ID: yourupiid@amazonpay

    </div>


</div>


<script>


function generateQR(){


    let name = document.getElementById("name").value.trim();

    let amount = document.getElementById("amount").value.trim();


    if(name === "" || amount === ""){

        alert("Please fill all fields");

        return;

    }


    let upiID = "yourupiid@amazonpay";


    let note = `Prayer and blessings for ${name} donate amount`;


    let upiLink = `upi://pay?pa=${upiID}&pn=${encodeURIComponent(name)}&am=${amount}&cu=INR&tn=${encodeURIComponent(note)}`;


    document.getElementById("message").innerHTML =

        `Prayer and blessings for <b>${name}</b> donate ₹${amount}`;


    document.getElementById("qrcode").innerHTML = "";


    new QRCode(document.getElementById("qrcode"), {

        text: upiLink,

        width: 250,

        height: 250

    });


}


</script>


</body>

</html>

Wednesday, 15 April 2026

One click open two link upgraded version

 

One click open two link

Craete single link for double link. Given code open two link first link send https://www.profitablecpmratenetwork.com and second link open same page

Just copy and paste this code and replace url link as per your need.

view old code 

Click for Demo

<a href="https://www.profitablecpmratenetwork.com/ka9w8m66?key=9ef4829d333930832621abd4b2481d67" id="smartLink">Click</a>


<script>

(function(){


  document.addEventListener("touchstart", function(){}, {once:true});


  var link = document.getElementById("smartLink");


  const KEY_TIME = "popTime";

  const KEY_DONE = "popDone";

  const EXPIRY = 30 * 60 * 1000; // 30 minutes


  function isExpired(){

      let t = sessionStorage.getItem(KEY_TIME);

      if(!t) return true;


      let now = Date.now();

      return (now - parseInt(t)) > EXPIRY;

  }


  link.addEventListener("click", function(e){


    let sessionActive = sessionStorage.getItem(KEY_DONE) === "1";

    let expired = isExpired();


    // 👉 If session exists AND NOT expired → open blogspot same tab

    if(sessionActive && !expired){


        e.preventDefault();


        window.location.href = "https://simplephpcoding.blogspot.com/2026/04/one-click-open-two-link-upgraded-version.html";

        return;

    }


    // 👉 FIRST CLICK or EXPIRED SESSION → AD FLOW

    sessionStorage.setItem(KEY_DONE, "1");

    sessionStorage.setItem(KEY_TIME, Date.now());


    var w = window.open(

        "https://simplephpcoding.blogspot.com/2026/04/one-click-open-two-link-upgraded-version.html",

        "_blank"

    );


    if(w){

        w.blur();

        window.focus();

    }


});


})();

</script>

Monday, 2 March 2026

Combine GZIP, Browser Caching, and 304 Not Modified for Maximum Website Performance

 If you want serious speed improvements on shared hosting (especially DirectAdmin), enabling just one optimization is not enough. For best performance, you should combine:

  • GZIP Compression
  • Browser Caching
  • 304 Not Modified Headers

Together, these three techniques reduce bandwidth usage, server load, and page load time — without changing your PHP application logic.


1️⃣ GZIP Compression – Reduce File Size by 50–80%

GZIP compresses HTML, CSS, JS, and JSON files before sending them to the browser. The browser automatically decompresses the files.

Why It Matters

  • Smaller file size
  • Faster mobile loading
  • Reduced bandwidth usage
  • Better Core Web Vitals

Enable GZIP in .htaccess

 

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json
</IfModule>

 

No PHP changes required.


2️⃣ Browser Caching – Prevent Re-Downloading Static Files

Browser caching tells the visitor’s browser:

“Keep this file for X days. Don’t download it again.”

This is especially powerful for:

  • CSS files
  • JavaScript
  • Images
  • Logos

Add Browser Caching Rules

 

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
</IfModule>

 

Now returning visitors won’t re-download the same files again.


3️⃣ 304 Not Modified – Skip Sending Unchanged Content

When a visitor reloads a page, the browser asks:

“Has this file changed?”

If it hasn’t, the server responds with:

 

HTTP/1.1 304 Not Modified

 

No file is sent again.

Why This Is Powerful

  • Saves server bandwidth
  • Reduces server processing
  • Speeds up reload time
  • Helps search engine crawlers

Basic 304 Support (Automatic in Apache)

Apache usually handles 304 automatically when:

  • Last-Modified header is present
  • ETag header is enabled

Most shared hosting environments already support this.


How These Three Work Together

OptimizationWhat It ReducesImpact
GZIPFile sizeFaster first load
Browser CacheRepeat downloadsFaster returning visits
304 HeaderUnnecessary re-sendingFaster reloads

Real-World Example

Without optimization:

  • Homepage size: 120KB
  • Every reload: 120KB transferred

With all three enabled:

  • First visit: ~30–40KB (compressed)
  • Next visit: Almost zero transfer (cached + 304)

That’s a massive difference — especially during traffic spikes.


Why This Matters for Shared Hosting

If you’re running:

  • A JSON-based homepage
  • A cached PHP site
  • A blog, news portal, or affiliate site
  • A high-traffic single server setup

This combination helps you:

  • Handle more users on the same hosting plan
  • Reduce CPU load
  • Lower bandwidth consumption
  • Improve SEO rankings

Final Recommendation

If you are using DirectAdmin or shared hosting, add:

  1. GZIP rules
  2. Browser caching rules
  3. Ensure 304 headers are active

These three together create a lightweight, high-performance environment — even without upgrading your server.

How to Enable GZIP Compression in DirectAdmin Step-by-Step Guide

If you're using DirectAdmin hosting and want to speed up your website without changing any PHP code, enabling GZIP compression is one of the easiest and most effective optimizations you can make.

GZIP reduces the size of your website files before they are sent to the visitor’s browser. The browser automatically decompresses them, so users never notice anything—except faster loading speed.


What Is GZIP Compression?

GZIP is a server-side compression method. When a user visits your site:

  1. The server compresses HTML, CSS, JS, and JSON files.
  2. The browser downloads a much smaller file.
  3. The browser decompresses it automatically.

This can reduce page size by 50–80%, especially for text-based content.


Why Enable GZIP in DirectAdmin?

If you're running:

  • A JSON-based homepage
  • A no-database setup
  • A cached website
  • A high-traffic blog or news portal

Then enabling GZIP will:

  • Reduce bandwidth usage
  • Improve mobile load speed
  • Improve SEO performance
  • Lower server load during traffic spikes

How to Enable GZIP in DirectAdmin

Step 1: Log into DirectAdmin

Access your hosting panel.

Step 2: Open File Manager

Go to your website's main folder:

 

public_html

 

Step 3: Edit .htaccess

Open the .htaccess file.
If it does not exist, create a new one.

Step 4: Add This Code

 

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json
</IfModule>

 

Save the file.

That's it. No changes needed in your PHP files.


How to Check If GZIP Is Working

  1. Open your website.
  2. Right-click → Inspect.
  3. Go to the Network tab.
  4. Reload the page.
  5. Click on the main HTML file.
  6. Look for:

 

Content-Encoding: gzip

 

If you see that, GZIP is active.


Does DirectAdmin Support GZIP?

In most shared hosting environments using DirectAdmin, mod_deflate is already enabled. If the above code works without error, you're good to go.

If your server uses Nginx as a reverse proxy, GZIP may already be enabled at the server level.


Final Thoughts

Enabling GZIP in DirectAdmin is:

  • Safe
  • Easy
  • Free
  • Code-independent
  • Highly effective

For best performance, combine GZIP with browser caching and 304 Not Modified headers.

If you're building a fast, scalable, low-IO website, this is a must-have optimization.