| |
| |
| |
|
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
Comments:
<0> ? <1> x-ray5: What is PHP erroring? That it can't include the file? <0> can i im you the error? <2> ok great then :) .. i have a question, its sql injection a big security hole by default ? because as far as i know the php.ini file does not allow sql injection <1> If there's several errors, pastebin it. If it's one error, just paste the error in the chanel. <0> Warning: dir(./full/): failed to open dir: No such file or directory <0> see the ./full dir is in /foo/bar/full the script i'm including is the index.php of bar <1> Don't use ./ <0> and the script index.php is being included in a files in /foo/bar2/ <0> ya know what i mean? sorry i'm new to this php stuff if i sound like an *** to you programers <1> x-ray5: Then use dirname(__FILE__) which will give you an absolute directory of the *currently being executed PHP file* <0> what? <0> i'm looking at php.net and seeing waht dirname() does and that makes no sense to me <1> x-ray5: Well, maybe you should learn about __FILE__ <0> i know about file() <0> what is __FILE__? isnt it just the file name
<1> It's the path to the file of the *currently* being executed PHP script. For example: include1.php <?php echo __FILE__; ?> main.php: <?php include 'include1.php'; ?> When you include include1.php it will output: /path/to/include1.php <3> hi <1> x-ray5: That way there won't be any confusion when working with multiple includes. <4> ugh, I don't think i've ever been THIS mad at a program/script before. <1> And if you do dirname(__FILE__) it'll just give you "/path/to" so you know the directory, <0> i'm lost <3> how to make get variables case INsensitive? <4> ob_start(); include($file . ".php"); $str = ob_get_contents(); ob_end_clean(); // one file, its normal, the other includes like a non-buffered include, then exits after it finishes. <4> any advice? <3> d0nk`, what's your problem? <0> kuja: i'm grateful for your help but i dont understand what your telling me <5> how can I give multiple html select options unique ids instead of PHP incrementing them from 0? <4> i'm trying to move my site from using $_GET['page'] to determine the file, to using mod rewrite. I've got the REQUEST_URI parsed how i want it (if its not a file or directory, give it to index.php, ala wordpress style) <1> x-ray5: I'm trying to tell you, when you're trying to handle directories within included files, USE *ABSOLUTE* paths <5> <select name="categories[]" multiple><option id="1" value="asdf">hi</option></select> <0> abosolute meaning starting with the base "/" <0> right? <4> but in my "new" index.php file, my include() is not buffering. It just includes and echos the file right there, ignoring buffering, then exits <6> tek: I didnt know you can start an id='' with a number... <5> lith: just for xexample, it still doesn't work either way <1> x-faktor: Yes <1> x-ray5* <5> Array ( [categories] => Array ( [0] => b [1] => asdfkjs ) ) i want it to be [key] => b, not [0] <0> lemme try a few things <6> tek: Well if your iterating through category id's you could always do print "<option value='category". $row['categoryId'] . "'>". $row['categoryName']. "</option>"; <4> Zaki, say i do http://localhost/beta/archive/ (gives index.php parses REQUEST_URI and gets 'archive'), but it gives the same resault as me simply typing archive.php <5> lith, tyeah i have that <0> when i use / i get this bull**** <0> Warning: dir(): open_basedir restriction in effect. <4> same effect regardless of directory <6> tek: thats how i iterate through, creating id=''s <5> same here <0> kuja: any idea what that means? <6> tek: than I'm missing your question ;) (or was i mistaking that you even had one?) <1> x-ray5: It means that you're restricted to a certain directory scope. Your host probably set it. <5> yes, PHP is making the keys for me, i need the keys to not increment automcaically <5> in other words, i need the unique identifiers to be wehat i supply <1> Then supply it. <1> name="foo[bar]" <5> Here, i'll show you <0> kuja: please help me <6> tek_: then create a database row saying "elementId" and and id='". $row['elementId']. "' ? <5> x-ray5, kuja IS <1> x-ray5: Just use a relative path then. <1> x-ray5: Use it relatively from the script that is *including* the script does calls dir() <0> well if i use the relative path my **** ****s up when i include it in a differnt file in a diff location <1> So you need to change the path in your dir() call to be relative of the PHP file that includes it. <5> http://pastebin.ca/40649 <0> i'm not sure what u mean isnt that what i was going with dir(./folder) <5> but when bI submit it, it gives me Array ( [categories] => Array ( [0] => hah [1] => gah ) ) <7> whats the best way to send base64 encoded text across http? <0> is there a way to load all the files in a dir into an array without using this stupid dir function <6> tek_: exactly because the uniq auto_inc column in that table is (i would ***ume) blog_categories.id ... which would make it 0, 1, 2, 3, 4? <5> corect, but it starts @ 1 <4> oh, hmm <4> it seems that apache is ignoring my file extentions completly... <6> tek: apparently 0 is hah <4> index == index.php to it <5> no <5> btut if i selecteh LAST item <5> in the list
<5> it gives me 0 still <1> x-ray5: How about using chdir()? Will that work? <5> instead of that items id which would be (4) <6> tek: have you tried looking at the output to see what is going on? <5> yes <1> tek_: Don't rely on the keys to be values for you. That's why form fields have value="" <0> lemme read about it <5> k <8> hi there... someone know a script can get all the words of a single webpage or an entire website (links included)... ? <1> eft0: What "words?" <8> kuja, all of the pages <6> tek: and... everything will be 0 becaues your not specifying a value="" <1> eft0: What "words?" <6> tek: to make better light of what kuja said. <1> I'm asking a rather straight forward question. <0> kuja: if i do chdir('/'); and then include it will it work ya think? <7> whats the best way to send base64 encoded text across http? <6> x-ray: probably not. <8> kuja, the main idea its get all the words an make a rankinf of the most repeateds <1> x-ray5: You'd probably need to try changing your working directory to where you are trying to do what. <8> kuja, to make a ranking od keywords.... <1> eft0: You may use preg_match_all() for that. <8> kuja, yeah i know, what I need now its grab the links inside the page :S <8> to do the same proc <9> hey all - anyone familiar with php as a socket server? Trying to use it with Flash to do realtime auctions - comments welcome <1> eft0: So match <a href="whatever is here" ... as well then. <1> If that's what you mean by links. <6> hmm... <0> thisis ****ing bull**** <0> "open_basedir restriction in effect. " <0> what th **** why is it restricted <6> x-ray: were you trying chdir('/'); ? <0> no <0> i was trying to do dir(/foobar) <8> kuja, yep, bu i'm tired :P, that's the reason why i'm asking if someone know a script already coded :S <1> Heh, you were trying to access an absolute path, x-ray5. <6> i think dir needs a string dir <0> kuja: i know but why is my host ****ty and not letting me use the absolute path <0> is this common? <1> Not on my host. <0> this would be so eash if i could just ****ing use the absolut path <0> *easy <6> perhaps php has a dir function like pwd. or you can do $path = `pwd`; <4> i have no clue why apache is redirecting http://url/archive/ and http://url/archive to archive.php <6> then you can know what the absolute path is so you can just roll from that <6> best solution i can thinhk of <10> hi <0> lith: will not work, dont forget i'm going to include this file.. <0> i tried that <0> is there any way to not use dir to list the contents of a dir <6> x-ray5: What are you trying to accomplish? I believe that you may be overcomplicating a simple task <11> hi i am trying to write some php to pull topics and posts off of a phpbb forum. well it works, but when i get the post body from the database and echo it to the page, it isnt being displayed with the newlines in it, so it is all one line. how can i fix that? <10> i want to mysql_query("INSERT INTO foo(blub) VALUES(\"lorem " ipsum\") ... i guess the " between the lorem ipsum would make some problems... any idea how to do that? <12> Is there an easy way to make php check how many unread messages there are in an IMAP email account? <6> syco: nl2br <11> lith: i am just starting with php and this is my first time using it. sorry if this is stupid, but when it is read in the data doesnt even display a \n (or anything) like it does in other languages. will that still take care of it? <0> lith: yes i am, okay i wrote a script that uses two dirs one with images and one with thumbs of the images, and it prints out a nice little table of the thumbs with links to the big images. the script works great. but if i include the script in a php file that is in a diff location the script breaks b/c dir tries to call up ./full and because ./full is in /www/pics/full and the file file that is including the gallery script is in /www/foo/bar <6> angelus: I always use "INSERT into table (col1, col2) VALUES('$value1', '$value2')"; and depending on your magic_quote_strings or whatever will matter whether you have to addslashes($value); before p***ing to the query <8> l008com, make count() from imap_headers() <6> syco: nl2br will serve you well <11> lith: ok i am going to try it right now, thanks <6> x-ray5: and "./full" is the location of the big images right? <0> yes <13> does anyone know a good way to debug image creation scripts? <10> lith: so mysql_query("INSERT INTO table(col) VALUES(".addslashes("string with quotes")."\", ... would be safe anyway?! <0> any ideas? <13> I just get an error message in my browser saying: The image " ... " cannot be displayed, because it contains errors. <11> lith: thanks alot. that worked fine for me <6> x-ray5: you could always change your script to, instead of going <img src='./full/image.jpg'> to do <img src='<?php print $site; ?>/full/image.jpg'> that way all of the images called (within the included script) will work fine. <6> syco: np <6> angelus: Sure you can do whatever you want <6> angelus: if magic_quote_string is turned off, use addslashes and stripslashes <0> lith: i did! haha and it will not work <6> x-ray: how would it possibly not work?
Return to
#php or Go to some related
logs:
#perl #math wine configure include-directx edith stern #linuxhelp #kernel transcode javascript deselect text #linux #linux
|
|