| |
| |
| |
|
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 32 33
Comments:
<Jeewhizz> that gives you the raw POST data <kon> yes Mosselmaniac <JaredCE> getListOfResourceTypes is a function that checks a database table to see if an id has anything in the parents column and then gets all the children of that parent <Jeewhizz> unless you have specified enctype="multipart..." <Mosselmaniac> what exactly does it do? <Mosselmaniac> and what do i do to compare then? <kon> $foo[] = $asdf does append $asdf to $foo <Mosselmaniac> ok, i understand. <Mosselmaniac> but still then, you don't have the next array in that parent array to compare with? <Jeewhizz> there is also $HTTP_RAW_POST_DATA, but that is slower than my above example <TML> absentia: No, I'm saying it puts it in Apache's memory structures. That may be memmap() or a file in /tmp or just in physical memory. You have (almost) no control over that. <Jeewhizz> (iirc) <absentia> see, if I'm transferring a file between two machines using post... say... and php is receiving, if it receives the data once.. and writes it out to a file -- and now I can read stdin// and get access to the "raw" .. that means I'm processing the data twice. that can't be right. <JaredCE> y the time it gets to line 58 it's lost some of the values that should be in the arrays <gental> i hate shopping <TML> Jeewhizz: php://input and $HTTP_RAW_POST_DATA are pretty much exactly the same. <absentia> tmp: so not true. *sigh* <absentia> I'll go see what I can google :-< <Jeewhizz> php://input is slightly faster <kon> Mosselmaniac: this is up to you to make a controlstructure to compare values <TML> absentia: No, you don't process the data twice. You access the same memory structures two different ways. <TML> absentia: Not the same thing as "processing twice" <Mosselmaniac> i still don't understand it. :( do i put $arrData[] = $array; inside my while loop? <absentia> anyway, tml, thanks for taking with me about this... I have to run to a meeting.. then when I get out -- I have to figure this out. :-/ <TML> Mosselmaniac: while($foo = mysql_fetch_array($bar)) { $arrayoffoos[] = $foo; } <absentia> tml: ok, I'll give it a try. <absentia> thanks <TML> Mosselmaniac: Now you have an array in PHP that you can jump around in and do your comparisons. <Mosselmaniac> omg, i need to reboot, can't save anything at this very moment. brb. thanks all <killer-instinct> how can I send an array of data to a session, and keep it there for another process to add more array data to it? <Jeewhizz> $_SESSION["array"] = $array; <niraj> lol, i dont think thats what he was asking <Jeewhizz> :D <TML> niraj: What, then? Because that's exactly what I read it as, too. <niraj> he said "another process" <TML> Go on <Dangermouse> lol <Jeewhizz> hehe <niraj> maybe.. non-php process? :P <niraj> at least thats what it made me think <niraj> heh <Edward123> he's too busy taking lives <joey[]> hello <Mosselmaniac> hello all again <Mosselmaniac> i'm sorry TML, but i crashed <joey[]> does array_rand() extracts selected element from array or leaves it inside? <Mosselmaniac> so if i remember correctly? $data[] = $array; <TML> Mosselmaniac: Why are you sorry? It didn't affect me. <Mosselmaniac> sometimes it looks arrogant to leave within a conversation, i thought <TML> We don't bother about that here. People come and go far too much. <Mosselmaniac> $data[] = $array; ? <TML> Mosselmaniac: What about it? <Mosselmaniac> did you just tell me that? <Jeewhizz> joey[] , it leaves it inside, it will just return a random element <TML> joey[]: array_rand() returns a key. If you want that key removed array, unset() it. <Mosselmaniac> while ($array=mysql_fetch_array($result)) $data[] = $array <joey[]> Jeevan, TML, thank you <TML> Mosselmaniac: More or less. <joey[]> so, i should use unset after it? <Mosselmaniac> but that adds the data of the array to the $data[] array? <Mosselmaniac> then i don't have the value of the next record yet, do i ? <TML> Mosselmaniac: You build the array before doing ANY processing at all. <Mosselmaniac> oh, just do 2 loops? <TML> Mosselmaniac: Then you do your processing on the array, where you can jump forward or backward however you like, instead of the result set, where you are more limited. <Mosselmaniac> hmm <JaredCE> http://pastebin.com/574907 i'm having trouble with my arrays here, in the first instance of $resources = $database->getListOfResourceTypes($subject); i'm checking each subject in the url to see if there are children related to them in the database, i'm then checking those children for more children, if they don't have any children then the id goes into $idarray and title into $resourcearray, if they do have children then the id and title of those childs <Mosselmaniac> so then i go another time through my result, and then? <JaredCE> display a list box of every child for each subject it seems to miss out a few <Mosselmaniac> how to access field 'b' from the array? <TML> Mosselmaniac: $rows = count($data); for($i=0; $i<$rows; $i++) { if ($data[$i]['b'] == $data[$i+1]['b']) .... } <JaredCE> like if there were two parents in the first set of results only the first lot of children are displayed <ita> hi all .. im trying to run php scripts with iis6 on a windows machine .. all "works fine" as long as all my code starts with <?php ... ?> ... parts in <? ... ?> are just ignored and sent to browser ... even worse .. parts like <?=$_MYVAR['somethin']?> is ignored as well <TML> Mosselmaniac: Although, I submit to you that a more carefully constructed application and database schema wouldn't run into this problem. <ita> this my fault, php problem or iis misconfig ? anyone any experience ?! <TML> ita: 1) Don't use '<?='. Use "<?php echo". <Mosselmaniac> wow thanks tml, but why do you say that last thing? <niraj> ita: if you really want to use <? and <?= edit php.ini and allow short tags <TML> Mosselmaniac: Because its true. <ita> ah <ita> thank you nire that might do the trick <Jeewhizz> <?xml version="1.0"> <Jeewhizz> that will give you a parse error <TML> ita: It's an option that's turned off by default because it's highly discouraged. <Jeewhizz> if you use short_tags <ita> since its not my code id like to prevent editing all sources <Jeewhizz> you'll be ok using short tags, as long as you aren't planning any xml <TML> Or creating portable applications <ita> ok thanks a lot for your insights <Edward123> you can always <?= "<?xml version="1.0">" ?> anyway <ita> damn .. all "short_*" i can find in php.ini reads "short_open_tag = On" <Edward123> if you are a bad boy <ita> so it should be turned on <Stonekeeper> hi. Can anyone recommend a windows php editor that can run off a shared drive rather than being installed. Thanks! <Jeewhizz> notepad.exe? <JaredCE> http://pastebin.com/574907 i'm having trouble with my arrays here, in the first instance of $resources = $database->getListOfResourceTypes($subject); i'm checking each subject in the url to see if there are children related to them in the database, i'm then checking those children for more children, if they don't have any children then the id goes into $idarray and title into $resourcearray, if they do have children then the id and title of those childs <Mosselmaniac> tml, thanks, i got it to work :) <JaredCE> display a list box of every child for each subject it seems to miss out a few like if there were two parents in the first set of results only the first lot of children are displayed <niraj> ita: then that's probably not the php.ini that's being used :P <ita> ok found my problem .. c:\windows\php.ini isnt used .. my admin installed to c:\program files\php\ and there is another ini .. but thank you again <Asiiii> hi there <Asiiii> is someone there with exp in php5-SOAP? <Jeewhizz> what's wrong? <Asiiii> i want to use complex types and defined one within the <types> of the wsdl <Adeel> do alot of mysql queries per minute give alot of load to server ? <Asiiii> first problem is, i cannot get this type with SoapClient->__getTypes() <ita> sorry to bother you again - now the short tags work "again" ... but i seem to have a problem with sessions .. lines like "if($_SESSION['some_key']) { echo "something"; }" .. result in Undefined index some_key ... but these are just notices .. do i have a session prob or maybe the server the sources come from have sth like "ignore notices" or something ?! <Jeewhizz> hmm <Jeewhizz> sec brb <TML> ita: You either need to use isset() before checking values, or turn off notices. <Asiiii> second problem is, when i create a complex cl*** and use the cl***map-feature, the encoded type contains something with ns2: within the xml <redduck676> a stupid question: things in $_SESSION are stored in visitors browsers or on the hosting server? <Jeewhizz> hosting server <Jeewhizz> usually in /tmp <Jeewhizz> no idea with the SOAP stuff Asiiii - sorry <redduck676> Jeewhizz: what should i use if i want it to be stored in visitors 'something'? <Asiiii> those soap stuff in php is not documented well enough btw <WurstFromHell> any ideas concerning the validation of form data? which pear package or is something else more efficient? <babo_> Hi guys, I have a delicate problem here. this function imports text+newlines from a function then process them. But the output it gives me has no newlines in it. Although it does have linefeeds ... does anyone know what I can do <babo_> URL="`cat job_description`" <babo_> URL_ENCODED_DESCRIPTION=`php -r "echo rawurlencode('$URL');"` <babo_> ? <Jeewhizz> brb <Jeewhizz> Asiiii - use a cookie <Jeewhizz> setcookie() <Artnez_> babo_: do you have the code to pastebin? <babo_> Artnez_: ? <Artnez_> babo_: show the code <babo_> Artnez_: that is the code ... it's only two lines <babo_> Artnez_: or at least that's the bit that doesn't work ... I <babo_> 'm using php cgi <babo_> or sorry I mean phpcli <Jeewhizz> back <redduck676> Jeewhizz: the setcookie() tip was meant to me, right? <ita> TML: thank you thats what i thought .. but as i said .. im trying to make the transfer of sources as easy as possible .. i dont mind out customer wrinting bad code .. i only try to get it to work .. a isset() makes sense but nvermind thanks again! you helped me a lot and fast thats very kind <Jeewhizz> yes redduck676 - oops <Artnez_> babo_: sorry, what you have is not enough for me to understand what the problem is <caffinated> babo_: I'm not sure how that's going to work, given that 1) you're single quoting a variable, and 2) you're not setting the variable. <nsanity> Is there any reason why __toString wouldn't be called when doing something like sprintf('%s',$object); ? <redduck676> Jeewhizz: thanks, will have a look at it <Artnez_> nsanity: i believe toString is only called when used with echo/print <babo_> Artnez_: ok, job_description is a file with a letter in it. I'm trying to import the letter and ***ign it to a shell variable and then use the shell variable in a curl function. I can import the text+newline no problem, also the urlencode function works fine (I don't know how either) ... but the url text I get back is missing all of it's new lines or %0D characters ?? <TML> nsanity: Artnez_ is precisely correct, and in fact, this is clearly documented in the manual under __toString. <gimmulf> What function should i use to check if a value is in a string? <TML> gimmulf: strstr() or strpos() <Artnez_> babo_: how are you retrieving the file contents? <Artnez_> babo_: and posting some code would be a good idea, we won't have to play 20 questions :) <nsanity> Hmmm weird. <babo_> caffinated: single quoting works in this instance because - as far as I'm aware - bash parses the line first - then php parses it. Bash doesn't see the single quotes because they are in a php expression. <caffinated> babo_: ok. why not do it all in php? I'm not sure why you're involving bash in this.
Return to
#php or Go to some related
logs:
glx_ext texture pixmap fedora lmsensor #kde #ubuntu xlite on ubuntu network storage audio downland readmin pizza mether #debian optgroup click
|
|