Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:10:04+00:00 2026-06-12T10:10:04+00:00

I have a scenario where a user when clicks on a link, they are

  • 0

I have a scenario where a user when clicks on a link, they are directed to a page in which I want to add a code to fetch a variable and redirect to another page.

i.e. user clicks on <a href="sample.tpl">click here</a>

on sample.tpl I want to write a code to redirect him to another page

<script>
window.location="http://example.com/?page_id=10"

but I want to send a variable too on this new link without appending it to the URL for security reasons.

How can I do it with some safe procedure?

Do ask me questions if it is not clear.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:10:05+00:00Added an answer on June 12, 2026 at 10:10 am

    You could create a form with method="post", a hidden input with the value you want to pass and a submit button styled as a regular link (if you want to also manually send the form).

    Then just submit the form manually or programmatically through the submit() method


    Example (with automatic redirect after 3 seconds after page load)
    http://jsbin.com/avacoj/1/edit

    Html

    <form method="post" action="http://mydomain.com/" id="f">
       <input type="hidden" name="page_id" value="10">
       <noscript><button type="submit">Continue</button></noscript> /* see below */
    </form>
    

    Js

    window.onload = function() {
      var frm = document.getElementById('f');
      setTimeout(function() {
          frm.submit();
      }, 3000);
    };
    

    As a side note you may consider to insert a submit button inside <noscript></noscript> tag so the redirect will be possibile even when js is not available on the user device, so the page is still accessible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: I have a login page which uses ajax to validate a user and
I have the following scenario: in activity A, when a user clicks a button,
I have the following scenario: A user on one our customer's website clicks a
Scenario: I have a CaseEdit.aspx page in which on have 3 buttons: AddImage FinalPage
I have to login a user through drupal code having userID... basically the scenario
I have a scenario where the user clicks on a UIButton and the event
Scenario: I have an administration-application which manages the user accounts for another application. Now
I have a scenario where a user will have access to a one-time-url. When
I have a scenario where a user is emailing another user in an HTML
I have a scenario where a user submits a start and stop date for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.