jammaster82

wtf?

What am I doing wrong here does this work
for anybody, ive tried it on two separate
public

php

  servers:

<?

php

 
setcookie('user','johnny',time()-3600);
?>


Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/webmaste/thesite.com/test.

php

 :2) in /hsphere/local/home/webmaste/thesite.com/test.

php

  on line 3

perkiset

You almost certainly have at least one carriage return OUTSIDE of the <?

php

  and ?> markers... if that is the case, then the carriage return will be output immediately and since (some) output has been sent, you can no longer send your headers.

That one got me bad for a while when I was first starting, and was single handidly the reason for why I code with 100% ZERO html-plus-

php

  style - it's all pure

PHP

  style with blocks of HTML.

Here's what I mean:

WRONG way to code:

<html>
<body>
The date is: <?

php

  echo date('m/d/Y', time()); ?>
</body>
</html>


The RIGHT way to code:

<?

php

 

$theDate = date('m/d/Y', time());
echo <<<HTML
<html>
<body>
The date is $theDate
</body>
</html>
HTML;

?>


Note that the

php

  file ends immediately after the ?> in the second example, although I THINK that you'd still be ok if there is one return after it and no more.

/p

jammaster82

gotcha on the blocks... love it.

<?

php

  setcookie('user','johnny',time()-3600); ?>

no carriage return or line feed at end..

so that should work then right?

perkiset

Yepper... unless you got other code involved that I cannot see here.

There might also be something in your

PHP

  instance that is sending stuff back early - I don't remember what, but I wanna say I say a thread somewhere about a problem like that... something about the header() function and stuff already being sent by

PHP

 ... if it don't woik as is then ping back and we can look...

jammaster82

Woah, I have no idea why my brains dont
work any more, when i actually refresh
it does work on both servers....

Applause

The japanese have this thing called the
mitsu no kokuro... which means that the
mind should be still and calm like a lonely
pond.

But what happens when the big kids come
around and THROW GIANT ROCKS IN IT AND
ALL THE FISH START SCREAMING THAT A
SINGLE CHARACTER TOOK AN HOUR AND
A HALF OF YOUR FIRST DAY AS
A

PHP

  PROGRAMMER AWAY FROM YOU AND
ITS GONNA BE POSTED ON GOOGLE FOREVER
THAT YOU ARE A DUMBASS.... THEN WHAT?!?!?!

      THEN WHAT>!>!??!?!?!?!


Applause  thank you. they want me back at the
center early tonight so ill be loggin off soon.

ratthing

I hear you JM, I hear you. 

What's worse--you *think* the program/server config/etc is working, get it all fixed up and moved to production, and the new bits don't work.  You think, "WTF, over?"  You go back and look at development, and Applause you forgot about X thing in place on development, so of course the new bits worked there.

It always happens, it just happens for different bits the further along you get on the

learn

 ing  curve.

=RT=

perkiset

JM you must certainly remember my deep and unabiding respect for Murphy in these instances. It's probably completely unchanged, but the Universe simply didn't want it to go that easily for you yet.

Deep and unabiding respect, let me tell you.

ratthing

quote author=perkiset link=topic=685.msg4727#msg4727 date=1199577738

JM you must certainly remember my deep and unabiding respect for Murphy in these instances. It's probably completely unchanged, but the Universe simply didn't want it to go that easily for you yet.

Deep and unabiding respect, let me tell you.

It's essential to make the proper sacrifices (like cutting yourself and bleeding on your server case) to whatever computer ghods are overseeing your area, or to put up wardings against evil spirits.  I have a very ugly Dia De Los Muertos mask I hang up by my desk at every new job (hmmm...I guess that means I should hang it up here at home...preventative medicine is best).

Murphy is a mean bastige.
=RT=

dink

There is nothing in the world so cool as having some piece-of-shit code string actually run as you wanted it to do.  Especially after having spent countless hours trying different things/ways.

My expectations have changed a lot.  Nowadays I expect to find empty arrays and vars full of unintelligible mush.  I have error reporting set to "get all of it and print it out right here so's every whore can read it".  Most times the error reporting contains more bytes than the script did.  Applause

I was so very proud last night.  A small script that I have been working on (fruitlessly) for some time, actually got past the fatal error stage.  When I gathered up the results, my joy diminished to a very small smirk.  The returned data wasn't anything like it was supposed to look.  Ah well, the thrill of

learn

 ing  something new.{sux rawr egos}

jammaster82

quote author=perkiset link=topic=685.msg4716#msg4716 date=1199565780


That one got me bad for a while when I was first starting, and was single handidly the reason for why I code with 100% ZERO html-plus-

php

  style - it's all pure

PHP

  style with blocks of HTML.



Yeah... now i can think... thats why i never liked
ColdFusion, it was like the WRONG way you mentioned,
so it ends up being this monolithic monstrous self referencing
loop  Applause nightmare...

makes me want to (in pseudocode for lack of knowing

php

  yet..)

<?
require "genericlogindatabasesitehandler.

php

 ";

$outstr=fileread(somehtmlaclientwantstowrapthingsaroundthatheh

asp

 lantedmyvarlistin);

echo <<<HTML
$outstr
HTML;

?>


and then just make a generic login database
and just do this TDereferencer/RB4 style...

and then publish some list of vars to the client

$thetableweagreedoncontainingtheproductslistedver121a
$thedate
$thecompanyname
$thecompanyfonenum
$etc..

then he can do all the design for the site
and i can just change a few things when i get
a new client hahaha

perkiset

You'll get there.

I have a deligthful suite of that sort of component/objects that allows me to build really sophisticated stuff in tiny amounts of time. You'll see soon - you think the right way.

/p

jammaster82

themessage := '                              I still find use of that thinking,'
outstr := deref('&themessage'+' even today at '+FormatDateTime('hh:mm:ss',now())+'....  ')
consoleoutput(AllTrim(outstr))
terminaloutput('=JM=')

perkiset

Do you still actually have one of my robot interpreters running?  Applause

jammaster82

I still have it!  I actually used it to write an eight line program
to insert these huge sql files i have into the ms sql server...
i had it chew up the entire bible out of a text database and
turn it into sql statements then execute them ten by ten,
throwing exceptions into a seperate TStringlist.... beat
the hell out of doing it by hand!!

I made a speedreader bot with it last summer too, pasted
some stuff in it i want to read and Consolefontsize := big
and it flashes the words one at a time in the same place on
the screen youd be surprised at what you can retain just
pasting like a huge wiki article into the speedreaderbot and
watching it for a few minutes, when you go back and manually
read the article, all the terms are there for you and in context!

Tparser, TDereferencer, And TNamedCollection I was using
in my stockbot but they found me out and i started getting
bogus returns i did however get almost half of all the nasdaq
data since 1980.. (yes all) with my THttpGet and your TParser... now to hit
the next site up with a newer, slower , broader approach.... new ips every two
days , one request every two hours, i should have everything in a year muahahaha

perkiset

Man I don't have any of that stuff anywhere... I'd love it if you could make me up a care-package and forward it on... I'd love to see that robot GUI one more time, as well as the code for TParser and TInterpreter if you still have them, which had some rocking code in them.

(Side note, of course I'll clean and post here for anyone else interested)

jammaster82

::digging::

im not sure if the TInterpreter stuff made it  through
the storm i will have to meta dig and i dont think i had
the complete thing either but i have utilfuncs.pas on my
mybook....  TInterpreter is on an old cd backup
somewhere give me a few on this..

i do have tparser, tnamedcollection and tdereferencer
and the compiled robot directory and all my old scripts

MAN YOU SHOULD SEE IT RUN ON A MODERN COMPUTER
I mean it was beating c++ parses on the 100mhz computer
you wrote it on...

perkiset

LOL I can't wait to see whatever you come up with. I do remember that the interpreter was fast as shit through a goose... I really enjoyed writing that language.

Whatever you find will be more than I have and I'm grateful, thanks man. Am I reading you correctly that you have the compiled TRobot executable still?

jammaster82

NP your going to have to wait though, i have 40 some cds
with .arc files on them (or whatever they call it now) ive
extracted three of them to mybook and will rotate them
through the night and we will see what i have still Hurricane
isabel drowned most of my stuff that wasnt
on the 2nd floor.....  <sniff!>  i was relieved of an

apple

  iic
all the pong games that ever came out including atari video
pinball which was REALLY RARE... coleco tristar arcade...
520st, 1040st, 130xe, atari 800,400... a museum, gone
along with an entire

net

 work of trs-80 model 1 computers
with working epson mx-80 printers and mortgage banking
software i helped to write and

learn

 ed how to program on..
pillbox.bas , eliza.bas, scarfman, swashbuckler, hitchikers
guide to the galaxy, castle wolfenstein(2-d) , spy hunter

GONE.

MALIBU> >> GONE.

Applause

stand by..

perkiset

Oh man... ::sniff:: your Malibu is gone? You know how that breaks my heart  :Applause

(Sorry anyway bro)


Perkiset's Place Home   Politics @ Perkiset's