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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:54:31+00:00 2026-05-14T00:54:31+00:00

I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that

  • 0

I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that exist, the search works, but on 404 pages, it does not.

I saw some bugs/patches threads over at drupal.org for D6.15, but none of them seem to work according to the thread and they weren’t really relevant to D5.x

I have a theory that the because the <?php print $search_box; ?> creates a form with an action to itself(a non-existant page), it’ll get the 404.

Has anyone run up against this? If so, how did you fix it?

One theory I has was to somehow tap into the form and always make the action=”/” (front page) which would always exist.

If this is a good idea, how does one go about tapping into the FormAPI and overwriting the action? Is it a preprocess function?

  • 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-05-14T00:54:31+00:00Added an answer on May 14, 2026 at 12:54 am
    1. In a form alter you can use drupal_get_headers() to check if the page being displayed is a 404.
    2. If it is a 404, you can in your form alter set the $form['#action'] attribute in your search form to fx the front page or any other page that you would like to redirect the user to.

    I haven’t tested this, but it should work.

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

Sidebar

Related Questions

I have a php page with 3 different forms. I create 3 separate print
I currently have a MySQL database that I am accessing using PHP. You search
I have three files in a folder 'test' one.php two.php print.html And i have
Background: Suppose I have the following obviously-incorrect PHP: try{ $vtest = ''; print(array_pop($vtest)); }catch(Exception
I have a simple PHP app that prints 'hello world'. When I run it
I have created an array in php that prints this Array ( [mark] =>
I have php script that creates a temporary watermark image for users that are
I have PHP scrip that goes like this: if ($cost_frm < $cost){ echo <script
I have php scripts that do things like register, login, upload. I would like
I have the following php loop that takes an array that contains a set

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.