| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Comments:
<0> but allways set it again to iso-8859-1 <1> cb921: okay, here's the old extension <1> http://au3.php.net/manual/en/function.mime-content-type.php <1> here's the new extension, http://pecl.php.net/package/fileinfo <1> it's undocumented at the moment <1> lamers_inn: I told you how to do it, what is the problem? why are you asking if I'm here when I typed something 14 seconds before you asked? <2> you rock <0> aidan: what must be changed in httpd.conf? <3> j carlh.devel <0> aidan: Ok it is apache thats changing my tag. when using command line, headers are correct. <0> header("Content-type: text/html; charset=UTF-8"); <0> doesn't help <0> any idea? <1> Kako: there's an override in the httpd.conf as well, look for it <1> or ask in #apache <0> already searched, thanks, going to ask there..
<4> me me <4> hmmm <4> hmm <4> sorry wrong window <5> erm <6> Can I ask an advanced coding question? <7> define 'advanced' <6> I have been searching for the solution for three days, and I've not had to ask anybody anything in five years. <8> hey friends. in php, is it the best way to provide an authentication by including a session checker code in all the pages we want to secure? <8> or is there another way <6> It involves p***ing a variable ***ignment statement as a variable into a function to use in a loop. <8> i looked for http authentication, but it is not what i am looking for <9> hi <1> sottwell: ... just ask <6> I have a function that queries a database and outputs links for each item it gets from the database. <1> sottwell: are you expecting someone to say "no, you cannot ask advanced questions here" <6> I am trying to be polite, aidan. <7> !+ask <10> If you have a question, please just *ask it*. And don't address specific people - ask the channel. If somebody knows, they'll answer. :) To get help more quickly, don't ask "can I ask a question," "can anyone help," or "does anybody use/know about foo". Be as specific as you can. Also, please don't /msg people without permission, and read the topic before you ask. <1> sottwell: I know, I appreciate that but it's annoying :) <6> One should knock before entering. <1> sottwell: not in here :) <9> How can I test if a table exists inside of a database with PHP? <6> back to the question. <5> well that's quite advanced <1> man this is wierd :/ my mailserver tries to do something every minute for 6 seconds, which is failing <1> wfq: mysql_table_exists perhaps? <11> ux <6> The function creates links by loopin through database results. It accepts several aruguments, such as $pre to put before the link's text, and $post to put after the link's text. <1> wfq: http://au3.php.net/manual/en/function.mysql-list-tables.php <8> does anybody have an idea about my question? <1> sottwell: I hope this is going somewhere <9> aidan thanks, i didn't know what there was this function in php <6> The link url and link text are taken from the database, $result['url'] and $result['text']. <9> thank you very much <1> wfq: nor did I, check the manual <5> sottwell just described almost every php script in existence <1> maul``: sesssion check every page <6> What I want to do is to be able to p*** $result['description'] to this function as the $post value that will be appended to the link text. <1> where is $result coming from? <6> I mean "$result['description'] literally. <1> ... that is your advanced question? <8> aidan: so is this the common way of doing authentiation? i include a authentication test (by checking for session variables) php script at the top of my secure pages? <12> okay, what the hell <6> The function gets it from the database query that is part of the function. <5> i didn't understand the question <1> $foo = '$result[\'description\']'; <1> maul``: yep and yep :) <8> aidan: okey thanks <12> http://r-butler.net/~robert_/code/post.phps doesn't want to process dependents past #1, wtf <1> syf: I think he just wants to echo the actual string $result['description'] <5> ah, well that seems right then <8> and ... if i have a good server-side validation, do i need prepared statement? (which only run once in database) <6> When calling the function, myfunc($pre, $post) how would I call it myfunc('go to', $result['description']) so that the link would end up with "go to linktext description" <1> maul``: if you want ... you don't need to, but it's faster <13> sottwell: What about just p***ing 'description' as the $post argument and then do something like print((iseet($result[$post]) ? $result[$post] : $post)); <1> sottwell: ... exactly like that <6> I don't want to have to hack the function; it's part of an external library. Hacking the function is a no-brainer. <8> aidan: my query will run only once. is prepared statement still faster for this case? <1> sottwell: ahh I get it
<1> sottwell: you can't <1> sottwell: you can't access the internal scope data from the outer scope <6> I don't want to access it. I just want to be able to p*** that string "$result['description'] as a string that gets evaluated in the loop where it's used. <1> you can't <1> you want to access it <13> ...not without modifying the function <6> so I can't have $post = "$result['description']" in any manner. <13> sottwell: no because the function dosent know that it has to eval $post all it does is print it as-is. <13> sottwell: the only way you can do it without modifying the function is to get $result before the function call. <6> Well, that's what I thought, have to go with a hacked version of the function then. I think I'll go get a pizza for consolation first. Thank you. <14> Anyone know of a good script to convert html to plain text? <4> oober: there's a strip html tags function. <4> I think ... <14> hmm <4> oober: http://www.php.net/manual/en/function.strip-tags.php <4> There are quite a few examples there as well. <2> OK Can I do this: $a=explode(',', "1,2,3")[0]; instead of two-stepping like this: $a=explode(',', "1,2,3"); $a=$a[0]; ? It doesn't want to work :< <14> Does that function retain formatting, new lines etc ? <4> oober: I do not have the answer to that question. Play with it. <4> you could str_replace('<br>',"\n"); before you run the strip tags. <15> does anyone have any links to a basic login example? <4> then after the strip tags run nl2br. <15> nl2br() <14> hmm, this http://www.chuggnutt.com/html2text-source.php also looks promising <4> Bizzeh: actually my example was br2nl <4> Bizzeh: did you want an http auth, or a session auth? <15> session <4> let me write one. <4> It'll take a few minutes. <15> you dont need to write me one <15> i just need a refresher on how it works <4> It's really easy. <4> #1 post from a form <4> session_start(); <4> at the top <16> can someone please tell me wtf an abstract cl*** is please? =D <15> punkstar: cl*** with no function implementations <4> then if ($_POST['uname'] == 'x' && $_POST['pword'] == 'y') { $login = true;} else {$login = false;} <15> its just an interface you extend from later <16> so it has no methods.. <15> it has methods <17> punkstar: The abstract modifier provides an ***urance that it cannot be instantiated. <15> just not implemented <15> function poo(); <15> thats all you get <16> so no new cl***name; etc <15> exactly <15> you have to extend from it later <16> yeah, so what is the point of it being there? <15> and new the cl*** you made extend from it <15> to define a set interface <16> why not just make poo in another cl*** <17> And an abstract cl*** can have non-abstract functions in it :P <16> dood.. lol. <16> its google time. <15> like cl*** PluginBase { function getName(); function getContent(); } <18> dood upwards down is poop <17> Bizzeh: You're missing a couple of abstract keywords. <15> so everyone who writes a plugin for your script, HAS to use pluginbase so they HAVE to use those functions <15> Charbal: just giving a quick example <16> abstract cl*** PluginBase() <16> thats what it should be right? <16> and then abstract function name(); <16> ? <17> Right. <16> it still dont GET IT! <16> i find it pointless. <19> punkstar, it provides a blueprint for inheriting cl***es <15> think pure virtual cl***es in c++ <19> for example: an iterator which loops over various datasources (resultsets, arrays, etcetera). Each iterator should have at least the methods next() previous() etcetera <19> hence it would b e useful to create an interface <17> punkstar: It's somewhat similar to interfaces. Are you familiar with how those are used? <16> not at all <19> read my example above then :)
Return to
#php or Go to some related
logs:
insmod bttv tuner +ubuntu Latin1_General_CI_AS postgres volari v3 xorg.conf #physics bitstream cyberbit gentoo #css #linux how to change latin1_swedish to utf8 buu eat ubuntu problem unable to read ICEauthority
|
|