SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Headers can't modify,plz solve it

    Hi Everybody,
    I have faced a header problem again.It shows headers can't modify.It already sent to line 1.
    If I have used headers_sent() function then the value is not inserting into this brach if(!headers_sent()) {
    values are not coming
    }
    How can i solve my problem?
    After my php code my form is line 250.see this things
    my code is as follows:
    PHP Code:
    <?php
    include('conn.php');
    if( isset( 
    $_POST['submit'] ) )
        { 
            
    $user = empty($_POST['user']) ? '' $_POST['user']; 
            
    $submit = empty($_POST['submit']) ? '' $_POST['submit']; 
            
    $pass = empty($_POST['password']) ? '' $_POST['password']; 
             if (
    $submit=="Go")
                 {
                 
                     
    $query "select * from totalinfo where user='$user' and pass='$pass'";
                     
    $result=mysql_query($query)or die(__LINE__.mysql_error());
                     
    $row_result=mysql_num_rows($result);
                        if(
    $row_result>0)
                            {
                            
                              
    $query_data mysql_fetch_array$result );
                              
    $a$query_data["user"];
                              
    $b$query_data["alevel"];
                              
                              if (
    $b=="user")
                                {
                                 
                                   
    header('Location: /total/trader3.php?user=$a');
                                 
                                }
                                elseif (
    $b=="admin")
                                {
                                  
                                    
    header('Location: /total/ano.php?user=$a');
                                    
                                    
                                }
                             }
                         else 
                             {
                                    echo 
    "There is no such record";
                              }
      
                  }
         }
    ?>
    <HEAD><TITLE>Totalfield_About us</TITLE>
    <META http-equiv=Content-Language content=en-us>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2745.2800" name=GENERATOR>
    <META content=FrontPage.Editor.Document name=ProgId><LINK 
    href="trad_files/style.css" type=text/css rel=stylesheet>
    <SCRIPT language=JavaScript>
    var winWidth = "474"
    var winHeight = "500"
    var winScrollbars = "yes"
    var winToolbar = "no"
    var winSizeable = "yes"

    function doWin(winURL) {
      window.open(winURL,"","width="+winWidth+",height="+winHeight+",scrollbars="+winScrollbars+",toolbars="+winToolbar+",sizeable="+winSizeable)
    }
    //-->
    </SCRIPT>

    <STYLE type=text/css>BODY {
        SCROLLBAR-FACE-COLOR: #383838; SCROLLBAR-HIGHLIGHT-COLOR: #efefef; SCROLLBAR-SHADOW-COLOR: #efefef; SCROLLBAR-ARROW-COLOR: #b50303; SCROLLBAR-BASE-COLOR: #076b63; scrollbar-dark-shadow-color: white; scrollbar-3d-light-color: B6EAE6
    }
    </STYLE>

    <SCRIPT language=JavaScript type=text/javascript>
    function jumpBox(list) {location.href =
    list.options[list.selectedIndex].value}
    </SCRIPT>
    </HEAD>
    <BODY bgColor=#ffffff topMargin=0>

    <DIV align=center>
    <TABLE cellSpacing=0 cellPadding=0 width=700 align=center bgColor=#ffffff 
    border=0 topMargin="0">
      <TBODY>
      <TR>
        <TD width=700>
          <DIV align=left>
          <TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
            <TBODY>
            <TR>
              <TD width=700 height=150>
                <DIV align=left>
                <TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
                  <TBODY>
                  <TR>
                    <TD width=200>
                      <P align=center><IMG height=150 src="trad_files/logo_f.jpg" 
                      width=200 border=0></P></TD>
                    <TD><IMG height=150 src="trad_files/home_header.jpg" width=500 
                      border=0></TD></TR></TBODY></TABLE></DIV></TD></TR>
            <TR>
              <TD width=700 height=2></TD></TR>
            <TR>
              <TD width=700 height=20>
                <DIV align=left>
                <TABLE 
                style="BORDER-RIGHT: #8d6e4f 1px solid; BORDER-TOP: #8d6e4f 1px solid; BORDER-LEFT: #8d6e4f 1px solid; BORDER-BOTTOM: #8d6e4f 1px solid; BACKGROUND-COLOR: #e2d6c6" 
                height=15 cellSpacing=0 cellPadding=0 width=700 border=0 
                valign="middle">
                  <TBODY>
                  <TR>
                    <TD width=300>
                      <P align=left><IMG height=15 src="trad_files/home.gif" 
                      width=19 border=0> <A class=footer 
                      href="file://Jayanti/pub_webs/total_field1/index.htm">Home</A>&nbsp;&nbsp;&nbsp;&nbsp; 
                      <IMG height=15 src="trad_files/contact.gif" width=19 border=0> 
                      <A class=footer 
                      href="http:///">Contact</A>&nbsp;&nbsp;&nbsp;&nbsp; <IMG 
                      height=15 src="trad_files/sitemap.gif" width=17 border=0> <A 
                      class=footer href="http:///">Sitemap</A> </P></TD>
                    <TD width=56>
                      <P class=deepgrey align=right></P></TD>
                    <TD vAlign=center width=344 height=15>
                      <P class=deepgrey align=right>Select a category to view the 
                      products&nbsp;&nbsp; </P></TD>
                    <TD vAlign=center width=131 height=15>
                      <FORM name=select_product action="" method=post>
                      <P class=news align=right><SELECT class=combobox 
                      style="FONT-SIZE: 11px; BORDER-LEFT-COLOR: #d7d7d7; BORDER-BOTTOM-COLOR: #d7d7d7; COLOR: #000000; BORDER-TOP-STYLE: solid; BORDER-TOP-COLOR: #d7d7d7; FONT-FAMILY: Verdana; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; BACKGROUND-COLOR: #e2d6c6; BORDER-RIGHT-COLOR: #d7d7d7; BORDER-BOTTOM-STYLE: solid" 
                      onchange=jumpBox(this.form.elements[0]) size=1 name=jumpto10> 
                        <OPTION value=products.htm>Knives</OPTION> <OPTION 
                        value=products.htm>Equestrian</OPTION> <OPTION 
                        value=products.htm>Optics</OPTION> <OPTION 
                        value=products.htm>Clothing</OPTION> <OPTION selected>click 
                        here</OPTION> <OPTION value=products.htm>Footwear</OPTION> 
                        <OPTION value=products.htm>Fishing</OPTION> <OPTION 
                        value=products.htm>Hunting Holidays</OPTION> <OPTION 
                        value=products.htm>Dear Stalking</OPTION> <OPTION 
                        value=products.htm>Ferreting</OPTION> <OPTION 
                        value=products.htm>Gundog</OPTION> <OPTION 
                        value=products.htm>Lamping Kits</OPTION> <OPTION 
                        value=products.htm>Falconry</OPTION> <OPTION 
                        value=products.htm>Books</OPTION> <OPTION 
                        value=products.htm>Videos</OPTION> <OPTION 
                        value=products.htm>Shooting &amp; Gun Accessories</OPTION> 
                        <OPTION value=products.htm>Air Guns</OPTION> <OPTION 
                        value=products.htm>Special Offers</OPTION> 
                      &nbsp;</SELECT>&nbsp;</P></FORM></TD></TR></TBODY></TABLE></DIV></TD></TR>
            <TR>
              <TD width=700 height=2><IMG height=1 
                src="trad_files/dot_lt.grey.gif" width=1 border=0></TD></TR>
            <TR>
              <TD width=700 height=21>
                <TABLE cellSpacing=0 cellPadding=0 width=701 bgColor=#f3f0eb 
                border=0>
                  <TBODY>
                  <TR>
                    <TD vAlign=top align=left width=699>
                      <P class=head>Welcome Traders<BR><FONT 
                      color=#f3f0eb><BR></FONT></P></TD></TR>
                  <TR>
                    <TD width=699>
                      <TABLE cellSpacing=0 cellPadding=0 width=698 border=0>
                        <TBODY>
                        <TR>
                          <TD width=21></TD>
                          <TD width=673>
                            <P class=small1grey>As a Total Field trader you are an 
                            integral part of our business and a partner in our 
                            success. Our Trader package is simply the most 
                            comprehensive of its type in the UK.&nbsp;<BR><BR>Some 
                            of the benefits in opening an account with us are listed 
                            below.</P>
                            <UL>
                              <LI>
                              <P class=small1grey>Excellent rates on all wholesale 
                              items </P>
                              <LI>
                              <P class=small1grey>Complete transparency in 
                              pricing&nbsp; </P>
                              <LI>
                              <P class=small1grey>Comprehensive refund policy </P>
                              <LI>
                              <P class=small1grey>Next day delivery on all items in 
                              stock </P>
                              <LI>
                              <P class=small1grey>30 days credit for most companies 
                              </P>
                              <LI>
                              <P class=small1grey>FREE consultancy and advice on 
                              setting up your e-commerce website and other IT needs 
                              </P>
                              <LI>
                              <P class=small1grey>Management consultancy services 
                              offered to all our account holders at a special price 
                              by one of the most reputed consultants in UK to help 
                              your business improve and grow </P>
                              <LI>
                              <P class=small1grey>Full online access to your 
                              account, placing an order, check, stock etc. </P>
                              <LI>
                              <P class=small1grey>FREE listing on Total Field 
                              website and mail order catalogues&nbsp; </P>
                              <LI>
                              <P class=small1grey>Special rates for bulk buys </P>
                              <LI>
                              <P class=small1grey>Import facility. Take all the 
                              hassle out of importing. For a flat rate fee we can 
                              handle all your import and export needs including, 
                              customs, VAT, order tracking etc. </P>
                              <LI>
                              <P class=small1grey>As an account holder you will get 
                              first refusal on any new items that we introduce in 
                              our range. </P>
                              <LI>
                              <P class=small1grey>Place an order of 700 or more and 
                              we will pay for your trader membership with BASC, BHS, 
                              CA or any of our other approved bodies. If you are 
                              already a member you will receive vouchers of a 
                              similar value. </P>
                              <LI>
                              <P class=small1grey>Take part in our Trader race. 
                              Every year we will be giving away a fully paid 
                              hunting, shooting or riding holiday in Scotland to our 
                              best performing trading partner. </P></LI></UL>
                            <P class=small1grey>Opening an account with us could not 
                            be any simpler. You can either apply online or print the 
                            form out and send it to us by post/fax at your 
                            convenience. We are always at the end of a telephone so 
                            why not give us a call on<B> 01236 732 047</B> or<B> 
                            07832202108</B> to discuss your requirements.&nbsp;</P>
                            <P class=small1grey> </P></TD></TR>
                        <TR>
                          <TD width=21></TD>
                          <TD width=673>
                            <P align=center><A class=news href="http:///">Download 
                            Form Now</A></P>
                            <P align=center> </P></TD></TR>
                        <TR>
                          <TD width=21></TD>
                          <TD width=673>
                            <P class=news align=center>Existing Members Login 
                        </P></TD></TR>



                        <TR>
                          <TD width=21></TD>
                          <TD align=middle width=673>
                         

                            <TABLE borderColor=#eae4db cellSpacing=0 cellPadding=0 
                            width="45%" border=1>
                              <TBODY>
                              <TR>
                                <TD width="100%">
                                  <FORM  method=post action="<?php echo $_SERVER['PHP_SELF'?>">
                                  <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                                  border=0>
                                    <TBODY>
                                    <TR>
                                    <TD width="50%">
                                    <P class=subhead 
                                    align=center><BR><BR>Username</P></TD>
                                    <TD width="50%"><BR><INPUT 
                                    style="BACKGROUND-COLOR: #eae4db" size=14 
                                    name="user" > </TD></TR>
                                    <TR>
                                    <TD width="50%">
                                    <P class=subhead align=center>Password</P></TD>
                                    <TD width="50%"><INPUT 
                                    style="BACKGROUND-COLOR: #eae4db" type=password 
                                    size=14 name=password> </TD></TR>
                                    <TR>
                                    <TD width="100%" colSpan=2>
                                    <P align=center><INPUT type=submit height=25 
                                    hspace=13 width=64 name=submit value=Go> 
                                    </P></TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE></TD></TR>                    <TR>
                          <TD width=21></TD>
                          <TD width=673>
                            <P align=center><A class=news 
                            href="http:///"><BR><BR>New users sign up/apply 
                            online</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                            <A class=news href="http:///">Forgot password</A></P>
                            <P align=center>&nbsp;</P>
                            <P align=center> </P></TD></TR>
                        <TR>
                          <TD width=21></TD>
                          <TD width=673>
                            <P class=news align=center><A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Optics</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Clothing</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Footwear</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Fishing</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Hunting 
                            Holidays</A> | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Deer 
                            Stalking</A> | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Knives</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Ferreting</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Gundog</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Lamping 
                            Kits</A> | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Falconry</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Books</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Videos</A> 
                            | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Shooting 
                            &amp; Gun Accessories</A> | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Air 
                            Guns</A> | <A class=news 
                            href="file://Jayanti/pub_webs/total_field1/products.htm">Special 
                            Offers</A></P>
                            <P class=news 
                  align=center></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
            <TR>
              <TD width=700 height=2><IMG height=1 
                src="trad_files/dot_lt.grey.gif" width=1 border=0></TD></TR>
            <TR>
              <TD width=700 bgColor=#383636 height=25>
                <P align=center><FONT color=#ffffff><A class=main 
                href="file://Jayanti/pub_webs/total_field1/index.htm">Home 
                </A>|&nbsp; <A class=main 
                href="file://Jayanti/pub_webs/total_field1/contact.htm">Contact</A>&nbsp; 
                |&nbsp; <A class=main 
                href="file://Jayanti/pub_webs/total_field1/sitemap.htm">Sitemap</A> 
                | <A class=main 
                href="file://Jayanti/pub_webs/total_field1/about.htm">About 
                us</A></FONT></P></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></DIV></BODY>
    Last edited by Helge; Nov 10, 2004 at 07:09. Reason: Added [php] tags. -Helge

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2003
    Location
    Leuven, Belgium
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure that in this file, and also every file included before you send the headers (in this case, 'conn.php'), there is no output sent to the browser - no print, no echo, no functions which produce output. And this is probably most important in your case: make sure you don't have anything before the opening <?php tags in this file or the included ones. This includes 'whitespace'. Put the cursor right before the <?php and hit backspace until you get to the top of the file, then save. Then try.

    Whenever you have output to the browser, and then try to send headers, set cookies, or anything else that involves a header, you get this kind of error - headers have to come before the 'regular' output.

  3. #3
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    conn.php is my connection file which i have included.nothing else but how do i solve my "header()" cannot modify.

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Be sure you don't output anything (i.e space or new line) to the browser before the php opening tag <?php. Also make sure nothing is outputted by the included file conn.php.

    One thing I didn't understand with your question. What did the form have to do with this problem?

    -Helge

    Off Topic:

    I added the [php] tags to your code so it won't break the forum layout.

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •