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: 1822.57 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-05-11
Pages: < Prev
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
35
36
37
38
39
40
41
42
43
44
45
46
47
Next >
[01:20]<slragguvs>but with register global turned on
[01:20]<zdzxzzmfdgzx>spacenuts: .htaccess is inherited all the way down until you over-ride it in a lower .htaccess
[01:20]<rrppygrvnm>DepretioN: you shouldn't rely on it though, the browser is not under any obligation to send that header.
[01:20]<mzzcz9q>zero00: Tux is pretty much gone, the kernel-side advantages were replaced by a clean API which lets servers like thttpd (or indeed Apache) do zero-copy web serving
[01:20]<slragguvs>I can't use variables with names that equal keys in the $_SESSION var
[01:20]<nnzj00>thttpd ?
[01:20]<nnzj00>ooooww
[01:20]<slragguvs>richardlynch, thanks for all the clarification
[01:21]<mzzcz9q>zero00: Seeing as, even with a badly performing web server, and old pentium-class server can easily fill a 100 megabit pipe (obviously depends on other settings like logs), you don't need the fastest web server ever.
[01:21]<zdzxzzmfdgzx>spacenuts: Temp workaround -- do all the $_SESSION crap at the top of the script, initialize everythnig after that.
[01:22]<su2sjgya>is it possible to run multiple virtual hosts off a single codebase and have overrides but putting a file (page) into the host's directory?
[01:22]<su2sjgya>but=buy
[01:22]<mzzcz9q>zero00: If you have decent disc, network and enough memory, the efficiency of your web server is hopefully not too important
[01:22]<slragguvs>richardlynch, thanks, but that doesn't work in my case, what I am doing is the following
[01:22]<nnzj00>I want to put all my 10GB of images in RAMDisk and serve it via a web server
[01:22]<dnlznvyjn>caffinated : I want to grab it from a url which is not changing. Basically I have a script which creates jad files on the fly, want to hit the jar file location on the web (as its not on same server as the jad) anf grab the Content-Length header to plug into the JAD, so that if the jar is updated so is the JAD. So far only options I see are shell_exec("curl -I http://www.myurl.com"); or fsockopen
[01:23]<slragguvs>richardlynch, create an object, load data from session into object, let object manage data (delete, add, sort), get data from object and store in session
[01:23]<mzzcz9q>subsonic: You can almost certainly do it with rewrite somehow. We do this without rewrite though by simply having pages which include() a common base file. Other things get overridden more or less, like config, templates etc, that is done in the application
[01:23]<dnlznvyjn>but neither seem nice
[01:23]<zdzxzzmfdgzx>DepretioN: curl is IN php, no?
[01:23]<slragguvs>richardlynch, by coincidense the object got the same name as the SESSION key, and things mangled
[01:23]<dnlznvyjn>yeah but theres no way to just get the headers that I can see ... -I from command line returns headers only which is cleaner
[01:23]<rrppygrvnm>DepretioN: ah, you know what you could do is just do a straight up fsockopen() and then collect the headers as they come in.
[01:23]<su2sjgya>Mark, so you basically include an index.php file that includes all other code?
[01:24]<mzzcz9q>zero00: Sounds like a really complicated method which is unnecessary. I think you'll find that you can serve them almost as fast with a disc based system. Your bandwidth is going to cost a lot anyway.
[01:24]<zdzxzzmfdgzx>DepretioN: If curl can't do headers only, then I'd go with fsockopen, and fclose it after headers. Gotta be faster than exec.
[01:24]<rrppygrvnm>DepretioN: as soon as you have the headers, just close the connection at that point.
[01:24]<nnzj00>so the slowest part of serving images is the pipe to the Internet?
[01:24]<mzzcz9q>zero00: Obviously it depends exactly in what way the users load these 10G of images.
[01:24]<tml>DepretioN: curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
[01:24]<dnlznvyjn>k, was investigating that route this afternoon at work, didnt like it much though.. but guess I will do it for now
[01:25]<zdzxzzmfdgzx>zero00: Yes. Big-time.
[01:25]<slragguvs>richardlynch, thanks for all the info, I will use the .htaccess workaround, and contact the server owners, phpinfo says: register_globals On On
[01:25]<mzzcz9q>zero00: Either the internet, or the disc speed. You will be limited by something else. In some cases (if you're logging), writing the logs is the slowest thing
[01:25]<slragguvs>richardlynch, I wonder why they turned it on, if I am correct it is turned off by default
[01:25]<dnlznvyjn>TML : is there an Option to not get any other data i nthe curl ? else its going to curl a 300KB jar file each time
[01:25]<dnlznvyjn>which is why i want only headers
[01:25]<zdzxzzmfdgzx>spacenuts: Because it breaks a zillion badly-written scripts to have regsiter_globals off
[01:26]<mzzcz9q>DepretioN: You can use a HEAD request, or a conditional request. Read the HTTP spec.
[01:26]<zzlzm>DepretioN: get_headers() ?
[01:26]<dnlznvyjn>arpad : We dont want to turn on allow_url_fopen
[01:26]<slragguvs>richardlynch, haha, not so bad programmers get punished by bad programmers, nice
[01:26]<zzlzm>ah
[01:26]<zzlzm>HEAD's the way to go then
[01:27]<slragguvs>richardlynch, thanks for all the info and quick response, I will use the .htaccess way, thanks again
[01:27]<zdzxzzmfdgzx>arpad,DepretioN: Despite the specs, I coulnd't count on HEAD and GET to have same Content-length: headers... I know, I know, They SHOULD.
[01:27]<zdzxzzmfdgzx>s/coulnd't/wouldn't/
[01:27]<tml>DepretioN: CURLOPT_RETURNTRANSFER
[01:28]<tml>DepretioN: Oh...that may not do exactly what you want
[01:28]<drvvdaa>With all the dynamic scripts out there these days, you can barely trust either to even specify a content-length.
[01:28]<tml>DepretioN: You could also look into the PEAR HTTP client
[01:28]<tml>Where you can do a HEAD request
[01:28]<mzzcz9q>richardlynch: I believe that if the Content-length is provided, it should be accurate. Not doing so violates the HTTP spec so badly that a lot of stuff probably won't work.
[01:29]<tml>MarkR42: Indeed
[01:29]<zdzxzzmfdgzx>MarkR42: Yes, but including it for actual content, and omitting it for HEAD is what I'm thinking you'll find.
[01:29]<tml>*IF* Content-Length is present, it had BETTER be right.
[01:29]<dnlznvyjn>Well, I know I can trust the Content-Length on this Url :)
[01:30]<a2zyd2fn>I'm trying to make a login page with sessions, but i have no idea what i'm doing :(
[01:30]<zdzxzzmfdgzx>TML,MarkR42: Assume other guy is bad programmer and omits Content-length: for dynamic data on HEAD because they don't bother to generate data...
[01:30]<tml>DepretioN: Do you know that it will return Content-Length of an object that isn't actually being fetched, is richardlynch's (perfectly valid) question
[01:30]<dnlznvyjn>jbrimble : do some more reading then
[01:30]<mzzcz9q>You can either use a HEAD request, or a GET request with some condition, or a range request, or various other types of get request, read the http spec.
[01:30]<cgggdv>Anyone know of software to parse algebraic formulae into php objects?
[01:30]<zdzxzzmfdgzx>jbrimble: Maybe start with http://php.net/session_start
[01:31]<a2zyd2fn>Thanks
[01:31]<mzzcz9q>richardlynch: I don't think they are bad for omitting content-length on dynamic data. I think they are bad for having it WRONG. that is really bad.
[01:31]<rjrunjnmy>richardlynch: One more: arpa/nameser.h ?? Google didn't show anything :-\
[01:31]<vxngza>Can someone rephrase this in english please? I dont get the !empty part...
[01:31]<dnlznvyjn>TML : Yep, The content length is the size of a Jar file. Im using this value to create a Jad file on the fly so that all our customer have a unique install-notify-url so that we can track who is installing our software on their mobile phones
[01:31]<vxngza> Hello. I was wondering what if (!empty($_POST['name'])) does.. specifically, the ! and the empty part.. I know the POST gets the name from the form..
[01:32]<zdzxzzmfdgzx>MarkR42: So if they omit it for HEAD for dynamic data, but include it for GET?
[01:32]<a2zyd2fn>you have to put session_start() at the beginning of every page, right?
[01:32]<vrrgssjg>I tried to make a connectdatabase function and a showdatabase function and including them in a mainfile, but it doesn't work. However if move the code from connectdatabase to showdatabase function and just have one function i works fine - why can't it be in to functions?
[01:32]<zdzxzzmfdgzx>theGZA: http://php.net/empty and ! means "now"
[01:32]<mzzcz9q>richardlynch: Well, that would be inconvenient, but legal. If they provide the wrong value though, that would be severely annoying.
[01:32]<vxngza>!empty doesnt mean NOT empty?
[01:33]<zdzxzzmfdgzx>MarkR42: Right -- So I'm suggesting that HEAD is bad if you want to get Content-length: in the first place, as it might not be there.
[01:33]<mzzcz9q>Also, Apache implements HEAD requests by running the normal handler for GET and then only sending headers. So it will always return the same result. Other web servers might be stupid though and not do so.
[01:34]<dnlznvyjn>theGZA : It does
[01:34]<zdzxzzmfdgzx>theGZA: !empty *DOES* mean NOT empty, for the definition of "empty" at http://php.net
[01:35]<zdzxzzmfdgzx>tjansson: You almost for sure have a scope issue in variable names. Read about 'global' and scope on http://php.net/
[01:39]<tml>DepretioN: I have NFC what a "JAD" file is, but richardlynch is correct when he points out that most HTTP servers do NOT include Content-Length on HEAD requests
[01:39]<zzymnsn>hi guys
[01:40]<dnlznvyjn>Yup
[01:41]<vrrgssjg>richardlynch: ahh - that was it - thx :D
[01:41]<cgxgzdrg>I would like to track a user through the life of their online session -- I do this --> echo $_SESSION['user'] and get nothing...
[01:42]<rjrunjnmy>keherman: Did you set it?
[01:42]<cgxgzdrg>although i have previously set it before
[01:42]<cgxgzdrg>yes
[01:42]<cgxgzdrg>$_SESSION['user']= $_POST['email'];
[01:42]<ragnw2jfm>keherman: be sure that session_start(); is at the top of EVERY script that the user will execute
[01:42]<cgxgzdrg>every script?
[01:42]<rjrunjnmy>keherman: Are you sure $_POST['email'] contains something?
[01:42]<cgxgzdrg>yes
[01:42]<ragnw2jfm>keherman: if the user moves from script1.php to script2.php, you'll need to start the session there as well
[01:42]<rjrunjnmy>keherman: Every script that needs to interact with sessions
[01:43]<cgxgzdrg>so i need session_start() on every PHP page?
[01:43]<zdzxzzmfdgzx>keherman: Every script where you want $_SESSION to have any meaning at all, yes.
[01:43]<dggq>keherman: session_start (); in every script as ajnewbold said
[01:43]<cgxgzdrg>ok cool







