IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.49 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-28
[11:10]<bfracxjfm>someone of yours uses php5.1.4 and apache2 and want to connect to mssql database?
[11:14]<sjfzzs>hey, I wondered if there is a php class, or some script, that automatically creates a form (insert,list,edit,delete) for a single db table. from what I know I could use phpmyadmin/mysqladmin or a framework like rails. but thats an overkill for just one table. can anyone give me a hint ?
[11:16]<-- 2yd2nzy xrs fuyv>http://iownmymusic.org/")
[11:18]<czcnzlzvvyz>where can i find a list of php reserved constants?
[11:23]<_dugk_>what is the best way to get around using relative links between sub-directories in a site?
[11:25]<vygaggv_>don't
[11:25]<vygaggv_>they'll always cause you problems
[11:25]<ajfmnz>_DunK_, you should use absolute links, using "/dir/to/file.php" for example, no need to have the http://...
[11:25]<rymrg>href="../foo/"
[11:28]<_dugk_>I think I am doing something wrong with them. When I address /css from /subdir it looks for the css folder in /subdir/css
[11:28]<_dugk_>what am I getting wrong?
[11:32]<pzds2n2jd>i recompiled php and apache and mysql yesterday, now i am getting
[11:32]<pzds2n2jd>Jun 28 10:38:35 develop /kernel: pid 76885 (php), uid 1006: exited on signal 11 (core dumped)
[11:32]<_dugk_>this is the thing: if I use ../css/styles.css it finds it, but /css/styles.css does not
[11:36]<_dugk_>so "/dir/to/file.php" can't look in a directory above without using a relative reference: ../
[11:37]<_dugk_>surely one of you knows a way around this?
[11:39]<_dugk_>please?
[11:43]<sjfzzs>_DunK_, if / is your webserver root, just use /dir in file.php for the dir above ?
[11:44]<kyrrdyfj>Guys could someone please have a look at this code: http://hashmysql.org/paste/viewentry.php?id=2055 | I have a short explanation there.
[11:44]<ajfmnz>Kingmilo, mysql_query();
[11:44]<ajfmnz>line 4
[11:45]<kyrrdyfj>I will look quick
[11:45]<ajfmnz>drop the line 4 , and change prepend $result = to the line 3
[11:45]<ajfmnz>s/change//
[11:50]<suv9w9>here's my solution for extensible singleton: http://pastebin.ca/73794 do you see flaws, place for improvement?
[11:50]<xmlxjym>just don't. use factories instead
[11:52]<suv9w9>Xyphoid, it doesn't make sense to have a factory for a totally unrelated classes (that are just singleton, and that's all they share)
[11:53]<xmlxjym>in that case it doesn't make sense for them to be inherited from a common class
[11:53]<xmlxjym>provide a registry or something, don't inherit from GenericSingleton
[11:54]<suv9w9>what is the difference
[11:54]<rymrg>yeh, if you're going to use a pattern, don't butcher it
[11:54]<xmlxjym>http://www.cabochon.com/~stevey/blog-rants/singleton-stupid.html
[11:54]<rymrg>it's semantically stupid
[11:54]<rymrg>if you want a singleton, which you almost always will (for DB, template, etc), have the singleton methods in your framework class.
[11:54]<suv9w9>let me know why it's stupid, just calling things "stupid" is totally void of content
[11:55]<jpcwn77>anyone in here have phpmyadmin working?
[11:55]<suv9w9>aidan, this is what I have, just my DataTable classes extend the Table class
[11:55]<suv9w9>Table is part of the framework
[11:59]<kyrrdyfj>colder, ok i did that but it didnt change much. my variable $cus if i change that to Rialto Foods then i get a result, but if i leave it as a variable no luck?
[11:59]<ajfmnz>what ?
[12:00]<ajfmnz>paste your actual code please
[12:08]<lyjgrjac>anybody know for any free FreeBSD web hosting control panel ?
[12:09]<yj_nzzjz>ISPconfig ?
[12:09]<2nvyd>hi, ex index.php?id=1, I want /index.php/id/2 or index/id/1
[12:09]<2nvyd>how can I make that
[12:10]<suv9w9>how can I use autoinclude, and still not have to keep all my classes in the same folder so they could be found
[12:11]<2nvyd>*it
[12:12]<xmlxjym>since you have to write your own autoinclude method, surely you'll just include from somewhere else?
[12:13]<suv9w9>Xyphoid, no I mean in the same folder elsewhere :) like /classes/ and can't have /classes/core/ , classes/data/ etc. Looking for tips how to keep code clarity AND my folder structure in there ;)
[12:14]<yj_nzzjz>betim: read $_SERVER['PATH_INFO'] and do whatever you want with the data.
[12:15]<afnwc>Hey,
[12:15]<xmlxjym>there are a squillion attempts at doing that in the comments for the autoload function - autoscanning and caching paths for classes as they're needed
[12:15]<lyjgrjac>io_error ISPconfig does not support FreeBSD :/
[12:15]<yj_nzzjz>LionRock: I dunno then.
[12:16]<-- svgvsdyzgjvr xrs>/dev/null")
[12:16]<afnwc>Is there anyway of converting text from a textarea into differnt vars/array for every new line?
[12:16]<afnwc>It's for an Address box, so I can insert it into the database as Address1 Address2 etc, but from 1 Textarea box
[12:17]<xmlxjym>alex: $arr = explode("\n",$string)
[12:17]<afnwc>Xyphoid, thanks =)
[12:18]<2nvyd>io_error, can you give me an exmaple?
[12:19]<2nzzd__>AlexC: We're not in #sql or anything, but 'the database as Address1 Address2 etc,' sound like a bad data-structure/-design.. Not saying this for flaming, but perhaps it might help you.
[12:19]<yj_nzzjz>betim: an example of what?
[12:20]<2nvyd>of parsing url form blah.php?id=1 to blah/id/1
[12:20]<afnwc>berry__, I thought that, but the structure is already there and a lot of the code uses it, so I mayaswell just keep it like that. If i was doing it my self, I would have done it differenty
[12:20]<xmlxjym>it's pretty common to have a set DB format with stupid field names, unfortunately
[12:20]<2nzzd__>betim: Google for apache's mod_rewrite or multiviews
[12:20]<yj_nzzjz>betim: here's a complete example: <?php $path = explode("/", $_SERVER['PATH_INFO']); var_dump($path); ?> read it and see what it does :)
[12:21]<2nzzd__>Xyphoid: Right you are.
[12:31]<suv9w9>I want to split my files into three logical pieces: input, business, output (presentation). right now it's all in global space and global shit flies around hitting the wrong parts of the code. That's bad. But what do I do, I just pack it in 3 functions, or use classes somehow?
[12:32]<pfraaym>OOP?
[12:33]<rymrg>suv4x4: you want to use a Model-View pattern. Accumulate your data in a single place, and pass it to a template
[12:34]<rymrg>all your buisness logic should be abstracted away in a class, which is called from your model
[12:34]<suv9w9>aidan, yes, thing is how exactly: is the template a class, a function
[12:34]<suv9w9>also do I split input processing
[12:34]<rymrg>suv4x4: no, that's part of your model
[12:35]<rymrg>your template can be whatever you want
[12:35]<suv9w9>if not, how does the view know, for ex. that GET vars to add to links, to preserve state
[12:35]<rymrg>because you pass the relevant information to the template, obviously
[12:36]<seawjppw>.oO(by using the controller )
[12:36]<suv9w9>SEAwolfx, could you elaborate?
[12:37]<seawjppw>i guess the model-view pattern is not the same as the model-view-controller pattern, if so forget my thoughts.
[12:38]<rymrg>SEAwolfx: let's not over complicate, he's talking about a single page, a controller isn't needed
[12:38]<seawjppw>ok, but its worth looking at it: http://en.wikipedia.org/wiki/Model-view-controller
[12:39]<suv9w9>thing is I know the pattern, I'm stumbling onto concrete impementation decisions
[12:39]<rymrg>like what? stop asking vague questions
[12:39]<rymrg>do some research, you've not going to learn how to implement an MVC by chatting on IRC
[12:40]<suv9w9>well, here's one, how exactly do I make it easy for me to set the right GET query after links to preserve state. you said model passes the info -> that's ok, but do I rebuild it all from scratch every time?
[12:40]<kyrrdyfj>colder; Here's a better example and explanation - http://hashmysql.org/paste/viewentry.php?id=2056
[12:40]<rymrg>suv4x4: preserve state? what do you mean by that
[12:41]<suv9w9>aidan, imagine a paged table with sorting. In my GET query I have sortColumn, sortOrder, currentPage, itemCountPerPage and so on
[12:41]<suv9w9>aidan, when I click page, I gotta pass all that as it was, but change page
[12:41]<rymrg>suv4x4: okay... so pass that information to your template!?
[12:41]<xmlxjym>also, mvc implies a persistant model - you can't just read a mvc tutorial and do it in php
[12:42]<suv9w9>aidan, so if I have, say 50 links, I rebuild the GET 50 times?
[12:42]<rymrg>suv4x4: rebuild the GET? what do you mean by that
[12:42]<rymrg>suv4x4: please stop making up terminology and expecting us to understand
[12:42]<suv9w9>aidan, I don't know a better way to explain it, sorry
[12:43]<suv9w9>rebuild the query string I have to append after the URL
[12:43]<suv9w9>so I can generate the links







