Jump to content

Fooleeze

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Fooleeze's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, your info pointed me in the right direction. I was putting that 'header2' file at the top (producing output) which was not necessary, so I moved it down into the 'html' section of the code. In addition I had a 'formatting' function that was also producing output, so I moved that down, too. Problem solved. Thanks a lot for your help. Todd [!--quoteo(post=386032:date=Jun 20 2006, 10:50 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 20 2006, 10:50 AM) [snapback]386032[/snapback][/div][div class=\'quotemain\'][!--quotec--] header Location redirects the browser elsewhere (to another page/script) so you can check whatever condition would cause the redirect before you output anything to the browser. For example: [code]<?php $something = $_GET['some_value']; // retrieve passed value from another page if ($something == 6) {     header("Location: page6.php"); // redirect to page 6     die(); } else {     include("page_header.php"); } ... more code ... [/code] [/quote]
  2. Yes, it does produce output. How do I get around that? I've used this in other places to add a 'header' to my pages. However on this page (where I'm using the header:location. . . ) is where it has issues. [!--quoteo(post=386006:date=Jun 20 2006, 09:35 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 20 2006, 09:35 AM) [snapback]386006[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]<?php include "http://www.*mywebsite*.com/v2/header2.php"; --a bunch of code--[/code] If that produces [b]ANY[/b] output to the browser then you'll get header errors. [/quote]
  3. I've encountered an error that as I understand is relatively common. Here it is: Warning: Cannot modify header information - headers already sent by (output started at [a href=\"http://www.*mywebsite*.com/v2/header2.php:11)\" target=\"_blank\"]http://www.*mywebsite*.com/v2/header2.php:11)[/a] in /*mywebsite*.com/v2/infoenter.php on line 108 I understand this is commonly referred to the 'whitespace' error, whereas I may have unnecessary whitespace in the 'header2.php' code at line 11. Well, I've gone over this again and again, in different editors, and I cannot get past this. I can't find any extra whitespace. The 'header2.php' is just a header file that is included at the top of the 'infoenter.php' file. Here's a short version of what my code is like (infoenter.php). . . file names have been changed to protect the innocent: <?php include "http://www.*mywebsite*.com/v2/header2.php"; --a bunch of code-- header("Location:infoverify.php?newcust=$newcust"); exit; --a bunch more code-- ?> That 'header2.php' file is also included in the target location (infoverify.php) in the same manner. Here is what the header2.php file looks like: <?php include_once "functionsfile.php"; formatthebody(); print "<html> <head> <title>*MyWebsite.com* - Your Online Source for Sweet Stuff</title> </head> <table align=left valign=top width=100%> <tr> <td align=left> <font color=green size=32><b><i>My Website</b></i></font> </td> </tr> <tr> <td>"; ?> So. . . anybody have any advice to help me fix my problem?
  4. The drop-downs are static html, not being populated from the database. But that could be done if it would be easier. It is a php file, and could access the database to create that drop down. But right now, I just put it in manually.
  5. First off, I suppose I'm technically still a beginner at PHP, and I'm also brand new to this forum. I created a site, and now I'm working on version 2. Version 1 used frames, with drop-down menus on the left to search my database of products. For example, a "Color" menu with choices of "All Colors, Red, Black, Green, White." (where "All Colors" is the default). When using frames, you could select one of these colors, hit submit, and the products would show up on the right based on your selection. The drop-down menu would still show the selection that you made (because this frame didn't reload or refresh, only the target frame refreshed). Worked fine, but I've been instructed to use 'include' files instead of frames, so I'm working on V2 now. Using 'include' files, the file that houses the drop-down menu now gets reloaded / refreshed each time I hit submit. So if I select "green" and hit submit, the table shows me the "green" items, but the drop-down menu is now reset to the default "All Colors." How do I get this drop-down menu to recognize what was selected and submitted, and show that in the drop-down when it is reloaded? My best example (not a website, but the same concept) would be in MS Word or MS Excel, when you use the 'drop-down' box to select a new font. When you select the font, the font you selected shows in the window until you change it. Hopefully my long-winded question makes sense, and I hope someone here can point me in the right direction. Thanks for your time. Todd
×
×
  • 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.