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 8990849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:35:37+00:00 2026-06-15T22:35:37+00:00

I am trying to create the following condition 1) User visits page 2) User

  • 0

I am trying to create the following condition

1) User visits page
2) User enters code
3) If the code is valid, the user enters a page corresponding to the code
4) If the code is not valid, the user fails

This is so that people can view certain PDFs for an apartment rentals company.

What I would like to do, is to create a form, with an input for the special code.

When the form is submitted, it will simply redirect to url.com/[[value of input]].php

I tried creating a PHP handler to do this, but when I try it out, I get a blank page. I have limited experience with PHP, so I might be off on a completely wrong path.

Thoughts greatly appreciated on this

Here’s my form

  <form id="enter_code" name="enter_code" action="code_handler.php" method="post">

        <label for="code">Enter Your Apartment Code</label>
        <input id="code" name="code" size="30" type="text" />

        <input class="button" name="commit" style="font-weight:normal" type="submit" value="Sign in" />

  </form>

and here’s my code_handler.php

<?php

   header( 'Location: http://www.opohills.com/guests/pdf/<?=htmlspecialchars($_POST['code'], ENT_COMPAT)?>.php' ) ;

?>
  • 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-15T22:35:39+00:00Added an answer on June 15, 2026 at 10:35 pm

    Why using php within php

    header( 'Location: http://www.opohills.com/guests/pdf/'.htmlspecialchars($_POST['code'], ENT_COMPAT).'.php' ) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple web page that resembles the following: I've got
I'm trying to create a regular expression that matches words with the following condition:
i am trying to create an .htaccess file that will achieve the following create
I'm trying to create a new function in SQL with the following code: CREATE
I am trying to create an android app that has the following: Theme set
I'm trying to create a link so that if the current user has a
I am currently trying to create a multi-page form that uses both jQuery and
I'm trying to create the following WHERE clause: AND CASE @SomePRarmeter WHEN 'this' THEN
i'm trying to create following layout: http://jsfiddle.net/BTuMH/1/ but without setting the width, like: http://jsfiddle.net/yuGyg/
New with Android. Sorry! I'm trying to create the following... Wait for Timer 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.