Jump to content

PHP page forward with a form


Travist6983

Recommended Posts

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

 

<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?

<?php
header("location: javascript:void[0]; onclick="document.forms['Birmingham'].submit(); return false;"");
?>

 

Any suggestions on this would be a great help

Thank You

Link to comment
Share on other sites

Javascript is a CLIENT SIDE scripting language and cannot interact with PHP like this. You'd need to use this to redirect..

 

Birmingham.php:

<?php
header('Location: '.$_SERVER['SERVER_NAME'].'/seach.php?city=birmingham');
?>

Like so.. Which'll automatically redirect them.

Link to comment
Share on other sites

Javascript is a CLIENT SIDE scripting language and cannot interact with PHP like this. You'd need to use this to redirect..

 

Birmingham.php:

<?php
header('Location: '.$_SERVER['SERVER_NAME'].'/seach.php?city=birmingham');
?>

Like so.. Which'll automatically redirect them.

 

Search engines don't like redirects.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.