@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 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



Comments:

<0> Penggu: look at a phpinfo() page and you'll see all the server variables you can use
<1> stevarino: I did.
<1> [RainMkr]: No luck.
<2> Vixus: What did you get?
<1> [RainMkr]: Warning: preg_match() [function.preg-match]: Unknown modifier 'a'
<3> phpinfo() doesnt give other than what i used above for an indication
<4> Vixus: what's your preg_match call?
<2> preg_match( ":/images/({d}+):", $html, $matches );
<4> Penggu: why do you need the protocall?
<2> preg_match( ":/images/({d}+)/:", $html, $matches );
<1> stevarino: That.
<3> stevarino: in-script http call using curl, with the same stuff the client used to access the page
<1> [RainMkr]: I got an empty error
<1> [RainMkr]: I got an empty array*
<3> http/https
<5> The protocol can be got by querying $_SERVER['SECURE'] or something



<5> (which will be set only if you're on HTTPS)
<4> Vixus: haha. i was write, you really do have two problems now ;)
<3> ah okay
<1> stevarino: :P
<4> right...
<1> stevarino: not really, it's the same problem XD
<4> Vixus: okay, so what's the problem?
<5> Hmm, no actually, it seems that on Apache, it sets $_SERVER['HTTPS'] to "on" if on HTTPS
<1> stevarino: well, first of all, I have no idea what the preg_match( ":/images/({d}+)/:", $html, $matches ); does.
<1> stevarino: It's not actually doing anything
<2> Vixus: What is in $html?
<3> MarkR: thx
<5> I wrote a little sort of Ajax - style Forum, a while ago, as a test. It's here http://slarty.no-ip.com:9000/
<1> [RainMkr]: The html of a web page (file_get_contents)
<2> Vixus: Provide that URL.
<1> [RainMkr]: its penny arcade's comic page
<4> Vixus: are you using the ":/image..../:" pattern? thats different than what you told me about earlier
<1> stevarino: Er, it's what [RainMkr] gave me
<2> Vixus: Figure this out. I do not want to do any more work than I have to.
<1> ok
<2> Vixus: So either you provide us the EXACT information we ask for, or go muddle though it yourself.
<4> Vixus, so what you want is this: ""/images/2006/20060331.jpg""
<1> yes
<1> i want the "20060331.jpg"
<1> as I already have the "/images/2006/"
<4> Vixus: preg_match( "/".preg_quote("/images/")."[0-9]{4}\\/([0-9]+\\.jpg)/", $html, $matches )
<4> Vixus: I'm honestly curious if that will work, its been a while
<1> stevarino: ok
<1> I really am sorry about all this, this is my first big project and I've never used regex's
<1> darn.
<1> still that unknown modifier a.
<4> Vixus, they are fun but a pain in the neck sometimes
<4> Vixus: unknown modifier a? there is no a in there....
<6> anyone could explain http://pastebin.com/636100 for me?
<4> Vixus: are you sure the error is coming from that line?
<1> yep
<1> want the entire code?
<1> i'll pastebin it
<6> it's a very weird reference problem... in short , a global variable differs if I throw away the return value of a function or not
<7> hi how can i make an array with the 3 first entry of another please ?
<8> With as string array X[], i want to generate a new array like this: newarray['X[i]']='X[i]'. So every item in newarray will have the same content in the key and in the value. Is possible?
<4> gawd, am i the only one who loves exploring strangers pastebins? it feels wierd but you never know what you'll find :D
<1> stevarino: http://pb.spheredev.net/?id=65 <--- the preg_match line returns the error.
<9> vicentecarro: you mean $newarray[$i]=$x[$i]; ? are you reversing an array?
<9> comic finder :))
<4> Vixus: don't preg_quote $html
<8> Drakas, i think no. the key has to be an string not numeric. And it's giving problems to me.
<7> I have an array like $array[var1][var2][var3] and i'm looking for find the 3 first entry of $array :/
<9> oh, pretty easy vicentecarro
<7> i mean the 3 first var3
<9> like foreach($x as $i => $v) { $new[$v]=$v; } ?
<8> Drakas, hmmm, i going to check
<3> anyone know how to get the server-fed filename of a download with curl?
<3> (or a non-curl way of doing it?)
<3> (save dealing with raw sockets!)
<9> Penggu: file_get_contents?
<4> Vixus: and you can simplify your preg_match to preg_match( "/".$path_to_comics."([0-9]+\.jpg)/", $html, $matches );
<3> well, say you have a url http://server/file.php?get_doc=pdf, and file.php gives a filename of a pdf for download, say, SomeFileName.pdf
<3> if u feed that url to curl, how would i get SomeFileName.pdf ?
<10> If I want to use MySQL with PHP on my IIS6.0 Box, do I also need to install MyODBC? Or PHP is talking directly to MySQL



<9> Penggu: im sure thats documented in curl. lhttp://php.net/curl and find code with ob_start(); in it. should help
<9> Rockyboa: i think it's directly
<8> Drakas, thanks. It worked
<9> MyODBC would be for .NET accessing MySQL
<9> vicentecarro: great!
<10> Drakas that's what I tought until I tried a simple connection and got the following error: Access denied for user 'ODBC'@'localhost'
<1> stevarino: No luck... still same error
<9> Rockyboa: what? why are you connecting to ODBC?
<9> * user ODBC ?
<9> try a normal MySQL user
<4> Vixus: pastebin what you got again?
<10> It is a normal user...
<1> stevarino: http://pastebin.com/636119
<9> Rockyboa: your MySQL server doesn't have ODBC user then... or p***word is incorrect?
<1> stevarino: error is on line 23
<4> Vixus: and whats the error you're recieving?
<10> You are right, I don't have an ODBC user created.. But I'm connecting with a different user.. Thank you.. I'll dig a bit more...
<1> stevarino: Warning: preg_match() [function.preg-match]: Unknown modifier 'a' in F:\www\palantir\test.php on line 23
<11> Hey guys, in a given script I execute a mysql SELECT to retrieve two fields: "id" and "name". Then, I got an option list, a dropbox with the field "name" populating it. The $_POST I get is ofcourse $_POST["name"]. Is there an easy way to retrieve the "id" for the chosen option in the dropbox? Because I had to implement a cl*** to resolve this, but I was wondering if there was any simpler solution that I did not even think of...
<0> danf_1979: no, not in PHP
<4> danf_1979: are you setting the value of the options?
<0> form data is sent as name/value pairs
<12> hi guys, can someone recommend me a good host?
<12> talking about shared hosting...
<11> I populate the dropbox with the name, but want to get the id
<11> I did resolve it though
<11> but with a cl***
<13> User805: what are you looking for?
<1> danf_1979: If its in a mysql mcthing, try putting the query results in an array. that should match id to name.
<1> stevarino: any idea?
<11> The thing is, that I cannot do a second mysql select based on the name...
<12> well a host with like 2 gig space and 80gig bw
<12> i need it to be fast though
<11> So the game is: I only do a initial mysql select, then populate with the name and try to get the id
<11> No simple way?
<4> Vixus: simplify simplify simplify... http://pastebin.com/636135 ;)
<11> do you want to see the cl***? maybe there *is* some simple solution...
<4> Vixus: for some reason preg_quote wasn't escaping '/', so it thought that /images was a bunch of flags (i for insensitive, m for multiline, woah! an "a"?!?)
<1> stevarino: oh haha
<3> hmph. curl not installed.
<4> Vixus: thats how that error popped up...
<14> ok i was the User805 or w/e, anyone have a good host to recommend? =)
<1> stevarino: should I escape it myself?
<4> Vixus: you really don't need it... that expression in the pastebin works, it searches for a jpg that has four digits, a slash, and then some more digits followed with ".jpg"... it works, i tested it myself
<15> is it possible to make a session last for 10 minuts?
<1> stevarino: and if I need to use the code for different sites?
<1> stevarino: Is there any way to use the $path_to...
<16> Hi.. im trying to do "forgot p***word" script.. and no mail is being sent.. I checked at the webhoster's homepage.. that their mailserver must be named in the script.. how do I do that?
<4> Vixus.. if you must.. ;) try $path_to = str_replace('/', '\\/', $path_to )
<1> stevarino: I will
<17> how do you see the type of a variable?
<7> I have an array like $array[var1][var2][var3] and i'm looking for find the 3 firt var3 of any in whole $array
<1> stevarino: No errors now, but a blank array coming back, that just means there's no match
<1> stevarino: Got it to work!!!!!!
<4> Vixus: congrats :)
<18> hi everyone
<1> stevarino: It even seperates out the filename. :)
<1> stevarino: Thanks again!
<19> hey guys
<19> anyone here know how i can obtain what methods an object have?
<4> Gilgamesh: php4 or 5?
<19> its like.,.. i have a funciont that receivs one object of any type, and i need this function to read the methods this object have... any ideas how i can do that?
<19> php5
<18> i am trying to print to screen results from an mysql query. my code is at http://pastebin.com/636165. for somer eason, what is printing is the actual query itself. can someone help?
<19> paco
<19> you are printig the $sql
<19> which is the variable you ahve the query
<19> after you do the mysql_query() call, you should for example do an mysql_fetch_array in the result variable
<19> let me show you the code
<4> Gilgamesh: you can try using reflection... but it can be a bit intimidating
<4> http://us3.php.net/manual/en/language.oop5.reflection.php
<18> gilgamesh, then what am i missung? (aside from basic common sense)?
<19> paco, http://pastebin.com/636173
<18> thx


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

Cannot CHANGE-CLASS objects into CLASS metaobjects
perl print split
#centos
#linux
#perl
mathematica inorder
fedora kleopatra crypto plugin
yup.rpm suse
#gentoo
#linux



Home  |  disclaimer  |  contact  |  submit quotes