I'm hoping someone can help me with this. I've seen and tried various
solutions I've seen on the net, but nothing works.
Of course it works perfectly on localhost, but when I upload it to the
server (1and1.com) it gives errors. The user enters a code, the code is
verified, a new one is created and it's supposed to send them to the next
page.
if (CodeExist($cCo de) > 0){
$cNewCode = MakeCode();
$ok = InsertRec($cNew Code);
ob_start(); // doesn't matter if I leave this in or take it out.
session_cache_l imiter('public' ); // suggestion from the internet. No
effect :(
session_start() ;
$_SESSION['newcode'] = $cNewCode;
print "session is set to:".$_SESSION['newcode'];
header("Locatio n: info.php");
exit;
And here's the output. Notice that the session was set even through the
error messages:
Warning: Cannot send session cookie - headers already sent by (output
started at /devel/joinnow.php:4) in /devel/joinnow.php on line 20
Warning: Cannot send session cache limiter - headers already sent (output
started at /devel/joinnow.php:4) in /devel/joinnow.php on line 20
session is set to:JSG598
Warning: Cannot add header information - headers already sent by (output
started at /devel/joinnow.php:4) in /devel/joinnow.php on line 25
Any help would be extremely helpful!
Thanks!! 6 3401
Update! I created two php test pages. Page 1 redirected to page 2. It
worked on my localhost AND on the internet server. So I'm scratching my
head thinking "What the hell?". THEN I tried it using my Dreamweaver
template. Holy crap, the simple one line redirection worked on my
localhost, but not on the internet server.
The Dreamweaver template is causing the mess!! Has any one else experienced
this and figured out how to fix it?
"Lochness" <so*****@somewh ere.com> wrote in message
news:mOIcc.3723 9$Pk3.11329@pd7 tw1no... I'm hoping someone can help me with this. I've seen and tried various solutions I've seen on the net, but nothing works.
Of course it works perfectly on localhost, but when I upload it to the server (1and1.com) it gives errors. The user enters a code, the code is verified, a new one is created and it's supposed to send them to the next page. if (CodeExist($cCo de) > 0){ $cNewCode = MakeCode(); $ok = InsertRec($cNew Code);
ob_start(); // doesn't matter if I leave this in or take it out. session_cache_l imiter('public' ); // suggestion from the internet. No effect :( session_start() ; $_SESSION['newcode'] = $cNewCode;
print "session is set to:".$_SESSION['newcode']; header("Locatio n: info.php"); exit;
And here's the output. Notice that the session was set even through the error messages:
Warning: Cannot send session cookie - headers already sent by (output started at /devel/joinnow.php:4) in /devel/joinnow.php on line 20
Warning: Cannot send session cache limiter - headers already sent (output started at /devel/joinnow.php:4) in /devel/joinnow.php on line 20 session is set to:JSG598 Warning: Cannot add header information - headers already sent by (output started at /devel/joinnow.php:4) in /devel/joinnow.php on line 25
Any help would be extremely helpful! Thanks!!
In article <xvLcc.40778$Ig .8376@pd7tw2no> ,
"Lochness" <so*****@somewh ere.com> wrote: The Dreamweaver template is causing the mess!! Has any one else experienced this and figured out how to fix it?
Probably empty lines or spaces somewhere. If you do a header("Locatio n:
"), there is no output of any sort allowed before that. And that
includes white space before the <?php declaration.
JP
--
Sorry, <de*****@cauce. org> is een "spam trap".
E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.
"Jan Pieter Kunst" <de*****@cauce. org> schreef in bericht
news:de******** *************** ****@news1.news .xs4all.nl... In article <xvLcc.40778$Ig .8376@pd7tw2no> , "Lochness" <so*****@somewh ere.com> wrote:
The Dreamweaver template is causing the mess!! Has any one else
experienced this and figured out how to fix it?
Probably empty lines or spaces somewhere. If you do a header("Locatio n: "), there is no output of any sort allowed before that. And that includes white space before the <?php declaration.
JP
-- Sorry, <de*****@cauce. org> is een "spam trap". E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.
<snip> from previous post
if (CodeExist($cCo de) > 0){
$cNewCode = MakeCode();
$ok = InsertRec($cNew Code);
ob_start(); // doesn't matter if I leave this in or take it out.
session_cache_l imiter('public' ); // suggestion from the internet. No
effect :(
session_start() ;
$_SESSION['newcode'] = $cNewCode;
print "session is set to:".$_SESSION['newcode'];
header("Locatio n: info.php");
exit;
</snip>
It is not probably it is definitely. Look at the print statement.
If you want to change the header information then this is the first thing
send back to the client. When sending white spaces, using echo's or print
statements the header information is automatically send. The message:
"Warning: Cannot send session cache limiter - headers already sent" is
telling you did send something before using the header function. it is even
telling you where you did this (hence the line "/devel/joinnow.php on line
20").
I don't know where you got your suggestions or other information from the
internet but www.php.net is a good place to start. Look at http://www.php.net/manual/nl/function.header.php first ;-)
HTH rob
Lochness wrote: Update! I created two php test pages. Page 1 redirected to page 2. It worked on my localhost AND on the internet server. So I'm scratching my head thinking "What the hell?". THEN I tried it using my Dreamweaver template. Holy crap, the simple one line redirection worked on my localhost, but not on the internet server.
The Dreamweaver template is causing the mess!! Has any one else experienced this and figured out how to fix it?
Don't use Dreamweaver? Seriously the only stuff I'd trust to use
'auto-code' for is flat, boring, static HTML. I've seen all sorts of
weirdness and client incompatibility from code generated in various IDE's
(Like Dreamweaver). Unless you are stuck with it, maybe try hand-cranking
your code 'ye olde fashioned' way.
Not much help, I know, but thought I'd throw my $0.02 in.
Good luck,
James
--
Fortune cookie says:
Do unto others before they undo you.
Thank you so much guys!!
After reading your replies I created a little test. With my template I
created a one statement page and at the top added:
--------------------
<?php error_reporting (E_ALL);?>
<?php
header("Locatio n: test2.htm");
?>
--------------------
Notice the white space between the two php statements. I sent it up
to my server and it crashed. So I took out the whitespace, sent it up
to my server and it worked!! Then on my big program, I took out all
the blank lines and commented out the print statement. Tada! It
worked!! So thanks to you guys and grrrr to php and it's tightass
attitude towards whitespace.
It worked on my localhost which is version 4.3.4 and the server is
4.2.3. Maybe the newer version isn't as anal about whitespace.
Anyways. Thanks again!!
"Rob" <reply_@news_gr oup.please> wrote in message news:<ef******* *************@a msnews03.chello .com>... "Jan Pieter Kunst" <de*****@cauce. org> schreef in bericht news:de******** *************** ****@news1.news .xs4all.nl... In article <xvLcc.40778$Ig .8376@pd7tw2no> , "Lochness" <so*****@somewh ere.com> wrote:
The Dreamweaver template is causing the mess!! Has any one else experienced this and figured out how to fix it?
Probably empty lines or spaces somewhere. If you do a header("Locatio n: "), there is no output of any sort allowed before that. And that includes white space before the <?php declaration.
JP
-- Sorry, <de*****@cauce. org> is een "spam trap". E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.
<snip> from previous post
if (CodeExist($cCo de) > 0){ $cNewCode = MakeCode(); $ok = InsertRec($cNew Code);
ob_start(); // doesn't matter if I leave this in or take it out. session_cache_l imiter('public' ); // suggestion from the internet. No effect :( session_start() ; $_SESSION['newcode'] = $cNewCode;
print "session is set to:".$_SESSION['newcode']; header("Locatio n: info.php"); exit;
</snip>
It is not probably it is definitely. Look at the print statement. If you want to change the header information then this is the first thing send back to the client. When sending white spaces, using echo's or print statements the header information is automatically send. The message: "Warning: Cannot send session cache limiter - headers already sent" is telling you did send something before using the header function. it is even telling you where you did this (hence the line "/devel/joinnow.php on line 20").
I don't know where you got your suggestions or other information from the internet but www.php.net is a good place to start. Look at http://www.php.net/manual/nl/function.header.php first ;-)
HTH rob
"Lochness" <s1******@hotma il.com> schrieb im Newsbeitrag
news:ac******** *************** ***@posting.goo gle.com... Thank you so much guys!! After reading your replies I created a little test. With my template I created a one statement page and at the top added: -------------------- <?php error_reporting (E_ALL);?>
<?php header("Locatio n: test2.htm"); ?> -------------------- Notice the white space between the two php statements. I sent it up to my server and it crashed. So I took out the whitespace, sent it up to my server and it worked!! Then on my big program, I took out all the blank lines and commented out the print statement. Tada! It worked!! So thanks to you guys and grrrr to php and it's tightass attitude towards whitespace.
It worked on my localhost which is version 4.3.4 and the server is 4.2.3. Maybe the newer version isn't as anal about whitespace.
Anyways. Thanks again!!
I am not understanding everything about that stuff, but I am quite sure that
your problem is not about PHP but about HTTP. HTTP headers can't be sent
after any output, regardless of what technique you use to send them. So if
you do this:
<?php
// PHP code
?>
<?php header("myheade r"); ?>
you output white space via HTTP (and thus send the headers) in an area that
is not controlled by PHP.
If you do this:
<?
php echo "something" ;
header("myheade r");
?>
your output is also sent via HTTP. I am quite sure that a clean arrangement
of the code in most cases solves that problem easily. For login or session
stuff I usually do it the way:
<?php
// handle session, check login, send cookie or whatever
$loggedin = "no"; // set variable with the result of the above actions
$message = "Wrong password, try it again!"; // set message according to the
above actions
?>
<html>
<head></head>
<body>
<?php
if($loggedin==" no") {
echo $message;
// display loginform
}
else {
// display contents
}
?>
</body>
</html>
Maybe your task is different, but you see the principle.
HTH
Markus This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
Hello,
I have a very simple problem but cannot seem to figure it out. I have a
very simple php script that sends a test email to myself. When I debug
it in PHP designer, it works with no problems, I get the test email. If
|
by: vivek9856 |
last post by:
I am making a website and I need help promptly. Here is the code first
off
-----File Header.htm-----
<HTML>
<HEAD>
<TITLE>Black Hawk Down</TITLE>
</HEAD>
<LINK REL=stylesheet TYPE="text/css" HREF="style.css">
|
by: Gary Hughes |
last post by:
Hi all, sometime I posted a problem in here where I was
getting the following error from the linker in VS C++ 2003.
Linking...
GCClass.obj : error LNK2022: metadata operation failed
(80131188) : Inconsistent field declarations in duplicated
types (types: GCClass; fields: m_blah): (0x04000001).
LINK : fatal error LNK1215: metadata operation failed
(80131130) :
|
by: James Radke |
last post by:
Hello,
I have a multithreaded windows NT service application (vb.net 2003) that I
am working on (my first one), which reads a message queue and creates
multiple threads to perform the processing for long running reports. When
the processing is complete it uses crystal reports to load a template file,
populate it, and then export it to a PDF.
It works fine so far....
|
by: Evandro Klen S. Azeredo |
last post by:
Hi,
I'm with the folowing problem:
I have two tables: header(id_header) and Itens(id_header, id_item).
When I insert data in Itens table, this error is returned: "You cannot add
or change a record because a related record is required in table 'header'."
I'm using MS Access database.
| |
by: so many sites so little time |
last post by:
all right so the script is pretty simple it goes it retrives what the
id of the post is and it lets you edit it well no it doesnt.
now if you go to www.kirewire.com/pp2/index/php you will see a number 1
that is the value of collumn home_id which is set to auto increment ect
ect
but this script which gets the id of home_id of a row and lets you edit
it does not work for somereason...
|
by: choudhary.poorva |
last post by:
I am new to C programming and learning Commands on Unix for my exam on
Interprocess communication. I would appreciate if anyone can explain
the following command:
int chmod ( const char * pathname, mode_t mode ) ;
What is mode_t in this command?
|
by: Alami |
last post by:
I'm newdie in c programming. this is my first project in programming.
I have to write a program for a airline reservation. this is what i
have done yet. but when it runs it shows the number of seats as 0 and
the flight no. is also repeating. If any can tell why is this please
help me.
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
#include<memory.h>
|
by: CodeSeeker |
last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4 instead of Pop3.
Primary reason for that :- Is we want to better meet out SLA, so we have decided to go with the 2 instances of this application, and hence decided to use IMAP4 to concurrently accessing the mailboxes via IMAP4.
My issues:- Now...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |