logs archiveIRC Archive / Freenode / #php / 2006 / March / 25 / 1
Viflux
The only advantage that type hinting can provide is for development. That can be emulated through comments and an IDE that includes the comments in it's intellisense popup.
kieran491
so Viflux what would i tell the header to do so that the infomation gets posted but dose not allow the user to just hit like F5 or just go back to the page?
GarethAdams
Viflux: definitely. but that goes out the window when you share your code
Dark_Fire
(Action) is away. Reason:((Auto) Away after 2hrs) Since:(16:06:56) Pager:(on) Log:(on)
Viflux
kieran491: If you redirect the user after the POST is made, a refresh won't resend the POST because they've left that request behind.
Narada
Hmm weren't away msgs forbidden in here?
Viflux
GarethAdams: Documentation doesn't go away when you share your code.
mareks
anyone want to work on a php-mvc project w/ me?
prophile
hah
I just found an old function I wrote
make_php_segfault();
         

mareks
prophile: what is it
prophile
the name says it all
it's a function which makes php throw a segmentation fault
GarethAdams
Viflux: it doesn't, but if the other person uses a different developing environment then it could be useless. I guess that's more an argument against type-hinting in general than your approach though
mareks
i dont know what that means :-(
kieran491
so Viflux i could get away with header("Location: http://www.example.com/") then all my code above or bellow it?
prophile
mareks: google for "segfault"
Viflux
kieran491: There's more to it than that, google for a tutorial.
lennart
when I extend a class, how do I make sure the constuctor for that class is executed? .. is there any 'super()' or something like that like in Java
prophile
lennart: __construct
d3vlabs
this should take a second:
http://pastebin.com/621597
lennart
prophile, just like that? __constuct; ?
Viflux
lennart: parent::constructor()
d3vlabs
try to put delicous code on my page inside of php
prophile
lennart: in your class have a function called __construct() and this will be called whenever your class is instantiated
it has to be two underscores, remember that
Viflux
prophile: I think he's referring to the parent constructor
prophile
Viflux: He didn't seem to know what __construct did therefore I'm assuming he's not using inheritance
although I may be wrong
Viflux
prophile: He asked "when I extend a class". That seems like a good hint he's using inheritance :)
prophile
Viflux: oh, heh, my bad
Viflux
;)
prophile
Viflux: perhaps I should read next time
         

mareks
anyway to put constants in the middle of strings w/ out closing and reopening quotes?
example: $str = "bla blah blah {CONSTANT} blah blah blah";
Viflux
mareks: No, and it would be bad form to do that anyways.
lennart
if I make a function with the same name as my class .. that is not the same thing as a constructor?
Viflux
mareks: Actually, there might be, but it's still bad form :)
mareks
what would make it "Bad form" though?
kieran491
Viflux hate to be a pain spent some time looking could'nt find any you know of sum?
mareks
you can mix regular scalars in any time
kieran491
i found some but i am not suer if there what you ment
prophile
mareks: I'm pretty sure there is no way of doing it, you'll have to use the concatenation operator
mareks
"blah = {$blah}" is used all the time
kieran491
http://www.phpfreaks.com/quickcode/Redirecting_the_Web_Browser_with_PHP/14.php
mareks
thank you prophil
e
prophile
no problem marek
s
d3vlabs
oy
http://pastebin.com/621597
will take a second
for anyone with an eye
Viflux
kieran491: Here's a Javascript one - http://www.elated.com/tutorials/programming/javascript/prevent_multiple_submits/
kieran491
but what if the user keeps pressing F5 on a page to send multyple POST's
d3vlabs
(Action) dances around #php to get 5 seconds of attention
Viflux
kieran491: Why don't you just look at the phpbb source?
d3vlabs: What's the problem?
kieran491
i got an idea
d3vlabs
Viflux: http://pastebin.com/621597 = this idiotic thing
Viflux
Yes, you've posted the link 3 times but never once said *what* your problem is.
d3vlabs: I'm not going to look at your code without knowing what I'm looking for.
DespNekus
Does anyone here uses Zephyr?
d3vlabs
oh
my problem is
i got incorrect usage of quotes over there
cuz when i load up the page
Viflux
d3vlabs: Just from a glance, you have all kinds of parse errors in there.
d3vlabs
well it fails
prophile
indeed
d3vlabs
err all i added were the quotes
prophile
you have to escape the inline 's
d3vlabs
the code is provided by http://del.icio.us
and thats what everyone uses who got those tags on
prophile
echo '<a href="http://del.icio.us/post" onclick="window.open(\'http://del.icio.us/post?v=4&noui&jump=close&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title), \'delicious\',\'toolbar=no,width=700,height=400\'); return false;"> Save This Page</a>';
try that
lennart
is the constructor in the class I extend executed before the constructor in the class?
prophile
(the code above is directed at d3vlabs)
d3vlabs
right
give sec
Viflux
lennart: The parent constructor is not called automagically, you have to call it explicitly. Therefore it can be executed *inside* the constructor of the subclass, either before or after (or in the middle of) it's own code.
lennart
k
d3vlabs
prophile; yeah that did it
weird i couldve swore i tried it
guess naaaah
prophile
that'll be $2.99 please
hehe
lennart
and how do I call it?
prophile
lennart: <name of parent class>::__construct()
lennart
thnaks
thanks
prophile
no problem
mareks
i have transmit running on my mac and it seesm to have crashed but i cant close it, any ideas on how to force quit it?
( sorry im a new mac user )
prophile
mareks: os 9 or osx?
mareks
x
prophile
mareks: control-click on its icon in the dock and select "Force Quit"
mareks
it only gives me regular "Quit" option
prophile
in that case
activate it by clicking on its icon in the dock
press cmd-alt-esc
select it from the list
click "Force Quit"
mareks
ahh thank you
hello heybaby
nice name haha
prophile
mareks: no problem
heybaby
Hi everybody, do you know of any application that uses OOP?
Viflux
lol
mareks
lol
psyke930
lol
mareks
pretty much every application uses OOP
Viflux
Best question of the day.
gotaq
i've got now a string with $str="te\"sting"; now if i put that string inside an html tag, the " in the middle, borks up everything, how can i fix it?
heybaby
well I mean one where I can see some real use of OOP, not just some tutorial that shows me what can be done.
gotaq
OOP rules
look at open source code :)
heybaby
and one that specifically uses PHP 5 OOP
prophile
heybaby: there's a great site for all that kind of stuff
heybaby
prophile: which site?
Viflux
heybaby: If you want to dive right in learning quasi-useless design patterns, check out the Zend Framework
mareks
heybaby, im considering opening my template engine to open-source which is pure php5 OOP
prophile
heybaby: www.google.com
mareks
but i dunno
gotaq
is it better than smarty?
heybaby
I looked into WASP
mareks
it takes a different approach compared to smarty, and it doesnt introduce its own syntax
prophile
I personally like smarty but I think it's a little bloated
mareks
you have to do the template designs obviously, but the root templates coordinate everything and make it very easy to add content
my template engine is just one file, and then for each separate page you have, you write in the custom templates which extend the root templates
gotaq
i see
mareks
all template calls and initializations are automatic, so all you have to do is basically put "class PagenameContents { ... }" around your content
gotaq
you know web.py script ?
(google it), very nice template as well
markes: you know PRADO ?
mareks
never heard of either :-(
googling both now
funniest part of this, is its my best php-oop work. its for my moms website
gotaq
welp web.py is a pretty cool idea, but it's in python, and very novel, but PRADO is very semilliar
mareks
shes a dog breeder, http://www.tootsiepup.com/
admin login for functions is admin/key
u can mess w/ it. i havent done much work as far as adding immunity to user-entered data
so dont try to intentionally break it w/ injecting html or jscript lol
gotaq
its a blog system ?
mareks
well it has news functionality,
browse to the puppies section n stuff
theres a ton of admin tools for the puppies
Viflux
puppies use the internet now? ;)
gotaq
puppies can admin ? :)
1 2 3 4 5 6 7 8 9 10 11 12 13 next »