SitePoint Sponsor

User Tag List

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

    Plz solve my warnning.

    Hi Every body,
    I have wasted 2 days to solve this problem.plz help me.
    It shows warning as "Warning: Cannot modify header information - headers already sent by (output started at d:\inetpub\wwwroot\total\trad.php:1) in d:\inetpub\wwwroot\total\trad.php on line 27"
    Here conn.php is my connection file which i have included.
    How can i solve my problem?
    Advance thanks to you.
    code is :
    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";
                              }
      
                  }
         }
    ?>
    <html>
    <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></html>
    Last edited by Helge; Nov 11, 2004 at 05:26. Reason: Added [php] tags -Helge

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Ukraine, Khmelnitsky
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to remove all spaces in 'conn.php' outside php-tags (no spaces, no new lines etc.).
    And before <?php in 'trad.php' too.
    Sergey Bres aka tserbis, Ukraine

  3. #3
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi ujjwal, here's a tip on how to post your question:

    1. put your code between the code or php tags
    2. dont post the whole page, post only your php codes.
    3. Indicate which line is producing the error. You cant expect anyone to try and locate line #27 and then replying.

    Also, am i correct in assuming that conn.php does not output anything?

  4. #4
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tserbis
    Try to remove all spaces in 'conn.php' outside php-tags (no spaces, no new lines etc.).
    And before <?php in 'trad.php' too.
    There is no space in conn.php.but it shows and error.If u look warnning that is related only header() not modified.Is my code is wrong anywhere?What should be the wright one?I am loosing my confidence hour by hour.

  5. #5
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by astericks
    hi ujjwal, here's a tip on how to post your question:

    1. put your code between the code or php tags
    2. dont post the whole page, post only your php codes.
    3. Indicate which line is producing the error. You cant expect anyone to try and locate line #27 and then replying.

    Also, am i correct in assuming that conn.php does not output anything?
    Hallo Sir,
    sorry,Now i have changed the color of form in html.conn.php is a connection page which connect to mysql and database nothing.
    Plz

  6. #6
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ujjwal
    Hallo Sir,
    sorry,Now i have changed the color of form in html.conn.php is a connection page which connect to mysql and database nothing.
    Plz
    Dont worry about it, I was just giving you some tips that might help you get more replies.

    You codes have no problem, with it...I just tried it and it works fine.

    Anyway, try to get rid of the extra line breaks [empty spaces] BEFORE the header("Location....) line

    and see if it works.

    -asT

  7. #7
    SitePoint Guru ujjwal's Avatar
    Join Date
    Oct 2004
    Location
    kolkata
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by astericks
    Dont worry about it, I was just giving you some tips that might help you get more replies.

    You codes have no problem, with it...I just tried it and it works fine.

    Anyway, try to get rid of the extra line breaks [empty spaces] BEFORE the header("Location....) line

    and see if it works.

    -asT
    I have done it but it is not working.

  8. #8
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Not sure if it makes any real difference but I always use " around Location, also you have a / in the location line.
    Not sure you need the / ....?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  9. #9
    Chessplayer kleineme's Avatar
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Quote Originally Posted by spikeZ
    Not sure if it makes any real difference but I always use " around Location
    it will surely make a difference in the given example because with single quotes PHP won't substitute the $a with it's value. In order to accomplish that ujjwal would have to use double quotes. Without a variable within the URL it would make no difference whether you are using single or double quotes. And this will certainly not solve the original problem.
    Never ascribe to malice,
    that which can be explained by incompetence.
    Your code should not look unmaintainable, just be that way.


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
  •