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

  • Home
  • SEARCH
  • 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 8510751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:47:26+00:00 2026-06-11T03:47:26+00:00

I want to direct my html file based on the condition given by user

  • 0

I want to direct my html file based on the condition given by user in the front end (i.e. in the same html file itself).

Like if user enters code 789 it should direct to a specific folder u57.php and if it user enters 783 it should direct to the folder u38.php

i wrote a code, but it doesn’t work properly…

$a = 57;
$b = 38;
$residue = $_POST["residue"];

<?php if($residue == "$a") { ?>
     <form method="POST" action="u57.php" enctype="multipart/form-data">
<?php } ?>

<?php if ($residue == "$b") { ?>
       <form method="POST" action="u38.php" enctype="multipart/form-data">
    <?php } ?>   

Its directing to only the same page u57.php, if user enters 38 or any other number like 40, 45, 1 ,2 . Please tell me whats wrong with my code?

  • 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-11T03:47:27+00:00Added an answer on June 11, 2026 at 3:47 am

    Hope this Works, (Just removed the Double Quotes for Condition Check)

    $a = 57;
    $b = 38;
    $residue = $_POST["residue"];
    
    <?php if($residue == $a) { ?>
         <form method="POST" action="u57.php" enctype="multipart/form-data">
    <?php } ?>
    
    <?php if ($residue == $b) { ?>
           <form method="POST" action="u38.php" enctype="multipart/form-data">
        <?php } ?> 
    
    • UPDATE

    Here is the sample i did,

    INDEX.PHP

    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title></title>
        </head>
        <body>
            <form method="POST" action="redirect.php">
                Value : <input type="text" name="residue" value=""/>
                <input type="submit" name="submit" value="Submit"/>
            </form>
        </body>
    </html>
    

    REDIRECT.PHP

    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title></title>
        </head>
        <body>
            <?php
            $a = 57;
            $b = 38;
            $residue = $_POST["residue"];
            ?>
            <?php if ($residue == $a) {
                ?>
                <form method="POST" action="u57.php" enctype="multipart/form-data">
                    <input type="text" name="sample" value=""/>
                </form>
            <?php } ?>
    
            <?php if ($residue == $b) { ?>
    

    This Works for me….

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

Sidebar

Related Questions

I want to prevent direct access my install.php file, unless the user has gone
I want to use .htaccess file to return homepage (index.html) if direct access to
I have a file with .php extention www.example.com/thefile.php?name=123 that I want to direct the
I have a form, when user submit the form, I want to direct the
Like here: Automatic authentication for Android WiFi Direct I want to create a mobile
I have a checkbox that I do not want the user to have direct
I have a site with homepage as /var/www/mysite/index.html Now I want to direct www.mysite.com/x2312d
The marketing people want to have the ability to write direct inline HTML in
I have an html file that gets loaded when a user connects a flash
I have an html file that I want to dynamically edit before displaying to

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.