I'm having some trouble wrapping my mind around header(), I'm used to
just printing the header and leaving a blank line.
Does php ignore whitespace before a header:
<?php
// no output here
?>
just whitespace, are the line feeds ignored?
<?php
header(...)...
Also, I take it that we can have multiple header functions. If I now
echo something or just have embedded html, I take that php inserts a
blank line and the header is finished?
Why can't I just echo the headers and not use header?
Jeff 5 2127
Jeff wrote:
I'm having some trouble wrapping my mind around header(), I'm used to
just printing the header and leaving a blank line.
Does php ignore whitespace before a header:
<?php
// no output here
?>
just whitespace, are the line feeds ignored?
Yes, PHP ignores whitespace.
<?php
header(...)...
Also, I take it that we can have multiple header functions. If I now
echo something or just have embedded html, I take that php inserts a
blank line and the header is finished?
No, PHP does not insert a blank line. It inserts whatever you echo.
However, ANY output causes the headers to be sent and the data portion
to begin.
Why can't I just echo the headers and not use header?
Jeff
Because headers are headers and all the rest is data. Two entirely
different things.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
"Jeff" <jeff@spam_me_not.comschreef in bericht
news:Pd******************************@earthlink.co m...
I'm having some trouble wrapping my mind around header(), I'm used to
just printing the header and leaving a blank line.
Does php ignore whitespace before a header:
<?php
// no output here
?>
just whitespace, are the line feeds ignored?
<?php
header(...)...
Be careful.
This does contain output between the two php lines which is not ignored.
---snip---
<?php $a=1; ?>
<?php header('whatever'); ?>
---snip---
The following is OK:
---snip---
<?php $a=1; ?>
<?php header('whatever'); ?>
---snip---
mijn naam wrote:
"Jeff" <jeff@spam_me_not.comschreef in bericht
news:Pd******************************@earthlink.co m...
> I'm having some trouble wrapping my mind around header(), I'm used to just printing the header and leaving a blank line.
Does php ignore whitespace before a header:
<?php
// no output here ?>
just whitespace, are the line feeds ignored?
<?php header(...)...
Be careful.
This does contain output between the two php lines which is not ignored.
---snip---
<?php $a=1; ?>
<?php header('whatever'); ?>
---snip---
The following is OK:
---snip---
<?php $a=1; ?>
<?php header('whatever'); ?>
---snip---
But that is html, not PHP code.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
"Jerry Stuckle" <js*******@attglobal.netschreef in bericht
news:gb**********@registered.motzarella.org...
>>Does php ignore whitespace before a header:
<?php
// no output here ?>
just whitespace, are the line feeds ignored?
<?php header(...)...
But that is html, not PHP code.
Indeed it is.
The short answer to the question would be: "no".
I'm having some trouble wrapping my mind around header(), I'm used to
>just printing the header and leaving a blank line.
Does php ignore whitespace before a header:
^^^^^^ PHP does *not* ignore the whitespace here.
><?php
^^^^^^ but it ignores the whitespace here
>// no output here ?>
^^^^^^ and it does *not* ignore the whitespace here either.
>just whitespace, are the line feeds ignored?
<?php header(...)...
Also, I take it that we can have multiple header functions. If I now echo something or just have embedded html, I take that php inserts a blank line and the header is finished?
Why can't I just echo the headers and not use header?
Jeff
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hattuari |
last post by:
I'm learning C++ after having spent several years in the computer industry
doing both system administration and engineering. I've written code in
Perl, Bash, Pascal, Ada, C, Mathematica (hundreds...
|
by: Steven T. Hatton |
last post by:
If a header is not necessarily a source file, and the sequences delimited by
< and > in header names aren't necessarily valid source file names, what
exactly is a header?
--
p->m == (*p).m == p.m...
|
by: Steven T. Hatton |
last post by:
In the past there have been lengthy discussiions regarding the role of
header files in C++. People have been very adamat about header files
serving as in interface to the implementation. I do...
|
by: Jim Holder |
last post by:
I tried building libpcap and tcpdump from my Red Hat 7 RPMs. The
tcpdump make couldn't find ioccom.h and sockio.h.
When a header file is missing, how do you find it?
Thanks.
|
by: ginnisharma1 |
last post by:
Hi All,
I am very new to C language and I got really big assignment in my
work.I am wondering if anyone can help me.........I need to port
compiler from unix to windows and compiler is written...
|
by: fc2004 |
last post by:
Hi,
Is there any tools that could report where cyclic header dependency
happens? this would be useful when working with a large project where
tens or hundreds of headers files may form complex...
|
by: Christoph Scholtes |
last post by:
Hi,
I have some questions about header files:
Say I have a file functions.c which contains a couple of functions. I
have declared some structs in this file too. The structs are defined in...
|
by: wdh3rd |
last post by:
Hi everyone. I'm new to C and I have a few questions:
I am making files for permutations and combinations. Files to be made
are perm.c, perm.h, combo.c, and combo.h.
Since both combinations...
|
by: andre rodier |
last post by:
Hello,
I need to display or propose a jpeg image on a web page.
When I need to display the image, I use this code :
header("Content-Length: $fileSize") ;
header("Content-Type: $type") ;...
|
by: RN1 |
last post by:
Consider the following DataGrid:
--------------------------------------------------------------------------------
<asp:DataGrid ID="dgMarks" AutoGenerateColumns="false" runat="server">
<Columns>...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |