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.49 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:43]<cgxgzdrg>thx!
[01:43]<ragnw2jfm>keherman: that should fix it :)
[01:43]<a2zyd2fn>just a quick question.. if i use include ('includes/main_funcs.php');
[01:43]<a2zyd2fn>ah, damnit
[01:43]<a2zyd2fn>I'll ask in a sec
[01:43]<ragnw2jfm>heh ok
[01:43]<ragnw2jfm>we'll be here
[01:44]<zdzxzzmfdgzx>jbrimble: You can get rid of the () in include for starters. They don't mean what you think they do, in that line of code...
[01:44]<rjrunjnmy>jbrimble: You should fully-qualify your includes. (Ex: Use ./ in front of includes)
[01:44]<a2zyd2fn>Ah, i see
[01:45]<zdzxzzmfdgzx>RogueJedi: You are SO wrong it's not even funny. You might as well not bother using include_path at all if you're going to do that, and use a full path and REALLY fully-qualify it, or you're just gonna have a mess when your project grows and you need sub-directories.
[01:45]<zdzxzzmfdgzx>Or you could actually figure out what include_path does, and run with it -- way better.
[01:45]<gudysv>include path rocks
[01:46]<gudysv>pathmunge() rules
[01:46]<a2zyd2fn>the question i had was if i use the include in index.php (for example), and the included file has session_start(), does that mean i don't have to put session start in the index.php (or any other file thats including include.php) ?
[01:46]<rjrunjnmy>richardlynch: It's not _wrong_ other then maybe it's not technically fully-qualifying, it just prevents some potential issues
[01:46]<a2zyd2fn>i hope that makes sense
[01:47]<rjrunjnmy>jbrimble: Only if you don't do anything with sessions in index.php
[01:47]<z9rww>anyone know of a good tutorial on oop? All the ones are the almost the same and just say to do this and this.....but not where or why
[01:47]<rjrunjnmy>richardlynch: Besides, all I gave was an example of something he could do, I didn't say that was _THE_ way to do it.
[01:49]<a2zyd2fn>thankyou for your answers
[01:49]<wrm>I'm using a link like this: <img src="<?php include 't.php'; ?>abc.jpg">
[01:50]<wrm>The odd thing is that there is an extra linefeed appearing in the generated HTML.
[01:50]<wrm>Is this expected?
[01:50]<svjzdzxzsnz>r4g31: php.net/oop and php.net/oop5
[01:50]<svjzdzxzsnz>wad: eep
[01:50]<mzzcz9q>wad: Probably whitespace in t.php. However, you should not do that, instead, write a function to do whatever t.php does, put it in a file you require() only once at the beginning, and call it in the places you're currently including t.php
[01:50]<wrm>heh
[01:51]<wrm>t.php just contains a URL. :)
[01:51]<mzzcz9q>In which case, put it in a constant, define it somewhere like constants.php and then use it
[01:51]<wrm>Ah, that seems very clean.
[01:52]<dggq>is
[01:53]<wrm>Out of curiosity, why is what I'm doing now bad?
[01:53]<wrm>Probably performance?
[01:53]<mzzcz9q>No, cleanliness
[01:53]<wrm>ok
[01:53]<2gzvzrgdjd>hey is there a way to read in the named anchor in php
[01:53]<mzzcz9q>Maybe performance as well, but that doesn't matter so much
[01:53]<wrm>Basically, what I wrote is just plain OOOGLY.
[01:53]<2gzvzrgdjd>like :http://ajax.form-studios.com/test.php#asdf
[01:54]<2gzvzrgdjd>the #asdf part
[01:54]<jddddd>explode on # ?
[01:54]<mzzcz9q>bertrandom: It's not normally sent to the server, so no.
[01:54]<nvrd>ho
[01:54]<nvrd>hi
[01:54]<2gzvzrgdjd>Mark: crap, thanks.
[01:56]<nvrd>where from should I know what should i use: $_REQUEST['x'], $_REQUEST[x] or $_REQUEST[$x]... php.net tells that $x but it doesnt work... works only $_REQUEST[x]
[01:56]<nvrd>or maybe it is old and shouldn't be used? it is confusing...
[01:57]<mzzcz9q>etam: Using barewords as string literals is a no-no, and will generate a notice (you do have notices enabled, right?), so $_REQUEST[x] is a definite no-no
[01:57]<nvrd>MarkR42: but only this works :|
[01:57]<mzzcz9q>And $_REQUEST[$x] does something completely different from the other two
[01:58]<sxzzypp>Hi there
[01:58]<mzzcz9q> $_REQUEST[x] is exactly like $_REQUEST['x'] except generates a notice (unless you have a constant called x, which you should not)
[01:58]<nvrd>MarkR42: where from should i know what should i use? so in php.net is that 'x' works... :|
[01:58]<rrppygrvnm>MarkR42: it's not the same at all.
[01:59]<mzzcz9q>caffeinated, why is it different (assuming no constant called x)
[01:59]<rrppygrvnm>what actually occurs there is php looks for a constant called 'x' and uses that instead of the string literal 'x'
[01:59]<rrppygrvnm>so, if it's defined, you won't get the value you expect
[01:59]<nvrd>MarkL: so why 'x' produces: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\xampp\htdocs\xampp\Login\login.php on line 12
[01:59]<nvrd> ?
[02:00]<rrppygrvnm>etam: because you need to enclose it in {} inside your string
[02:00]<nvrd>caffinated: how and why?
[02:00]<rrppygrvnm>echo "foo {$bar['baz']} blah";
[02:00]<mzzcz9q>Oh, you are using this inside a double-quoted string? erk.
[02:00]<rrppygrvnm>etam: because it's a complex variable type. php requires delimiters for such things so it knows where it starts and ends.
[02:01]<rrppygrvnm>etam: you'd need the same thing for accessing object properties in string interpolation
[02:01]<wrm>So instead of this: <img src="<?php include 't.php'; ?>abc.jpg">
[02:01]<wrm>Once I convert it to use a function, I'll have this:
[02:01]<nvrd>ok thanks
[02:01]<rjrunjnmy>wad: Don't even need to convert it to a function, you can just a constant.
[02:02]<wrm>ah
[02:02]<rjrunjnmy>just use*
[02:02]<wrm>So, it would look like:
[02:02]<nvrd>what version of php should i use?
[02:02]<nvrd>5?
[02:02]<rrppygrvnm>etam: the latest stable version in the 5.x tree.
[02:02]<mzzcz9q>etam: If the choice is entirely yours, use the latest 5.x
[02:02]<zdzxzzmfdgzx>bertrandom: There is a function like, errr, http://php.net/parse_url which will give you the #part -- and of course it's sent to the server.
[02:02]<pzjv>careful, latest php breaks php4 if you're not careful
[02:03]<nvrd>caffinated: don't you think that it is confusing that some parts of language is old and does not works?
[02:03]<wrm><img src="<?php echo $const; ?>abc.jpg">
[02:03]<rrppygrvnm>etam: hm?
[02:03]<rjrunjnmy>wad: That's a variable, not a constant. http://php.net/define
[02:03]<rrppygrvnm>etam: that question makes no sense.
[02:03]<wrm>ah
[02:03]<rjrunjnmy>wad: Either would work though
[02:03]<nvrd>caffinated: sorry for my english
[02:04]<nvrd>caffinated: i mean that some parts of php are depricated, right?
[02:04]<slragguvs>richardlynch, and if setting the value in .htaccess doesn't change a thing, do I need to contact the server owners?
[02:04]<rrppygrvnm>etam: correct.
[02:04]<zdzxzzmfdgzx>spacenutes: Yup. They maybe turned OFF .htaccess, and you are screwed.
[02:04]<nvrd>caffinated: where from should i know if i am using correct version?
[02:04]<zdzxzzmfdgzx>etam: phpinfo()
[02:04]<mzzcz9q>richardlynch: If the anchor is sent to the server (which it may be, but I always thought it was not), where can I see it in the output from phpinfo()? I see nothing containing it.
[02:05]<rrppygrvnm>etam: it's only confusing if you use the tutorials scattered throughout the web. most of them are outdated, and use outdated conventions. it's not confusing at all for me, but I've been with it a long time now.
[02:05]<nvrd>caffinated: can i find outdated mechanisms in php.net?
[02:06]<rrppygrvnm>etam: anything that is deprecated in php will be noted as such in the manual.
[02:06]<zdzxzzmfdgzx>MarkR42: Oooh. I could be way wrong... I just know that I've used parse_url in the past on URLs and got the #part -- Maybe I was web-scraping something else and not looking at $PHP_SELF and friends... Sorry!
[02:07]<rrppygrvnm>richardlynch: the #part is not sent to the server







