I'm using a custom image for my search submit button, which of course results in a url like: domain.com/?s=banana&x=37&y=11 Is there any way I can use mod_rewrite or a PHP trick to remove these coordinates?
Its possible but you need to post the code here.. what i want to know is will these cordinates going to be static or changes everytime
The coordinates change every time, depending on the location of the mouse when the user clicks the submit button. X and Y are irrelevant to the destination page - they do not need to be passed on. Ignore the PHP, that's just WordPress stuff: <form id="searchform" method="get" action="<?php bloginfo('home'); ?>"><input type="text" id="searchtext" name="s" size="15" value="<? echo $s; ?>" /><input type="image" src="<?php bloginfo('template_directory'); ?>/images/spacer.gif" value="Search" id="submitimg" /></form> Code (markup): What I'd like is for: domain.com/?s=banana&x=37&y=11 domain.com/?s=banana&x=27&y=63 domain.com/?s=banana&x=99&y=22 etc... to all go to domain.com/?s=banana
Why not use the POST variable instead of the GET ? that way all the stuff will be hidden... or probably make a php code just for processing the data Say like <?php $s = $_GET["s"]; $x = $_GET["x"]; $y = $_GET["y"]; if ($x=="37" && $y=="11") header( 'Location: http://www.domain.com/?s='.$s.'') ; ?> Its better to use POST i guess
THANK YOU Bohra! Your post definitely set me on the right path! Running it all within Wordpress doesn't make it any easier, but I've got it all working now... My search form is now: method="get" action="presearch.php" Then in presearch.php: <?php $s = $_GET['s']; header( 'Location: http://www.domain.com/?s='.$s.'') ; ?> Such a simple solution. I'm embarrassed I didn't think of it myself Thank you! +REP +REP +REP