Problems redirecting to next pages

I have recently tried this coding to update to my database it works differently in two browsers IE and Chrome. In chrome it just goes to the next page (before it was adding data to DB) and not going to next page. Now IE just adds data to DB and does not go to next page. Can someone take a look and let me know what I have to do to fix this. thanks




    // Validate form data

    if($_POST["firstname"]=='') $err.='Please enter First Name<br>';
    if($_POST["email"]=='') $err.='Please enter Email<br>';


      // Check if there are duplicate entries in the 'contacts' table

      $r=mysql_query("SELECT ID FROM Members WHERE firstname='".addslashes($_POST["firstname"])."' and Email='".addslashes($_POST["email"])."'");
        $err.='Can not add duplicate entry<br>';

        // adding new record to 'contacts' table

        mysql_query("INSERT INTO Members (firstname,lastname,country,Email) 
                    values ('".addslashes($_POST["firstname"])."','".addslashes($_POST["lastname"])."','".addslashes($_POST["country"])."','".addslashes($_POST["email"])."')");

        // redirecting to success screen



<title>Add New Contact</title>


<h2>Register with us</h2>

<?php echo $err==''?'''<p style="color:red;">'.$err.'</p>') ?>

<form method="post" action="form.php">

<table border="0">
<td valign="middle">First Name:</td>
<td><input type="text" name="firstname" size="30" value="<?php echo htmlspecialchars($firstname) ?>"></td>
<td valign="middle">Last Name:</td>
<td><input type="text" name="lastname" size="30" value="<?php echo htmlspecialchars($lastname) ?>"></td>
<td valign="middle">Country:</td>
<td><input type="text" name="country" size="30" value="<?php echo htmlspecialchars($country) ?>"></td>
<td valign="middle">Email:</td>
<td><input type="text" name="email" size="30" value="<?php echo htmlspecialchars($email) ?>"></td>

<a href=""><input type="submit" name="submit" value=" Submit! "></a>




&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&gt;
&lt;html xmlns=""&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;

/* Program: New_member.php
 * Desc:   Displays the new member welcome page. Greets
 *         member by name and gives a choice to enter
 *         restricted section or go back to main page.
if (@$_SESSION['auth'] != "yes")

 $link = mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
 $link = mysql_select_db("$db_name") or die ("Query died:");
 $query = "SELECT firstName, lastName FROM `Members`
          WHERE email='{$_SESSION['id']}'";            
 $result = @mysql_result($query,$link)
             or die("Could not execute query");
 echo "&lt;html&gt;
       &lt;head&gt;&lt;title&gt;New Member Welcome&lt;/title&gt;&lt;/head&gt;
      &lt;h2 style='margin-top: .7in; text-align: center'&gt;
      Welcome $firstName &lt;/h2&gt;\
&lt;p&gt;Your new Member accounts lets you enter the members only section
of our web site. You'll find special discounts, a profile of matches,
live advise for experts, and much more.&lt;/p&gt;
&lt;p&gt;Your new Member ID and password were emailed to you. Store them
carefully for future use.&lt;/p&gt;
&lt;div style="text-align: center"&gt;
&lt;p style="margin-top: .5in; font-weight: bold"&gt;
Glad you could join us!&lt;/p&gt;
&lt;form action="profile.php" method="post"&gt;
   &lt;input type="submit"
      value="Enter the Members Only Section"&gt;
&lt;form action="index.php" method="post"&gt;
   &lt;input type="submit" value="Go to eBermylove Main Page"&gt;

I’m not sure if the forum has removed some code (best to use the [ php ] tags around your code), but I don’t see anywhere that would redirect the browser.

You need either a php header() or meta header function.

I agree, from the code pasted above I don’t see what is redirecting anything!
I don’t think you have pasted all the necessary code…