@# 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> but as soon as i p***ed the object in per reference, getting problems
<1> Jax: well, as i said you don't need references in PHP5 for objects, but that isn't likely to be the problem
<0> yeah i removed them
<2> how do i get the current session id ?
<1> Jax: and now if you go back to just p***ing in the user id?
<0> ok, one minute
<2> what is $PHP_SELF?
<3> Current page
<4> that would be $_SERVER['PHP_SELF']
<1> BigSinep: load a page and do print_r($_SERVER) to see a bunch of information about your page and how you can access it
<5> who knows a site with lots of php scripts.... i need some standard stuff, like a contact form+reader, and news
<0> hm dools also gives warning
<0> Warning: mysqli::close() [function.close]: Couldn't fetch mysqli in /home/evino.ch/cl***es/evino/bonus/BonusList.php on line 40
<0> odd
<1> something else must have changed... Jax, i guess from this point on it's all a matter of experimentation, but one other suggestion i can make to see what the hell is going on is it a) make the variable public to see if it changes anything, b) make the variable global (ie. define it outside the cl*** then use the global keyword at the start of your __construct and __destruct methods) to see if you get the same problem
<1> Jax: then construct a very simple test to see if you can repeat the error in only a few lines of code and if you can, then submit a bug report



<0> ah dools i found out why maybe...
<0> actualy, it has nothing to do with the cl***es it seems...
<1> Jax: what happened?
<6> Is there a reason why <? echo $_COOKIE["variable"]; ?> works in my main page but not in the file included on the main page?
<1> Monkey-X: what do you mean by 'works'?
<0> the file that's actually using the cl***es: require_once(CL***_A); require_once(CL***_B); $myB = new B(); $myA = new A(23); that gives the warning
<6> the variable is displayed
<0> dools but if i comment the $myB = new B(); line, i don't get the error anymore
<1> Monkey-X: you sure the file is being correctly included?
<1> Jax: what if you use $myB = new B(); but remove the instantiation of a new mysqli instance from myB?
<0> ok let me try
<0> hm then it works
<0> oh awit
<0> sorry
<6> the main page has <? echo $_COOKIE["variable"]; ?> and include('includes/header.php'); in it and the variable is displayed. In the header.php has <? echo $_COOKIE["variable"]; ?> in it and the variable is not displayed.
<0> yeah then it works dools
<6> dools: the file is icluded correctly
<0> has something to do with that mysqli dude in there >;/
<1> Jax: yeah, i've never used it before, but it has a procedural and OO version... try substituting the procedural for the OO in your DatabaseWrapper cl*** and then see if it still has the same error. if it doesn't, then you may have found a bug with the OO part of the mysqli... maybe, it's hard to say. but like i said, before you file a bug report you should put it into a very compact and reproduceable test
<0> yeah let me make a little test version
<0> also so you can try
<1> Jax: little busy :-)
<0> i know ;)
<1> Jax: i'm having my own nightmares right now!!
<1> Monkey-X: try changing the echo in the header to a die()
<0> hm dools, now i left everything in, but commented out the function that actually performs a query in B...
<0> and it works too
<0> so it's that method in B that is causing the problem it seems
<0> not the mysqli construction itself
<1> Jax: well, it may also be that you can't have concurrent mysqli sessions when using the OO version...
<1> Jax: like, it may break it somehow
<6> dools: I get the die message, why?
<0> ew ;)
<1> Monkey-X: now you know that your header file is definately being included :-)
<0> dools well oddly enough, the queries DO work ;)
<6> I already knew it was, it's got graphic and a menu in it
<1> Monkey-X: well, perhaps the variable is being echo'd, but you can't see it amongst the markup, did you check the source of the page?
<1> Jax: scary stuff :-S
<0> ok i found the line
<0> that's causing all evilness ;)
<1> Jax: what is it?
<0> $row = $result->fetch_object();
<0> ODD >;/
<6> yep, not in the markup ;(
<1> Monkey-X: where are you setting the cookie? have you tried putting the echo statement at a different point in your header file?
<1> Monkey-X: also, try print_r($_COOKIE) instead
<1> Jax: i suppose it might be possible that fetching the object is somehow messing with the actual object reference stored in the mysqli variable...
<6> using the same echo it displays at the bottom of the main page, echoed from the main page. but not at the top of the page, echoed from the included header.php
<0> dools and it should be doing?
<1> Jax: i've never used it, i wrote a database library two years about that does all this stuff and recently finished an activerecord implementation so i don't even write sql anymore dude :-)
<6> print_r($_cookie) gives an error. Parse error: syntax error, unexpected T_STRING in includes\header.php on line 22
<7> hi guys
<0> dools hmm well, let me try to use a different fetch function then
<0> lol
<0> fetch_***oc works
<0> but fetch_object doesnt
<0> burn php
<7> can anyone plea\se tell me it i can grab the host mask of a user when they go onto my site i know the ip address is $_SERVER['REMOTE_ADDR']
<1> Jax: haha yeah, it can be frustrating sometimes :-)
<1> Jax: create a test example and submit a bug report if can creat a repeatable bug
<6> print_r($_COOKIE); returns Array ( )



<1> Monkey-X: so i'd say that's why the variable isn't printing out there
<6> how do I fix that?
<0> AND I WAS SUPPOSED TO WORK today....
<0> grml
<0> good thing the client already let out the newsletter than you can pay with credit cards tomorrow, and i haven't implemented any of it yet
<0> THIS is going to be a GREAT sunday indeed!
<1> Jax: i already had that sunday
<0> hehe
<0> yeah but is really ****S if it's the language's fault
<0> time to write test case then >;/
<1> geez, just when you think you've seen it all, you get a WMF file :-S
<0> dools lol
<0> test case is done
<0> evil
<1> Jax: well, you've just helped improve PHP then :-)
<0> gah
<8> Doom. Why did I shoot myself in the foot by creating a lovely file format that is wonderfully readable but resolutely unreadable?
<9> is there smart way how to get rid of "Warning: Invalid argument supplied for foreach()" ?
<9> shouldn't that be notice?
<10> nikns: make sure you don
<10> nikns: make sure you don't give it invalid arguments
<9> like array with no elements?
<1> nikns: if(is_array($arr))
<9> so the only way is to check?
<9> i cant put @ somewhere so it wouldn't scream? :)
<10> nikns: yes
<11> nikns: wrap the foreach in an if, or put if (!isset($array)) || !is_array($array)) { $array = array(); }
<10> nikns: not a good practice, the @ is deprecated
<9> addittional if ****s source ;]
<11> alienbrain: it's no deprecated, it's just stupid
<9> if i put there if i have to go down the code and make spaces etc :]]
<0> dools perhaps you can reproduce: http://pastebin.com/635744
<9> but that seems the only way to fix this
<11> @ is incredibly slow, nikns ... also, we don't do that type of programming in here. If you want to do it the stupid lazy way, try another channel.
<9> @ is suppression not programming iiur
<12> !+@
<13> [@] The PHP error control operator that suppresses errors (@foo()), see: http://php.net/operators.errorcontrol - Don't use it. Think I'm wrong? Ask me about "GO".
<10> aidan: ah right, thanks for correction
<11> !+GO
<11> !GO
<11> !tell aidan about GO
<11> ... okay just ignore me, that's fine, php-bot
<1> Jax: i don't have mysqli... i'm 5.0.4, maybe not in there yet?
<0> no idea, i'm on 5.1.2
<0> perhaps you didn't compile with mysqli
<14> I have a file that contains a cl***, which itself refers to several vars in an included file - that contains several string vars used throughout my website. However, when I try to use these external vars in the cl***, they are empty (null). What did I do wrong?
<14> BTW, the rest of the pages on the website (that don't use cl***es yet) see these vars just fine
<8> HAHAHA.
<8> I just typoed substr as subst :D
<14> ahhhh, nevermind - evidently you can't refer to outside objects/vars because an object is supposed to be free of external encumbrances...
<15> could any1 point me in the direction of a mid or left function to get the first fwe characters of a string
<16> substr()?
<16> !+substr
<15> ty
<17> can i somehow unload included ?
<18> is ASP a serverside scripting language like php and which is better in terms of efficiency and demand?
<15> asp or asp.net?
<15> and active server page
<19> arent they both the same thing?
<15> kinda gives the serverside bit away
<15> asp.net is tidier, and works a bit better tbh
<15> and is generally nicer to code with visual studio
<19> this whoel dot net thing is confusing
<19> does asp and asp.net both belong to microsoft?
<14> asp and asp.net are similar, but if you're going to convert from one to another, on a site with more than just a few pages, I'd start from scratch.
<14> i attened a 2-day asp.net course last week
<14> if you're familiar with the VS2005 IDE and asp, you shouldn't have a problem
<14> and asp is server-side
<14> i was really surprised to see that the IDE uses tables instead of CSS for layout when you use the wizards
<14> and then, I remembered that MS doesn't havea good handle on CSS, so it wasn't *that* surprising
<0> hey dools are you sure you don't need the reference operator anymore in 5? and why is that so? does optimizer know automatically or something? php is so freaky
<20> is $_SERVER['REMOTE_ADDR'] secure? Ii it allways the ip of the client. Proxys are one thing, but that I know.


Name:

Comments:

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






Return to #php
or
Go to some related logs:

copy a live cd ubuntu
savant3 tutorial
#linuxhelp
rc.status red hat i dont have
secure crt ubuntu com1
#osdev
decode signons.txt
#fedora
emerge the above package list contains packages which cannot be installed at the
#kde



Home  |  disclaimer  |  contact  |  submit quotes