PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
TravisT6983
Forum Newbie
Posts: 19 Joined: Wed Jul 02, 2008 2:15 pm
Post
by TravisT6983 » Mon Aug 17, 2009 2:17 pm
ok i am trying to create city pages such as birmingham.php that all it does is forward to the search result for birmingham we are a real estate company that is trying to get some better SEO with all our surrounding citys... our search results page land on listings.php
i have done this to our footer of each page with this form action
Code: Select all
<form name="Birmingham" action="listings.php" method="post">
<input type="hidden" name="searchType" value="custom">
<input type="hidden" name="newSearch" value="true">
<input type="hidden" name="table" value="rs">
<input type="hidden" name="city" value="2192">
<input type="hidden" name="beforeListPrice" value="0">
<input type="hidden" name="afterListPrice" value="any">
<input type="hidden" name="featuredOnly" value="false">
</form>
<a href="javascript:void[0];" onclick="document.forms['Birmingham'].submit(); return false;">Birmingham</a>
is it possible to use this form action in like a PHP header forward?
Code: Select all
<?php
header("location: javascript:void[0]; onclick="document.forms['Birmingham'].submit(); return false;"");
?>
Any suggestions on this would be a great help
Thank You
jackpf
DevNet Resident
Posts: 2119 Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK
Post
by jackpf » Mon Aug 17, 2009 2:33 pm
No.
But you could do something like this:
Code: Select all
window.onload = function(){document.forms['Birmingham'].submit();}
But wait...you're going to make a script for
every city?
TravisT6983
Forum Newbie
Posts: 19 Joined: Wed Jul 02, 2008 2:15 pm
Post
by TravisT6983 » Mon Aug 17, 2009 2:38 pm
i dont quite understand your code? can u elaborate a little further?
not every city but like 10 or so city's?
thanks
jackpf
DevNet Resident
Posts: 2119 Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK
Post
by jackpf » Mon Aug 17, 2009 3:50 pm
That code is javascript that will submit the form when the page is loaded. Is that not what you want?
And that sounds awful!!
Why not write one script that handles multiple cities?