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-05-15
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 >
[09:06]<rsmprsmp>awesome, thanks man
[09:06]<efvysj>alright
[09:11]<efvysj>robert_, show me how you'd implement that
[09:11]<rsmprsmp>how would i pass a username to multiple pages so i can keep track of who is signed on?
[09:11]<rsmprsmp>i just wanna pass a username, not like a session or anything, so i can get their id, and whatnot
[09:11]<zj2nzv_>I need two class 'namespaces' inside of one class
[09:12]<efvysj>asdfasdf, use a hidden form field and/or throw it in the url
[09:13]<rsmprsmp>if i throw it in the url, how would i extract it on the next page?
[09:13]<pfraaym>what is the best way to do the current date in format dd/mm/YYYY
[09:13]<efvysj>asdfasdf, or use output_add_rewrite_var
[09:13]<efvysj>asdfasdf, just like any form
[09:13]<dzrrjgd>is there a function to find out how many items are in an ary?
[09:14]<efvysj>DragonD, count()
[09:14]<rsmprsmp>how would i do a hidden form?
[09:14]<rsmprsmp>i can do it, but then i click on the link, and how do i know it's sent
[09:14]<rsmprsmp>or if i add it to the url, how would i get it from the url
[09:14]<efvysj><input type="hidden" value="<?=$username?>">
[09:15]<rsmprsmp>but everytime i click on a link, i can use extract($_POST) and get the username?
[09:18]<efvysj>robert_, I'm still not 100% what you mean, sorry.... but maybe http://php.pastebin.com/718211 ?
[09:19]<rsmprsmp>you see what im saying?>
[09:19]<efvysj>asdfasdf, using output_add_rewrite_var yes
[09:19]<efvysj>asdfasdf, or actually, if you just used any post method you could
[09:20]<rsmprsmp>yeah, but say i have a hidden form, with a post method, and then say the user clicks a link. that post method would carry over even though no one submitted?
[09:20]<efvysj>robert_, minor correction: http://php.pastebin.com/718214
[09:22]<rrggjg>asdfasdf: the output_add_rewrite_var function adds the variable/value to all forms/links
[09:22]<rsmprsmp>but how would i then access that variable in the other page?
[09:23]<agjjg_>any better way than if(strtolower($a) == strtolower($b)) to do a case-insens test? or is that the best
[09:24]<rrggjg>Using $_REQUEST['variable name'], or use $var = ($_POST['variable name) ? $_POST['variable name'] : $_GET['variable name'];
[09:24]<rrggjg>the later if you don't want to allow cookies for that variable
[09:25]<rsmprsmp>so i use it like so:
[09:25]<zj2nzv_>Oh, I can't use extends with more than one class'es 'namespace', can I?
[09:25]<rsmprsmp>output_add_rewrite_var('$username');
[09:25]<zj2nzv_>er
[09:25]<zj2nzv_>inheritance doesn't work like that
[09:25]<zj2nzv_>does it?
[09:25]<rsmprsmp>and then it's added to the url, and i just use $_REQUEST['$username']
[09:25]<rsmprsmp>or even $username with no single quotes
[09:26]<rrggjg>no, read the manual http://us3.php.net/output_add_rewrite_var
[09:26]<rsmprsmp>do we havce to use the form?
[09:27]<mdacfd>if I have
[09:27]<mdacfd>function color() { if($_GET[color]==red) echo "?color=$_GET[color]";}
[09:27]<rrggjg>only if you happen to need passing POST data
[09:27]<rsmprsmp>okay, so then it'd be like:
[09:27]<mdacfd>how would I add move colors then red?
[09:28]<rsmprsmp>outpud_add_rewrite_var('var', '$username');
[09:28]<rrggjg>Mickly: how about a switch/case? Also, shouldn't you have global $_GET;
[09:28]<rrggjg>asdfasdf: yes, and then you access the variable with $_REQUEST['var']
[09:29]<rsmprsmp>sick, thanks man
[09:29]<mdacfd>what is wrong with a global $_GET
[09:30]<rrggjg>nothing
[09:31]<mdacfd>then why should I not have it
[09:31]<rrggjg>You should have it, in what you posted you don't
[09:32]<mdacfd>what is the differance?
[09:32]<rsmprsmp>that didn't seem to work
[09:32]<rsmprsmp>what i have is:
[09:32]<rsmprsmp> output_add_rewrite_var('username', '$username');
[09:32]<rrggjg>asdfasdf: don't add single quotes around $username
[09:33]<rrggjg>Mickly: without global $_GET; in your function you can't access the $_GET variables
[09:34]<mdacfd>well it is working
[09:34]<mdacfd>but for red only :(
[09:35]<rrggjg>well, you only have the case statement for red
[09:35]<mdacfd>and how would I write it to add green?
[09:36]<rrggjg>function color() { global $_GET; if ($_GET[color] == 'red') { echo "?color=$_GET[color]"; } elseif ($_GET[color] == 'red') { echo "?color=$_GET[color]"; } }
[09:37]<rrggjg>woops, make that last red green :P
[09:39]<efvysj>gannon, it's possible he has register_globals 1
[09:39]<efvysj>gannon, wouldn't that explain not having to use global $_GET?
[09:39]<rrggjg>Yeah, I just don't assume that since I use too many different servers :P
[09:39]<efvysj>heh
[09:40]<ow9w9792>and... GLOBAL'ing _GET is stupid
[09:41]<rrggjg>Not as stupid as global-ing a super global :P
[09:41]<mdacfd>function color() { global $_GET; if ($_GET[color] == 'red' or $_GET[color] == 'green' ) { echo "?color=$_GET[color]"; }} is simpler
[09:42]<ran_dn>I have this code which create a PDF file on disk and it seem the file is there but when pdf should be opened it say the file cannot been found http://pastebin.com/718236
[09:42]<rrggjg>yes it is :P
[09:43]<mdacfd>:) I am better at this than I though
[09:43]<mdacfd>thought
[09:43]<ran_dn>could you have a look and a suggestion to corect the code ?
[09:44]<efvysj>shouldn't it be $_GET['color'] ?
[09:45]<mnwzzzm>HolyGoat: are you awake?
[09:45]<mdacfd>Elviso that was giveing me a error about white space
[09:46]<rrggjg>then use echo "?color=".$_GET['color'];
[09:47]<mdacfd>what dose the . do
[09:48]<mrscm_>well it means less work the php interpreter has to do
[09:48]<mrscm_>try and use single quotes aswell
[09:48]<efvysj>"error about white space", huh?!?
[09:48]<rrggjg>yep
[09:49]<efvysj>I believe PHP will automatically convert the value to a string for you, however it's best-practice to use single-quotes I believe
[09:50]<mrscm_>function color () { if ($_GET['color'] == 'red' || $_GET['color'] == 'green') { echo '?color='.$_GET['color']; } }
[09:51]<efvysj>or you could do echo "?color={$_GET['color']}";
[09:51]<rrggjg>That's slower though
[09:51]<mdacfd>is it better to use || over or?
[09:51]<efvysj>for that yes
[09:51]<mrscm_>i always use || and &&
[09:51]<mdacfd>why?
[09:51]<mrscm_>i find it easier
[09:52]<efvysj>"or" functions differently
[09:52]<mrscm_>makes it easier to find the operator
[09:52]<rrggjg>Same as the difference between =, ==, and ===
[09:52]<mdacfd>there is a difference gannon?
[09:52]<mrscm_>Mickly: = (assigning a variable), == (is equal to), === (is IDENTICAL to)
[09:53]<efvysj>http://us2.php.net/manual/en/language.operators.php#language.operators.precedence







