No, you can fix your own code so that you aren't trying to both output a response body, and set HTTP Location headers in the same response.
If you have already identified that you are in fact dumping output before trying to set headers, then you have already identified your problem, and now the next step is to fix it.
Chances are, if you are stuck in a situation where you can't separate the code that sets headers from the code that writes output HTML, then your code is mucked, and you need to refactor into separate modules each area of responsibility.
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/photo/download.php:67) in /Applications/XAMPP/xamppfiles/htdocs/photo/download.php on line 77
Yeop. Refactor everything; as in, take the SQL and put it into a file elsewhere, which probably means a function (method) which probably means a class.
Um, because you want to separate the respective concerns of your codebase into whatever modules the language supports, so you can easily swap, change, reintegrate, and bugfix stuff without EVERYTHING fucking breaking?
Yea, you should be worried about a lot more than security based on what I'm seeing.
See what other projects, of a similar type are doing; or at least in the same language (PHP, of course)
No no no no no, reading books is necessary.
But not for you, not right now.
Also, saying that you "never read books" probably contributes to the problem here.
I'm just suggesting you review other projects because it's probably going to be faster for you to understand what they're doing right and you're doing wrong.
And then move onto reading materials on architecture.
You definitely should read about dependency management/injection, separation of concerns, or more broadly, SOLID/GRASP, but I honestly don't think you're there yet, based on the number of syntax-related questions you come in with.
Not if you have code like that littered throughout it.
I don''t want you to do anything except start reading and learning, rather than trying to cash in on a pipe dream.
I don't know what your intentions are with the project, whether they're monetary or as a work piece, but trust me; it's not going to be pretty. Toy projects for now.
Toy projects; work on big stuff when you have a grasp on how to manage the big stuff.
If your idea holds water, then if you learn quickly enough it'll still be a possibility.
And I don't think you're taking it this way, but rest assured I'm not trying to insult or berate you; I just think that you're not ready to handle the project you've set out to do. You need to do fundamentals -> syntax (per language) -> basic architecture -> system architecture -> project
I get: Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/photo/download.php:67) in /Applications/XAMPP/xamppfiles/htdocs/photo/download.php on line 77
session_start(): Cannot send session cookie - headers already sent by (output started at /Users/mac/----/Home/PHP/----/----/index.php:1) in /Users/mac/---/Home/PHP/----/----/index.php on line 2
You can do this by opening the page properties and encoding. Instructions below are for Dreamweaver CS3 and are hopefully similar to the version you're using.
Open your document
Open the Modify menu
Choose Page Properties
Select the Title/Encoding submenu
Select the Encoding dropdown and choose...
@RahulKhosla You don't necessarily need to close <?php, it's actually best practice to leave it open if there's no html, you might prevent sending some whitespaces
nofollow is a value that can be assigned to the rel attribute of an HTML a element to instruct some search engines that a hyperlink should not influence the link target's ranking in the search engine's index. It is intended to reduce the effectiveness of certain types of internet advertising because their search algorithm depends heavily on the number of links to a website when determining which websites should be listed in what order in their search results for any given term. However, new information suggests that search engines will depend less on links in the future and more on other...
@bwoebi @NikiC well.. I had to read twice before noticed that I misread that message. So, my eyes failed. If I posted something offensive then shame on me, yep