I am struggling to get this - I am fairly close but it is really beginning to annoy me.
I am an newbie and I use Easygen as well as my own adaption to code small things like calculators etc.
I have developed a php file that interprets the submission from a html form, where users input their UK Postcode.
i.e. CT19. The form sends the post to a php file that reads from a database and links the relevant postcode to an associated URL.
The user just sees the postcode going into teh form and is then re-directed to the right store for that region.
Now, where there is no store covering that region, they are sent to another html file that says - 'oops sorry we don't sell there'.
That is all fine - I am happy with that.
But it is where the code doesn't recognise the input on the form. So instead of CT19 say, they input WYSIWYG or £$£$ or 4654654
In that case I want the script to display either another page or some text.
Now the following code works great in Firefox and displays the text it should. But in IE7/8 it just shows a directory of files.
The test form is being developed here www.deckinghow.co.uk -
The code is
<?php
// Turn on magic quotes to prevent SQL injection attacks
if(!get_magic_quotes_gpc())
set_magic_quotes_runtime(1);
// Connect to database
$eg_objConn1 = mysql_connect("localhost", "xxxxxxx", "xxx");
mysql_select_db("xxxxxxxxxxxx", $eg_objConn1);
// Conditional statement
if(!empty($_POST['pcodesrch']))
{
}
// Get Record Set
$eg_recResult1 = mysql_query("SELECT pcode, urlref FROM destinate WHERE pcode = '".@$_POST['pcodesrch']."'", $eg_objConn1);
$eg_Result1 = @mysql_fetch_array($eg_recResult1, MYSQL_ASSOC);
// Go to page
header("Location: ".@$eg_Result1['urlref']."");
// exit;
echo "We did not recognise your postcode, did you enter the postcode correctly?";
?>
What can I do to get the text to show in IE7/8?
I want to improve the code even further but I need to get it working first.