| |
| |
| |
|
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 33 34
Comments:
<0> s/jeg/jpeg/ <1> Dr-Linux, google for +perl +asterisk then +php +asterisk and see <2> quick q: can i put text into <textarea> like i can with <input type='text' value='$data'> ?? <3> Dr-Linux: see thet link <4> Qube, my logic was, "I should keep all my database stuff in a separate file, and include that into the other files as needed." <1> I'm guessing, but I guess perl > php for that <3> Dr-Linux: http://learn.perl.org/ <4> by database stuff, I mean things like host, p***word, table names etc <1> Soliah, including other files from inside functions isn't smart tho <5> barf: sure <4> I'm not including inside a function, just at the top <1> because _everything_ you include will then only be local scope to the function, including other functions <4> the file has lots of function in it that'll use $tablename <2> jmut, using value='' inside <textarea> doesnt work though, i must be missing something obvious? <1> why not p*** $tablename to the function as an arg? <5> barf: well of course.... you have innerHTML there not value.... just put the stuff in <textarea>$value</textarea>
<1> I like to p*** a single ***oc array arg to functions, that way you can send whatever you want in in a simple way <4> from what I can see, the variable should be global <4> I declare it in a global context in one file, include that file in a global context in the second file <6> haha jmut Iw as trying to figure that out before and I just realized how obvious it is <5> Soliah: which version of php you use? <4> and call the variable i need from a function <1> MyDBConnect( array('dbname'=>'db', 'tablename'=>'***or', etc)); <0> can somebody help me with an compile problem? <4> jmut, 4.4.2 <2> jmut, /me slaps the forehead... cheers mate <7> hi <5> Soliah: well if you don't like OOP approach , which is difficult in 4.* series of php you don't have much option than p*** stuff as argument to function. otherwise it will be global. <7> when i require an html file from a different directory, why doesn't the image requests work from the directory it's being required ? <8> is there a way to create a php cl*** in an Extension? <5> Soliah: else...I would do a Table DataGatway pattern or whatever that know exactly what to do with table (all CRUD thing). Then you should not tell the whole application about the table name etc. <4> I find OO kinda weird in PHP <4> maybe I should just use rubyonrails <5> Soliah: well...it depends on the scale of programming. I find it pretty useful <4> Oh yea, I <3 OO <9> do you guys think, it's better tutorial for me? <9> http://learn.perl.org/library/beginning_perl/ <7> if require() works as if i was putting the file into the actual file, why doesn't it simply work <img src='img/logo.jpg' alt='logo'> ?? now i have to use relative paths to find the image <4> I just can't help but feel it's kinda of hacked together in PHP <5> lugzer: :) I was refereing to scope isssues. not to path issues. And the problem I guess comes from not well though template/script structure. otherwise yes. you have to use relative path...as you show in the code <1> lugzer, relative paths are bad... why do you need them ? <3> Dr-Linux: right question on wrong channel... <10> meh overtime <10> a day <10> ok i suppose <8> I can't seem to figure out how to put functions onto an object <3> but answer.... yu'll find out on perl... <7> Qube, well if you're building a bigger app, how would you feel typing <img src='/myapp/core/webroot/subdir/images/IMAGE.jpg'> every time ? <1> I tend to use: include $_SERVER['DOCUMENT_ROOT'] . '/inc/whatever.php'; <7> jmut, i found this issue in cakephp for example <1> lugzer, I do, and I don't do that :) <3> why <7> jmut, to make images work i need to type the complete absolute path <1> lugzer, see above <7> Qube, reveal a bit of the secret <7> i'm lost <4> Wow. <4> I wonder if PHP5's scoping is any different to 4's <5> lugzer: use Qube solution but I think it is not necessary at all. donno particular situation. <4> :< <3> *qube maybe you should use .... include(dirname(__FILE__).'/bleah/aha.php'); <3> :P{ <1> well $_SERVER['DOCUMENT_ROOT'] is likely to be '/myapp/core/webroot' no? <7> Qube, not necessarily. where are you getting here? <5> I like alecs approach even better as I don't really trust $_SERVER thing <1> alecs, no because that then makes your code relative to the dir your script is in... <1> which can prevent you from making e.g. a test dir in a subdir to try some new code <5> Qube: you could always set BASE_PATH constant and use it <3> the script is on the same server? <7> Qube, to type <img src='<?php DOC_ROOT_CONST.'/image.jpg'; ?>'> .. nooo... <1> jmut, yeah I do (in a way), I set $filerel and $hrefrel at the top of the script <1> $hrefrel is usually just '/' and $filerel is docroot <10> lugzer: you'd need an echo <8> anyone got pointers for me? <7> Ratty_, obviously, i forgot to add it <5> mithro: you are asking how to create cl***? pls clarify.10x <1> lugzer, then, sir, you are just being lazy
<7> Qube, no ;) just trying to find a golden solution <1> lugzer, we gave several here... they all involve slightly more typing, you doin't want to type. <8> In a C Extension I would like to create a new php cl*** <7> Qube, actually i think i've got it, Savant has image plugin.. ;) <5> lugzer: golden solution would be to have registry including config object or something with important paths(full) in it...and use them wherever you like <5> mithro: :) how are we supposed to know it is C issue :). Sorry I cannot help <9> Qube: php is big language or perl? <11> mithro: you can create cl***es inside C which PHP will be able to use, i'd start by reading through the Tidy and SimpleXML extensions, seeing what they do (but prepare for a lot of headaches) <8> okay <1> Dr-Linux, both are well established. imo php is better for web and "user application" type jobs... perl is better for parsing/scripting/integrations between disparate systems <12> hey guys :) - I want to put a date into mysql, i manage to get the date and echo it too my website, then i try to pick it up as a variable from the form, and put it into mysql, but no luck, here is the code: <? $date = date("Y-m-d"); ANY ideas? :) <13> hi how can i prevent from multiple data being entered into mysql database? i dont know how does it happen. it just happens sometimes that there are 4-5 duplicates for some records. <13> sorry not multiple data --> duplicate data <14> tony_: add unique fields <15> hey folks - I can code php, but I have NO idea how to install it on my mac (running php4)... how do I install php5 on my mac? <15> yes, I've used entropy - but it only installs for my user account, not globally, nor does it effect the php available in my terminal (I do have terminal php scripts) <13> wazp, will it make anyother problems? using php to eliminate duplication is better or using unique is better? <16> bemson: Go and read http://php.net/install <15> will do <15> grtazi <17> hei BigE <16> hi <17> :) <14> tony_: just make unique index by few important fields. the second time the entry will not be placed in the db <18> how can i check if a link is broken or not? and without use of CURL or sockets? <12> hey guys :) - I want to put a date into mysql, i manage to get the date and echo it too my website, then i try to pick it up as a variable from the form, and put it into mysql, but no luck, here is the code: <? $date = date("Y-m-d"); ANY ideas? :) <19> is there a decent development framework (portal style) out there for php? <14> Kingmilo: use mysql functions :) <13> wazp, thank you . but when i try to enter the same data again, will it give me an error msg and stop or do something else to screw up another record? <12> wazp, $request = "INSERT INTO `deferments` ( `defid` , `cusid` , `defdate` , `fileno` , `duty` , `sch12b` , `vat` , `amount`) VALUES ('', '$cusid' , '$date' , '$fileno' , '$duty' , '$sch12b' , '$vat' , '$amount');"; <19> something with true user/group management, that would work in a buisness style enviornment <12> but i dont think im generating a variable php side? <14> tony_: i think it will return you error message ... at least with pear you could check with if (DB::isError($res)) <19> i'm looking to not recode the wheel <14> Kingmilo: if you insert current date, why don't you just insert NOW() in mysql <14> it's the same <12> wazp, yes i cud try that ty ;) <12> thanks <17> use an integer and insert with time() <13> wazp, ok. i know the error is caused by the user pressing the submit button a few times. because sometimes the page takes a little while to refresh. i already have a check in place to prevent duplicate entries in my program. but surprisingly this doesnt work when the user presses the submit button a few times countinuously. <17> and later you can format with date(), to reduce dependence from mysql <17> tony_ try to use the session to avoid double insert <14> tony_: using unique will prevent errors <17> yes too <14> kioto: won't help in all cases ... <14> especially when double clicking <13> wazp, ok thank you. i will use unique then. <13> thanks kioto <17> np <13> wazp, my current table has no unique fields except the ID. so if i change the field into a unique field, will I loose any data? <14> i suggest you to use several unique fields in one unique key <14> if there is already duplicate data, you won't be able to create the unique key <11> oh ****.. <13> wazp, sorry i do not understand what you said. in my table i have columns and raws and i can change a column to unique. is that i need to do? what do you mean by several unique fields in one unique key? <14> several columns should be united in one unique key <14> you choose which... like firstname, lastname, some_specific_data <13> wazp, ok then? <14> you create one unique-type key with the columns you want <14> that's all <11> gah!!! why doe sit keep anouncing it :/ <14> there's no 'then' :) <13> wazp, thank you :) let me try. <14> tony_: np <20> caffinated: You around? <13> wazp, is it unique-index type key? <14> yes <21> harrrr
Return to
#php or Go to some related
logs:
Ubuntu not connecting fckeditor setselectionrange #math kubuntu root unmounting a drive #linux ubunto software raid wusb54g+linux #perl #linux ubuntu gnome-moz-remote
|
|