| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> i tried with fopen('name.jpg','b'); fread($handle,filesize($handle)); and it didn't work... <1> dools, filesize($handle) doesn't make any sense <0> oh right, you use it with the filename <0> :-( <0> that's probably why it didn't work :-) <1> dools, and you might want to use rb as a mode, and not simply b <0> colder: well, file_get_contents works, but is b not a valid mode by itself? <1> dools, no, it's not <0> colder: cool, thanks for the tip <1> you're welcome <2> can anyone describe to me wat the following command does within httpd.conf "php_admin_value open_basedir" <3> p***be: as near as I can tell, nothing. <2> CryWolf: just found site which finally explains it thx <4> anyone see anything worng with this? http://pastebin.com/664168 <4> it never adds anything
<3> there actually is a "php_admin_value"? <3> Ortzinator: do you mean it never inserts anything? <4> er yeah <3> Probably because your query is always successful. <4> i doubt it, the table is empty <3> Ortzinator: irrelevant <0> Ortzinator: put or die(mysql_error()); after the query to see if it's successful <4> huh <4> after each query? <3> Ortzinator: look closely at the return of mysql_query, and the examples on php.net/mysql_query <0> Ortzinator: like this http://pastebin.com/664255 <4> ok no errors <0> Ortzinator: try replacing mysql_query in each loop with echo($sql); then copy and paste that sql straight into mysql and see if it woks <0> works <4> i think it has to do with the if statement <4> the sql works <4> '".$url."' <0> well if you echo instead of querying you'll see if you are getting inside the appropriate if <4> that's right isnt it? <4> ok lemme see <4> hmm it never goes to else <4> which isnt right since the table is empty <0> Ortzinator: try mysql_num_rows instead of if($query) <3> Ortzinator: where are you putting the result of the query? <4> thanks dools it worked :D <3> Ortzinator: do you understand what your problem was? <4> yes <4> mysql_query doesnt return true or false <3> half-right. <4> well for SELECT it doesnt <3> wrong. <3> mysql_query returns the same thing for every type of query. Now, as your exercise, tell me what the possible return values of mysql_query are. <4> thats not what it says on php.net <5> false or a mysql result resource <3> Ortzinator: where does it not say that? <4> http://us2.php.net/manual/en/function.mysql-query.php <3> Ortzinator: and what does it say? <4> For SELECT, SHOW, DESCRIBE or EXPLAIN statements, mysql_query() returns a resource on success, or FALSE on error. <4> For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error. <3> ah, true. sorry on that. <4> it happens <3> but in all cases, it only returns false for a failed query - that is, a query that generates an error in mysql. A successful query which generates no results is still true or resource. <4> yeah i missed that <3> a lot of people do. <4> hey, this morning i didnt know jack about sql <3> you can also ask php-bot about mysql_error <6> can i use php&sql to generate an rss file ont he fly? <5> brandon_: yes you can <3> brandon_: yes. <4> how does php-bot work <3> Ortzinator: /msg php-bot mysql_error <6> see, i'm dealing with someone who needs to enter the rss information, such as description and so forth, automatically. so there would have to be some kind of GUI that they could use to toss that stuff into sql <0> brandon_: rss is just an xml file <0> brandon_: ie. it's just a string <6> can php generate a web-based GUI that he could use? <3> no. you can write a web-based gui in php that he can use. <6> so it would be like a form? <6> i can write forms, but how would the data get to sql? <3> brandon_: is this your first time using php? <6> no
<6> but i'm much more used to perl than php <3> when you submit a form, all your form data is in the $_POST superglobal array. <6> it's more my first time using sql, but i'm a quick study <7> brandon_, there are several starter topics involving forms and sql statements <7> just search google <7> you'll finish reading it in no time <0> w/in 5 <0> d'oh <8> Does anybody know of a good PHP editor that can be portable (run from a flash drive)? <9> you can use vim with Toby Schlitt's vim rc files <9> ;-) <3> brohism: probably vim, if you compile it statically <9> http://schlitt.info/applications/blog/index.php?/archives/372-Comfortable-PHP-editing-with-VIM-4.html <10> How can i use the exec command as a different user ? <3> Derkommissar: sudo <7> You can't <10> sudo infront of the command <7> you can use sudo to run the command as another user <10> tried it and it dint work <7> but exec, nope <10> $output = shell_exec('sudo asterisk -rx "sip show peers"'); <10> it dint work <3> then you probably don't have your sudoers file set up properly. <10> how can i do that ? <9> man sudoers <10> so what user do i have to make a sudoer? <0> Derkommissar: the user that your php script is running as, which will be the same as apache most of the time, commonly www, apache or nobody <9> whatever user you want to run the command as <10> let me try apache <0> Derkommissar: a quick way to find out is to create a file from a php script and see who the owner is <9> sudo -u whateveruser somecommand <3> or "ps" will tell you <7> That will not work unless the dir is 777 or is owned by the user that apache runs (not a good idea) <10> no that dint work <4> o.O <10> :-/ <9> Derkomissar: what exactly are you trying to accomplish? maybe more detail will help <10> I want to print out the output of a shell command <10> the command is asterisk -rx "sip show peers" <10> but it requires to run as root <0> Derkommissar: can you successfully run it with sudo from the command line? <10> yes <3> can you su to the apache user and run it with sudo from the command line? <9> with sudo? have you tried the full path to sudo and the command? <0> Derkommissar: okay, there's obviously some problem getting the output. to check that it's working put "> file" at the end and then look at the contents of file <7> Derkommissar, google for SUID. That will help. <10> <?php <10> $output = shell_exec('sudo asterisk -rx "sip show peers"'); <10> echo "<pre>$output</pre>"; <10> ?> <9> try using the full path to sudo and the command you wish to run <10> Ok <9> also check what CryWolf said about sudoing to apache user in shell and trying to run the same modified command <10> i cant su to apache <10> [root@SipServer html]# su apache <10> This account is currently not available. <3> sure it is. you just have to p*** a flag to su. <2> why does this statment not work, soz new to php, "$destdir = '/var/' + $userid + '/';" <11> What's the equivilent of fetch_***oc() if I don't have mysqli/php5 installed? <10> :-/ <9> did you try the full paths? <9> no dice? <12> fetch_***oc() is in the regular mysql library <9> sup preinheimer, this be phishphiles <12> yeah, 4.0.3 and above <12> Hey, Hows it going? You gonna be at PHP|Tek? I'm giving two talks <9> not sure yet, i saw that tho, congrats <12> Yeah, it's sold out, so i guess you're not comming <9> its doubtful ya.. sold out dont bother me ;-) <12> :( <12> heh <10> i ran a whoami command <10> and the output on the web browser is this #!/usr/bin/php apache <12> What's new phishy
Return to
#php or Go to some related
logs:
Fedora resolv.conf generated by NetworkManager sid/xorg Packages #php windows bridging undefined symbol: _PyArg_NoKeywords mod_python gparted boot flag nvidia ubuntu blurry fonts #gaim #perl ubuntu terminal language
|
|