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-27
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 >
[02:52]<fyr>richardlynch, sorry - I am sending a request... want to capture the response to the request
[02:53]<rffxr2fun>lig: how are you sending the request ?
[02:53]<zdzxzzmfdgzx>lig: Aha. In that case, what are you using to send the request? curl? fsockopen? file_get_contents?
[02:54]<fyr>Hmm - probably curl
[02:54]<asjpv>hmm.
[02:54]<dtgjzdq>hmm... looking at this line... im trying to have it run some code if the ip does not equal one of 2 set in the php file.... what part of this doesnt look right??? if ($remoteAddress != "71.159.178.149" || $remoteAddress != "127.0.0.1") { ..do something ..;}
[02:54]<zdzxzzmfdgzx>curl has one of those interminible curl_setopt to ask to get the headers. fsockopen, you're just gonna get the headers like it or not. file_get_contents, you can't send headers, much less get them.
[02:54]<dtgjzdq>it works fine if i just have one of them in there, but after adding the || and the second set.. now neither work
[02:54]<mzzcl>DTGorm2: Use && not || .. it can never be both at the same time
[02:54]<ajss>richardlynch: is it possible to fill suername and password using shell script i mean pass data to server without using browser and see what it responds?
[02:55]<zdzxzzmfdgzx>DTGorm2: Every IP in the universe is not equal to one OR the other. You want the ones not equal to one AND the other. use &&
[02:55]<dtgjzdq>ohhh... && mean OR??
[02:55]<ajss>basically i mean input some text for webforms, and see the respons, without browser
[02:55]<mzzcl>DTGorm2: No, it means AND
[02:55]<rffxr2fun>lig, it's an option in the libcurl stuff for php, if you set curl in a specific way before executing the request, you should be able to see the response headers
[02:55]<dtgjzdq>but what i want.. is if the ip is either one of then, then dont run the code
[02:56]<fyr>Thanks Guys
[02:56]<rffxr2fun>oh richard already told you :)
[02:56]<zdzxzzmfdgzx>joss: Sure. It's just POST data. If you know what to type, and it's simple enough to type it error-free, you can do it with plain old telnet
[02:56]<dtgjzdq>what its for is to not run my SEO code if its me visiting the site
[02:57]<dtgjzdq>so if im running local, or running remote... dont run the seo code
[02:57]<dtgjzdq>therfore, i need the ||
[02:57]<zdzxzzmfdgzx>DTGorm2: You want && in this case. Your're on your own to work out the basic "logic" of the situation. Pencil and paper and some sample values are in order.
[02:58]<rffxr2fun>|| and && always confuse people
[02:58]<mzzcl>DTGorm2: Say it's IS 127.0.0.1 then it's != to the first one .. so the code runs
[02:58]<ajss>richardlynch: i am a newby quite in php world, could you find me a link that describes this, perhaps theres a webpage and a shell scipt as an example that does this
[02:58]<ajss>i culd not find one with google
[02:58]<zdzxzzmfdgzx>joss: Google for "Rasmus Lerdorf PHP posttohost" and you should find a sample PHP function with fsockopen that does it...
[02:59]<dtgjzdq>but going with && meaning AND... and my IP cannot be both the 127.0.0.1 and the public at the same time, and im telling it if its NOT both ips.. then the code will always run if i visit
[02:59]<zdzxzzmfdgzx>DTGorm2: For the love of god would you just try && and see if it works, or get out pencil and paper and work through it? Please...
[03:00]<ceredtuw>richardlynch, lol
[03:00]<ajss>err cant find it
[03:00]<rffxr2fun>or spaghettimonster, if you don't believe in G..
[03:00]<mzzcl>DTGorm2: Any ip that isn't one of those 2 is NOT the first AND NOT the second
[03:01]<dtgjzdq>im trying to get my brain to understand how its working
[03:02]<zdzxzzmfdgzx>DTGorm2: Okay. if ($x != 2 OR $x != 5){
[03:03]<gydl_>richardlynch: uhh.. alright... you said i could grab it from the first little bit of the image. i know im probably asking a stupid question. its all garbled... what do i do to unencode it?
[03:03]<zdzxzzmfdgzx>If $x is 2, then the second half kicks in, and 2 is not 5 and the whole thing is true. If $x is 5, the first half kicks in and $x is not 2 and the whole thing is true, if $x is any other number, the whole first one kicks in, and it's not 2, and the whole thing is true.
[03:03]<mzzcl>DTGorm2: Pick any ip address, even 127.0.0.1, it will be != to at least one of your options, so it will pass an OR
[03:03]<zdzxzzmfdgzx>Gimp_: Don't try to unencode it. Just apply getimagesize on the partial image and see what you got.
[03:03]<gydl_>ohhh
[03:03]<gydl_>ok
[03:03]<gydl_>so create a temp file?
[03:04]<dtgjzdq>ok, that does make more sense, thanks.. im trying to figure out why i was trying to use || to begin with
[03:04]<zdzxzzmfdgzx>Gimp_: Sure.
[03:04]<gydl_>or does getimagesize allow data to be passed instead of a file?
[03:04]<gydl_>alright.
[03:04]<gydl_>temp file.
[03:04]<dtgjzdq>seems that with the || its almost just like the &&
[03:04]<vxnsljzn>What could cause a server to not report errors even when set_ini('error_level', E_ALL); is specified?
[03:04]<zdzxzzmfdgzx>joss: http://marc.theaimsgroup.com/?l=php-general&m=90222503033604&w=2
[03:04]<mzzcl>DTGorm2: With || it stops when it matches at least one .. && checks both
[03:04]<dtgjzdq>aha
[03:05]<zdzxzzmfdgzx>Yes, I remember a post from 1998 as a reference. Sorry. :-)
[03:05]<dtgjzdq>that makes even more sense.. thanks alot.. i think i just need some brain energy
[03:05]<vxnsljzn>|| = or, && = and
[03:05]<dtgjzdq>so if I wasnt using the != .. then it would be different, right?
[03:06]<dtgjzdq>kinda like reversed when you are checking if not equal
[03:06]<xmlxjym>'or' as used in common speech doesn't map perfectly onto logical OR
[03:06]<zdzxzzmfdgzx>DTGorm2: Yes, the != being "NOT" is confusing you.
[03:06]<dtgjzdq>true
[03:06]<dtgjzdq>heh
[03:06]<vxnsljzn>Xyphoid, no.. but close enough for lamens terms ;)
[03:06]<dtgjzdq>i think some fresh coffee is in order
[03:06]<mzzcl>DTGorm2: You could always EXOR NOR NAND it to keep things simple
[03:07]<dtgjzdq>lol, that is out of the scope of my knowledge there :P
[03:07]<vxnsljzn>yes, that keeps things simple ;)
[03:07]<zdzxzzmfdgzx>DTGorm2: You may find it easier to do if ($x == '...' || $x == '...') { /* okay to do whatever */} else { kick them out }
[03:07]<mzzcl>;)
[03:08]<gydl_>richardlynch: thanks, that worked great
[03:08]<cwyffrw>doing a join on a table that has a field with the same name, other than giving it an alias or referencing the array's index, how could i get the correct value from the array? eg: t1.name and t2.name
[03:08]<ceredtuw>Chillax, you can't.
[03:09]<zdzxzzmfdgzx>Chillax: use mysql_fetch_row and know which order the SELECT values are in??? Use an alias.
[03:09]<cwyffrw>CrazyTux: so i cant reference in the array like $arr[tblname . field] or some such
[03:09]<cwyffrw>richardlynch: said without referencing the array's index
[03:09]<ceredtuw>Chillax, not unless that is the name... no
[03:09]<zdzxzzmfdgzx>Chillax: ver_dump the array and see what the keys are.
[03:10]<asjpv>:|
[03:10]<zdzxzzmfdgzx>'t1.name' might work just fine... I guess.
[03:11]<zdzxzzmfdgzx>I personally use list() and mysql_fetch_row() just so I don't have to deal with this kind of crap, but I know that's frowned upon. [shrug]
[03:11]<asjpv>frowned apon? why is that? I though that list() was a function for special people running on super computers?
[03:12]<zdzxzzmfdgzx>I dunno. Everybody else in PHP community seems to luv mysql_fetch_array. It's a religious question. list() is most definitely not for super-computers. It's actually a very OLD php construct, from back in the day.
[03:13]<zdzxzzmfdgzx>Seems like half the functions named *_array in the manual are designed specifically to avoid using list() because some people think list() is "confusing".
[03:13]<cwyffrw>so {table alias}.{field name} doesnt work
[03:13]<zdzxzzmfdgzx>fetch_array or fetch_assoc, whichever the one is to make nifty keys.
[03:13]<gydl_>richardlynch: fetch_array does both numerical and by field names
[03:13]<cwyffrw>nor does {table name}
[03:14]<gydl_>assoc does only with field names.
[03:14]<zdzxzzmfdgzx>Chillax: Can you define "doesn't work" better? What was ithe key when you did the var_dump?
[03:14]<cwyffrw>im trying to avoid using the actual numeric index of the array
[03:14]<cwyffrw>i have my table names and fields defined as constants
[03:14]<zdzxzzmfdgzx>Chillax: We understand that. but if you don't var_dump it and see what the friggin' keys are, we can't really help you , can we?
[03:15]<xmlxjym>chillax: why not just alias it?
[03:16]<cwyffrw>Xyphoid: i can but i was trying to find a way that didnt involve me hardcoding an alias to use all over the script
[03:17]<cwyffrw>MarkL: yeah it was a longshot
[03:17]<ajss>richardlynch: so it is possible to fill two forms, and see what server responds to them remote server i mean?
[03:17]<zdzxzzmfdgzx>So what *DOES* it use as the key when you have t1.name?
[03:17]<mzzcl>name
[03:17]<xmlxjym>i mean, if you've got constants for your fieldnames, select your fields as tablename_fieldname throughout or something
[03:17]<zdzxzzmfdgzx>joss: You can fill in as many forms as you want... What are you asking?







