@# 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



Comments:

<0> if i do something like body onload=newwindow()
<1> Adri: It calls id.php but never the less -- your question has no relevance to the programming and use of PHP.
<0> then run start_session() will the sessions from the first browser window apply to the second?
<2> Ahroun: id.php = index.php
<3> cmwneo, TIAS :)
<0> Davey|Work i have tried it
<4> how could you replace the first occurence of something with something else?
<0> i'm just wondering if im doing something wrong
<5> vhuren: str_replace?
<4> wouldnt that replace all?
<0> i have error logging poping up in a new window but now for some reason the session doesnt seem to carry along to the new window
<3> vhuren, read the man page :)
<2> Ahroun: ok... i'll ask in #hack :p
<5> Or substr_replace.
<4> ok :)
<5> Find your instance with strpos.



<0> so thats a no to sessions being across windows?
<6> hi i have an array with objects. And somewhere in the middle of the array i want to delete an object. How do i do that at best?
<5> unset($arr['key'])
<6> i don' t know what the key is
<5> That's a problem.
<7> i'd like to use a php cgi to allow users to d/l a file. anyone have a link to a tutorial describing how to send the file?
<5> So, fix your code so that you do know what the key is.
<6> damn
<6> i can't
<6> so if i can, will the other components in the array automatically get at the right place?
<6> because that's important
<5> What is 'the right place'?
<8> You could loop over the array until you find the object you're looking for
<6> yeah
<6> let's say my array contains 5 elements. Element 3 has to get out. Will the old element at 4 become 3 then?
<5> No, PHP arrays don't do that. Which is fine, since iterating over an array doesn't require you to know or care about the indices.
<9> no
<10> i'm trying to write a program to upload a file to a php script, the php script taken 'as-is' from the example on php.net, works great with a html form. i think the problem is i'm goofing up the headers, if anyone can take a look: http://rafb.net/paste/results/xjs2Sn10.html
<6> but if you do a count($array) , nothing will be changed then...?
<5> count($array) reflects the number of elements in the array.
<5> Their indices aren't a factor.
<6> but after 100 times deleteting one, my array will have indices of 1000 ... , no?
<9> deleting one what?
<11> use array_values with it
<12> 'lo Stormchaser
<5> Aap: If you loop over an array using foreach, you don't really have to care if there are gaps in the sequence.
<11> hey, sean`! Long time no see
<12> no internet :/
<13> i have a script with one include file (inc1.php), within that file, i have 'require_once file,file2' ...etc
<11> or what matt said XD
<6> well i care, that there are gaps in it
<5> Why? :)
<11> Aap: Why?
<13> if the regular script page is reloaded through a form, or executed with PHP_SELF, would those files still be working through out the script
<9> obsessive compulsive
<11> lol
<13> cause its not working with me, its giving me undefined function errors that are included within those files
<6> it' s nicer without gaps, no?
<5> foreach doesn't care about them.
<6> :-)
<12> Aap; Then sort the keynames
<6> it's not an ***o array
<11> Aap: Why do you care if you're using foreach? Arrays (at least ***ociative ones) aren't sorted or neatly packed.
<6> just an array with objects
<5> All arrays in PHP are ***ociative, but that's besides the point. Foreach is just as useful on numerically keyed arrays.
<11> *nod*
<6> okay
<6> thx
<12> Aap; PHP arrays are always ***ociative *copying matt*.. So you can use a sort method to sort them ;)
<6> yes true
<12> That'll remove the gaps, or do you have something against sorting arrays/
<6> :-)
<6> no, (not yet)
<6> :p
<6> okok
<12> Ah oke, then you're safe
<6> i'm really not a hard headed person
<12> You just stribe for perfection, right?
<6> yes
<6> ja
<11> hum... There aren't really 'gaps' in array, anyways.



<7> is there anything in php like #define, so i can have different code for php 4 and 5?
<6> but uhm i can't use foreach, i used FOR like 100 times
<11> define()?
<8> http://www.php.net/define
<6> my app is like 4000 lines of code
<12> Aap; Why are you using FOR so many times?
<14> hi, has anyone used PHPMyLibrary?
<15> 1337
<11> Aap: *blink*
<6> because it's easy
<6> :-)
<12> Aap; Yuo're putting the whole app in one file?
<7> Stormchaser: i want to be able to use php5 keywords but not have php4 choke
<6> nono
<5> Foreach is pretty easy...
<6> it's OO
<12> Ow oke.. whats the "real" problem?
<11> cobar: Yes, and...?
<6> every cl*** a file...
<6> oh **** i need a drink i gues
<6> s
<11> !+enter
<16> Don't use the enter key as puncuation. Think in complete thoughts, then type.
<12> Aap; Thats normally the issue when coding OO
<6> that i need a drink?
<6> :p
<6> ok thanks guys
<12> Aap; Try typing sentences that are longer than 6 words..
<6> i need a big big heavy cold drink (8)
<7> Stormchaser: so when i toss "private" in front of a var, the php4 parser isn't going to like that
<12> lol
<6> :p
<6> see ya guys
<7> Stormchaser: i won't even get to the stage where i can start define()'ing things
<4> preg_replace('/name/', 'hey', $returnString, 1) when I do that it replaces name with hey for all of em instead of just the first time
<13> can anyone help me with this including file problem
<12> cobar; Can't you state that you want .php files parsed by the php5 engine and .php4 files parsed by the php4 engine
<12> In your httpd.conf
<5> Only if you run one as CGI.
<11> cobar: WTF do you want to code PHP5-style in PHP4?
<5> The PHP4 and PHP5 Apache modules can't coexist.
<12> beerdeliveryguy; What is "this" problem?
<13> i stated it already.
<12> Ah I see it
<5> cobar: The private keyword isn't all that important, it's just compiler-enforced documentation. You don't need it.
<13> I have a file. script.php and its including one file (inc.php)
<12> so you have.. main.php -> includes 'foo.php' -> includes 'bar.php'/'baz.php'
<13> inc.php has require_once file, file2, etc....
<13> yeah there you go
<13> butttt.
<13> foo.php doesnt use 'include' it uses require once
<12> If you execute script.php the other scripts will also be executed..
<13> and inside main.php i have a form that action=PHP_SELF
<7> Stormchaser: i have a couple of cl***es that i had written for php5 and wanted to reuse in a php4 app
<12> Doesn't matter if you are posting a form or whatever.. as long as it's directed to script.php then it will..
<13> but when i submit the form, it uses the same page, but it appears ads if those files werent included properly
<7> anyway i can just drop my private declarations and run with it
<11> cobar: Then rewrite it in PHP4 style. Period
<13> giving me undefined function errors, no connection to mysql... etc
<11> !+enter
<16> Don't use the enter key as puncuation. Think in complete thoughts, then type.
<12> beerdeliveryguy; Where can I see this in action? Have you tried google'ing for your errors?
<13> could it be that since its requireing once only? perhaps changing it to include might help?
<13> yep.
<13> another previous script was working fine with it, I jsut dont see why this one doesn't want to work.
<12> beerdeliveryguy; Read php.net/include and php.net/require
<13> I did...
<12> Both are the same.. the one just dies and the other one doesn't... so thats not the problem
<11> beerdeliveryguy: Pastebin your code.
<13> I understand how theyre used, I thought maybe it couldve been that cause I dont understand how this could happen anyother way
<12> cobar; Porting an app from PHP5 to PHP4 shouldn't be that hard..
<12> beerdeliveryguy; Can you paste the errors in the pastebin (note the word: pastebin)
<13> yeah
<17> Hi !


Name:

Comments:

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






Return to #php
or
Go to some related logs:

howto defrag ubuntu
#math
Public key for madwifi is not installed
terminal for gdesklets
ubuntu squashfs mismatch
#gentoo
#perl
#suse
equivalent of chkconfig and service in redhat +ubuntu +start +stop +service
#perl



Home  |  disclaimer  |  contact  |  submit quotes