NameSilo

[Resolved] After a search is submitted, an error... Help?

Spaceship Spaceship
Watch

Jake

Senior MemberVIP Member
Impact
56
After a search is submitted, an error... Help?

HTML:
<form method="post" action="<?php echo SITE_ROOT; ?>/" class="search">
				<input type="text" name="keyword" class="input" value="<?php echo $keyword; ?>" />
				<input type="submit" value="Search" class="button" />
			</form>

That is my search submit, and basically, im trying to get the page to go to (Their Search).html

www.dncraze.info

I have tried insterting a couple different codes into it, but they all turn up not working, or working incorrectly.

What should i do?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Simple, the form is going to a nonexistant page. Check your SITE_ROOT variable.
 
0
•••
right, but what i need is the code to insert.
 
0
•••
I don't know, what page are you trying to go to?
 
0
•••
(search).html

like, whatever they search.html
 
0
•••
HTML Form
HTML:
<form method="post" action="script.php" class="search">
<input type="text" name="keyword" class="input" value="" />
<input type="submit" value="Search" class="button" /> </form>

script.php
PHP:
<?php
header("Location: /{$_POST['keyword']}.html");
?>

You will still get a 404 error unless (keyword).html exists.
 
0
•••
Ill try that!

Thanks!
 
0
•••
Mikor said:
HTML Form
HTML:
<form method="post" action="script.php" class="search">
<input type="text" name="keyword" class="input" value="" />
<input type="submit" value="Search" class="button" /> </form>

script.php
PHP:
<?php
header("Location: /{$_POST['keyword']}.html");
?>

You will still get a 404 error unless (keyword).html exists.

Before doing something like that you should really sanitize the users input otherwise they can forward it anywhere (including a page on an external site)
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back