NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] After a search is submitted, an error... Help?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 09-03-2007, 10:54 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Jake's Avatar
Join Date: Jul 2007
Location: Texas, Ya'll
Posts: 1,710
Jake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud of
 



After a search is submitted, an error... Help?


HTML Code:
<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
????: NamePros.com http://www.namepros.com/programming/369743-resolved-after-search-submitted-error-help.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?
Jake is offline  
Old 09-03-2007, 11:39 AM   #2 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Simple, the form is going to a nonexistant page. Check your SITE_ROOT variable.
Barrucadu is offline  
Old 09-03-2007, 11:58 AM THREAD STARTER               #3 (permalink)
Senior Member
 
Jake's Avatar
Join Date: Jul 2007
Location: Texas, Ya'll
Posts: 1,710
Jake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud of
 



right, but what i need is the code to insert.
Jake is offline  
Old 09-03-2007, 12:32 PM   #4 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




I don't know, what page are you trying to go to?
Barrucadu is offline  
Old 09-03-2007, 01:16 PM THREAD STARTER               #5 (permalink)
Senior Member
 
Jake's Avatar
Join Date: Jul 2007
Location: Texas, Ya'll
Posts: 1,710
Jake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud of
 



(search).html

like, whatever they search.html
Jake is offline  
Old 09-03-2007, 01:54 PM   #6 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




HTML Form
HTML Code:
<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 Code:
<?php
header
("Location: /{$_POST['keyword']}.html");
????: NamePros.com http://www.namepros.com/showthread.php?t=369743
?>
You will still get a 404 error unless (keyword).html exists.
Barrucadu is offline  
Old 09-03-2007, 02:51 PM THREAD STARTER               #7 (permalink)
Senior Member
 
Jake's Avatar
Join Date: Jul 2007
Location: Texas, Ya'll
Posts: 1,710
Jake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud ofJake has much to be proud of
 



Ill try that!

Thanks!
Jake is offline  
Old 09-03-2007, 05:22 PM   #8 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by Mikor
HTML Form
HTML Code:
<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 Code:
<?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)
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:24 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger