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.48 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-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
48
Next >
[02:25]<syggnzg>+merging old code into the new framework.. ugly, but it works ;p
[02:35]<mrvbjd>+is there a bug in fsockopen and the timeout ?
[02:36]<mrvbjd>+oh was before
[02:38]<zdzxzzmfdgzx>+MatBoy: You still gotta question, or all good?
[02:38]<mrvbjd>+richardlynch, the timeout it not used while set
[02:39]<zdzxzzmfdgzx>+MatBoy: There are two different timeouts: One to connect, one for reading data. Which one is giving you trouble?
[02:39]<mrvbjd>+connect
[02:39]<mrvbjd>+richardlynch, ^^
[02:40]<rsmw>-richardlynch: the script that you showed me dosn't display anything
[02:40]<rsmw>-:(
[02:40]<zdzxzzmfdgzx>+MatBoy: Show me the fsockopen() line of code, and what you think the number is for your timeout.
[02:41]<zdzxzzmfdgzx>+asdx: Typo: http://pastebin.com/709700
[02:41]<mrvbjd>+richardlynch, I have followed this: fsockopen($ProxyServer, $ProxyPort,$errno,$errstr,$timeout);
[02:42]<mrvbjd>+richardlynch, but how can I remove $err*
[02:42]<zdzxzzmfdgzx>+MatBoy: On the line before that line, print out $timeout and see what it is.
[02:42]<mrvbjd>+huh ?
[02:42]<zdzxzzmfdgzx>+MatBoy: Don't remove them. Use them.
[02:42]<mrvbjd>+can you specify what should be in the line ?
[02:43]<rsmw>-richardlynch: thanks :)
[02:43]<zdzxzzmfdgzx>+MatBoy: $errno and $errstr are kind of like return values -- If something goes wrong, fsockopen will put "useful" info in those variables. You can initialize them to blanks before you start. The $timeout should be how long you are willing to wait for a socket to open.
[02:44]<mrvbjd>+richardlynch, I don;t need them, but I think fsockopen need it to specify the place ot the timeout ?
[02:44]<zdzxzzmfdgzx>+MatBoy: You may currently THINK you do not need them... :-) But you should use them in your error checking.
[02:44]<mrvbjd>+richardlynch, yes, I should... no time for it :)
[02:44]<mrvbjd>+but I will !
[02:45]<zdzxzzmfdgzx>+MatBoy: Something very much like Example 1 of the docs would be the right way to go. Change echo to error_log() if you don't like icky messages for usre. It's an extra 4 lines of code to save you hours of frustration some other day. Cheap.
[02:46]<mrvbjd>+richardlynch, indeed !
[02:46]<usnzdra>-bye bye everyone
[02:46]<mrvbjd>+but i can specify the timeout as in the line and as a variable above it ?
[02:47]<zdusxn>-Hi there again, still working on the damned regex, I'm trying to add something to the example nr 1 listed on http://nl3.php.net/preg_replace. I 'need' multiple occurances of * replaced by <br /> in $document (as per the example). If anyone could give me the correct part for the search array, I'd be very very gratefull
[02:47]<ceredtuw>+Can anyone give me a hand with php 5 oop and database session handling, I can't seem to get the session info to carry from page to page
[02:48]<zdzxzzmfdgzx>+MatBoy: Not sure what you mean... But $timeout = 30; fsockopen(..., $timeout); is Good.
[02:48]<ceredtuw>+ryushe, str_replace ?
[02:48]<mrvbjd>+richardlynch, 30 is just 30 seconds isn't it ?
[02:48]<zdusxn>-CrazyTux > str_replace after the preg_replace is done? As I do need the other stuff in the $search array there
[02:50]<zdzxzzmfdgzx>+MatBoy: I believe it is in seconds... But note that it is a float, so 0.10 for a tenth of a sec might be kosher...
[02:50]<ceredtuw>+ryushe, not sure what you're trying to do?
[02:50]<ceredtuw>+ryushe, you want to replace * with <br /> in $document correct?
[02:50]<ceredtuw>+ryushe, is $document a string, array, ?
[02:50]<mrvbjd>+richardlynch, 10 is not stopping now at 10 seconds :S
[02:50]<zdusxn>-CrazyTux > check out Example 1 on this page: http://nl3.php.net/preg_replace . I'm trying to add a clause to the $search array to replace * with <br /> in $document
[02:51]<zdusxn>-where $document is a string of text I have
[02:52]<zdusxn>-changing the part in the $replace array is the easy part, I just can't for the life of me get the * to match :(
[02:52]<rsmw>-how can I count all the <br /> that I have on a field?
[02:52]<wsxrm>+ryushe preg_replace("/\\*/m", "<br />", $doc);
[02:52]<ceredtuw>+ryushe, $document = str_replace("*", "<br />", $document);
[02:52]<zdzxzzmfdgzx>+'@\\*@' in the first array, and '<br />' in the second.
[02:52]<rsmw>-mysql field
[02:52]<rrymrree>-after modifying php.ini (using it as a module) does apache have to be restart to see the difference?
[02:52]<wsxrm>+acidjazz yes
[02:52]<zdzxzzmfdgzx>+maybe try '@*@'
[02:52]<zdusxn>-heh, thanks, trying all of those listed , brb ;)
[02:53]<zdzxzzmfdgzx>+asdx: http://php.net/str_count I do believe...
[02:53]<rsmw>-richardlynch: k
[02:53]<zdzxzzmfdgzx>+asdx: Oh, in MySQL? Ask them in #mysql Sorry.
[02:53]<zdusxn>-richardlynch > yours was the first one I tried now, and it worked \o/
[02:54]<zdusxn>-thnks loads, altho afaik I tried that variation :)
[02:54]<zdzxzzmfdgzx>+MatBoy: I dunno what to say, cuz it for sure works for me... Does it ever stop?
[02:57]<ceredtuw>+Anyone in here familiar with OOP and know what the hell I'm doing wrong with http://tuxmafia.com/dev/TuxSTAT/index.phps and http://tuxmafia.com/dev/TuxSTAT/process.phps and http://tuxmafia.com/dev/TuxSTAT/include/TuxSESSION.class.phps
[02:58]<rsmw>-richardlynch: why it dosn't work if i remove if (!$first_row) and i only left $first_row = $row
[02:59]<zdzxzzmfdgzx>+asdx: Because you ONLY want to do this action when you have not yet "found" the first row. Changing $first_row from FALSE to $row means it will only happen once with the if() part. Take out the if() part, and it happens on every row, and you end up with the last row.
[02:59]<mrvbjd>+richardlynch, it finally sees that the port is closed
[02:59]<zdzxzzmfdgzx>+MatBoy: After 10 secs, or...
[03:00]<mrvbjd>+after 30 seconds while set on 10
[03:00]<zdzxzzmfdgzx>+MatBoy: Pastebin it.
[03:00]<rsmw>-richardlynch: I see
[03:00]<mrvbjd>+OK :)
[03:01]<zdzxzzmfdgzx>+asdx: It's a pretty standard "trick" to catch the first one as it goes by in a loop.
[03:01]<rsmw>-richardlynch: so if (!$first_row) set $first_row as true?
[03:01]<zdzxzzmfdgzx>+asdx: $row, with some data in it, "counts" as TRUE in PHP. So putting $row in there, means the if() bit from then on decides not to do it again.
[03:01]<mrvbjd>+richardlynch, http://pastebin.com/709729
[03:02]<axylejj>-hi, how to get the list of fields form a query with more than 1 table ?
[03:03]<zdzxzzmfdgzx>+MatBoy: You are passing in $timeout as if it was the $errno. Will not work. Just cram $errno and $error in there, and then ignore them.
[03:03]<mrvbjd>+richardlynch, ok, so it;s lined up :)
[03:03]<dggvxjf7w7>-im using imagecopyresize to resize an image, currently I can output it to the screen with imagejpeg() but I cant figure out how to save the new image as a file
[03:03]<zdzxzzmfdgzx>+MatBoy: Yes. PHP uses argument position for matching things up.
[03:05]<mrvbjd>+richardlynch, damn, if I already tried it... it was working ! good way of learning !
[03:05]<mrvbjd>+thank !
[03:05]<mrvbjd>+s
[03:05]<axylejj>-sos?
[03:05]<zdzxzzmfdgzx>+manthol616: All the imagejpeg() and similar functions take an optional second argument as a filename to save as. No filename implies dump it to browser. put in a filename, and it tries to save it. You'll want the FULL PATH to the file, from, like, /usr/home/mydomain.com/whatever/somefilename.jpg and the directory where you are saving has to be one that PHP has permission to write in, and that should NOT be in your webtree, if possible.
[03:06]<mrvbjd>+richardlynch, I'm getting also the load of the server, can I change a range of numbers to low, mdeium, high ? str_replace ?
[03:07]<dggvxjf7w7>-oye nevermind looks like i missed another optional function argument, ive got to start looking harder at those
[03:07]<zdzxzzmfdgzx>+MatBoy: So you would alter your timeout based on load? Sure. I'd use a switch() for that, though. switch(true){ case ($load < 0.5): $timeout = 30; break; case($load < 1.0): $timeout = 20; break; }
[03:08]<mrvbjd>+richardlynch, aha, that is also nice to use !
[03:08]<mrvbjd>+what I was thinking od was... hetting the load and say... middle... high...
[03:09]<odlrr>-if I have a array with values 1,2,3.. how can I check if "2" is present?
[03:09]<odlrr>-in_array or something?
[03:10]<zdzxzzmfdgzx>+Ompaa: Yes. if you mean keys, though, you want http://php.net/isset
[03:10]<rsmw>-richardlynch: can I do that putting the the $first_row['id'] inside the loop too?
[03:10]<zdzxzzmfdgzx>+in_array:values as isset:keys
[03:10]<zdzxzzmfdgzx>+asdx: Sure, if you JUST want the 'id' you could do that.
[03:10]<wsxrm>+isset don't checks for nullyfied values
[03:11]<odlrr>-ok... I have a problem with some checkboxes I really dont get..
[03:11]<rsmw>-richardlynch: can you *please* show me how?
[03:11]<zdzxzzmfdgzx>+Errr. If you want to check for NULL, use is_null. If you wanted it to not be set, use unset(). If you confuse setting things to NULL with them not being set, I cannot help you.
[03:12]<zdzxzzmfdgzx>+asdx: if (!$first_row) $first_row = $row['id'];
[03:12]<zdzxzzmfdgzx>+Then at the bottom, echo $first_row; //instead of $first_row['id'];
[03:12]<rsmw>-richardlynch: and if I want more than the 'id'?
[03:13]<rsmw>-like 'title'/'news' etc







