« first day (897 days earlier)      last day (4061 days later) » 

6:09 PM
@rdlowrey could you please check whether git.php.net/… makes sense?
I.e. what the HTTP spec says as to when location headers should be followed
 
Anonymous
Guys, why does, when $email is empty, it evaluates to true?
 
Anonymous
<?php

$tmpEmail = 'someone@website.com';
$email = 'someone_again@website.com';

$a = filter_var($tmpEmail, FILTER_VALIDATE_EMAIL);
$a .= (!empty($email)) ? TRUE : FALSE;

echo (bool)$a;
 
Anonymous
First, one works, second one does not seem to does not
 
Anonymous
@NikiC the wizard, it's been too long since the last time you helped, :( :p
 
Anonymous
Ok, nvm
 
Anonymous
6:40 PM
thanks
 
Seems to be working @phpNoOb, its not empty right
 
@NikiC can you get me up to date with the serialize() proposal? (I've only joined the mailing list today :D)
 
what's up with all the ponies? @MadaraUchiha @NullPonyPointer ?
 
@kaᵠ Please, it's a unicorn.
It's powered by pure enriched plutonium.
 
Anonymous
@kabuto178 I just want $a to return a bool, based on the conditions of both values
 
6:45 PM
so sorry @MadaraUchiha, i'm too ashamed now
 
@phpNoOb why the $a .= ? it's not supposed to be a string, is it?
$a = filter_var($tmpEmail, FILTER_VALIDATE_EMAIL) && !empty($email);
 
Anonymous
@igorw that is what I though, I made a hasty and silly answer to OP, and I am trying to change the answer here
 
@phpNoOb I see mismatched braces :)
 
hi all
need help
 
6:53 PM
The funny thing is that he accepted it without actually trying.
 
Anonymous
@MadaraUchiha Thank you. You know, that so well, that would get me a downvote, and you had to post repost it even
 
getting error in
Warning: Invalid argument supplied for foreach() in C:\wamp\www\testlogin\admintransaction.php on line 79
what am i doing wrong
????
 
@phpNoOb I don't undersatnd what you're saying?
 
foreach($_FILES['image']['name'] as $index => $name)
{
 
@samir $_FILES['image']['name'] isn't an array.
 
6:54 PM
@BenjaminGruenbaum @MadaraUchiha
but this code used to work before one day
i m using 3 images to upload
like
<td><input name="image[]" type="file" />
</td>
<td><input name="image[]" type="file" />
</td>
<td><input name="image[]" type="file" />
</td>
 
Anonymous
@MadaraUchiha I know you know, what I am talking about, It is ok though
 
@phpNoOb I downvoted, because the answer is wrong, no offence.
 
@samir When you ping me for no good reason, you get ignored.
 
And the question should be closed, because it's too localized.
 
@BenjaminGruenbaum no good reason ????
 
Anonymous
6:56 PM
@MadaraUchiha I know the answer is wrong, and that is why I even posted it here, because, I needed help to fix it. That would be the wrong time to downvote don't you think?
 
@samir $_FILES['image'] would be an array in that case.
@phpNoOb After editing the downvote can be removed.
Also, the correct course of action in this case would be to close the question, not answer it.
 
@MadaraUchiha thanks
 
Welcome to the team :P
 
@MadaraUchiha so u mean to say $_FILES['image'] would be enough in my case
 
They say you aren't really a Stack Overflow moderator until someone posted a meta ranting about you.
@samir I'm guessing. a var_dump($_FILES); would help you determine which you want to iterate on.
 
6:59 PM
@MadaraUchiha it's the second post ;)
 
@Gordon Really?! What's the first? :D I gotta see it
 
Anonymous
I gave a bad answer, and fixing it, would prevent others from rendering it a good answer, since it was obviously not.
 
@MadaraUchiha sorry i m a beginner. So i might not exactly get wht u mean to say
 
Anonymous
We are ok now, Man on a Pony. :)
 
@phpNoOb I've edited and removed the downvote.
 
7:00 PM
 
@samir var_dump() will output information about a variable, revealing the array structure.
 
@MadaraUchiha thanks
i will give it a try
 
@Gordon That doesn't count! He didn't know it was you in the first place :P
 
@MadaraUchiha fair enough
 
@MadaraUchiha array comes out to be 0
 
Anonymous
7:02 PM
Such a silly mistake, thanks @MadaraUchiha :). I know you hate me, for hating on @tereško, but hope we'll get along :p
 
@samir Huh? Can you paste it here (if it isn't too long?)
@phpNoOb I don't hate anyone. I don't take things personally over the internet.
 
sorry its long
but will tell u the line numbers
from line 77
 
@samir I mean, the output of var_dump()
 
i m getting that error there
ooh
array(0) { }
this is wht i m getting
 
This means the array is empty. You aren't receiving any files (the 0 means 0 elements in the array)
 
7:04 PM
till yesterday it was working
dont knw why n how i messed it up
 
@samir Just a note though
Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
 
hahahha
yes i knw that
almost everybody tells me that
but wht to do i m trying to learn php first
then i will be doing the optimization and security and all that stuff ;)
 
Simple, if an article mentions the use of mysql_* without the word "no" or "don't" before it, close the tab.
That code is too large for me actually follow, but here's what you should do.
Try to make a small test-case (i.e. just the inputs and the var_dump($_FILES), and see if you can see anything.
If you can, add parts of your code one by one, until it breaks. Then you know what breaks it.
This process is often known as debugging.
 
actually am an J2EE guy
trying my hands on php
so that will surprise u but i knw debugging
bt within java
or android
or .net
but PHP is PHP ;)
 
What are your thoughts guys about this http://stackoverflow.com/q/15733278/1401975
I think it's impossible, you ?
 
7:19 PM
@HamZaDzCyberDeV Not possible using any normal web technology I know.
Nor it should. It's the wrong solution.
 
ok thx :)
 
@MadaraUchiha got the mistake i was making
 
@samir Hmm?
 
forgot to write enctype="multipart/form-data" in form
 
Obviously :P
 
7:23 PM
@MadaraUchiha can u help me in one more thing
 
@MadaraUchiha actually i made an page
with edit and update function on the same pag e
on edit i m getting the values assigned to some variables
and on update i want to use those variables value
assigning the values on edit is done but on update the var return empty containing no value
so wht could be the problem ?
 
@samir Not following. Can you provide with an example?
 
just open this
i will show u the lines
line 22 and line 45
on 22nd edit is being called
 
Hi Guys,
I have a critical problem with godaddy server
can anybody fix my issue?
 
7:29 PM
@NeerajSingh Goddady probably can.
Don't ask to ask, just ask.
 
@MadaraUchiha which is setting values in vars
 
My Wordpress website is returning 500 error
 
@samir OK
 
it's working on WAMP smoothley
 
@NeerajSingh Locate the PHP error logs, and see what the problem IS.
 
7:30 PM
but I uploaded my all folder on godaddy server (IIS 7) and now it returning error
 
even simple php file also not opening
 
@NeerajSingh That's a different problem. We can't really help you with that as it's a problem on their end.
Consult Godaddy support.
@samir Okay, so what's the problem?
 
now in edit i assigning
but in upate i.e on line 45 onwards
i get those var values as null
 
Okay
 
7:31 PM
@samir Obviously, because when you UPDATE you don't EDIT
So the variables are never set in the first place.
 
but i m editing first
and then updating
 
@samir You're having a misconception about how PHP operates
PHP scripts run anew every time a page is requested.
You're a Java dude right?
 
@MadaraUchiha i may have but i have implemented the same in other pages
successfuly
 
Imagine that you're having two buttons, get and set, on your application.
What you're doing is the equivalent to pressing "set", closing the application, restarting it, and pressing "get".
@samir I'd like to see that.
Unless both $_REQUEST['Edit'] and $_REQUEST['Update'] are set, you won't see the variables set in one.
 
check this
a different page but implementing the same scenario successfully
 
7:35 PM
A few notes for you:
Don't use $_REQUEST use $_GET or $_POST, whichever you're using (probably $_POST in this case)
Also, unsetting $_REQUEST (or $_POST for that matter) variables doesn't make any sense
 
Guys, I written only <?php echo 'Hello World'; ?> on godaddy IIS server. But it's not opening, nothing displaying. can u guys tell me what exactly going on there...
.html file coming but php file not displaying
 
@NeerajSingh Like I already told you, we can't. Godaddy customer service can. That's where you should look for help, we can't help you debug your Godaddy account.
 
@MadaraUchiha can i make those changes later?? or can they also be playinh their part in messing it up
?
 
Okay :(
 
@samir You can (but it's rather trivial for you to change them now as well, just replace all $_REQUEST with $_POST).
 
7:37 PM
Thanks to all!!!
 
@MadaraUchiha sure
m doing it
 
@samir If you want data to persist between request, you need temporary ($_SESSION) or permanent (write to txt file or use a database) storage.
 
did u check my other file
 
Depending on what you need the data for. (User configuration? Probably permanent. Data which belongs to the current session? Probably temporary).
 
i m not doing anything like sessions or cookies but still achieving it
 
7:41 PM
@samir I can see what you do there
You use $_GET for the Edit, and $_POST for the Update.
 
where???
 
Forget what I said about replacing all $_REQUEST with $_POST
Didn't see you were using GET too.
 
oops but which line ??
 
example.com/index.php?var1=value1&var2=value2
This is GET ^
POST is "invisible" in the URL
 
@MadaraUchiha oooh
so if i want to make it a post
and still
get the parameters
how would i set that
 
7:55 PM
@samir Sessions
 
wont they be heavy to use ??????
 
Please, only one question mark per sentence. >_>
 
@samir POST method requests should only be used to perform an action, rather than retrieve data. So for example if I wanted to delete or update a record in a database I would use POST. But if all I am doing is generating a web page (including retrieving data from the database) I would use GET.
(evening @all)
 
@DaveRandom gudevening
 
In general if you perform a POST request you should redirect the user to a GET URL to display the result of the operation, as well. Google "http idempotence" and "post-redirect-get"
 
7:58 PM
and bt i m editing means filling the data in respective fields and then updating
@DaveRandom buddy but wht i dont understand is all other pages that i have prepared are working only this one is causing problems
 
Der Flatulator, Melbourne, Australia
402 1 10
nickname Oo
 
I haven't read the actual question, this is just general info, will read up a bit now
 
@DaveRandom ok
 
While I do in part agree with what Dave said. If say for example you have a need to generate a webpage etc past GET's data length. POST has not data length. So then it may be prefered in those rare cases to use POST.
 
u can check the file i posted here on pastie
 
8:01 PM
no*
 
@Esoterica If you need to pass data string >2KB to generate a web page, chances are you are doing something wrong in the first place :-P but yes, obviously GET does have its limitations. But what I'm saying is not just my opinion, it's a summary of what RFC 2616 says about when POST should be used.
@samir it looks to me like your issue is that the some buttons are buttons that are submitting the form, but your edit button is just a link. It won't transmit any data to the server because it's navigating to another page, it doesn't send the form data.
 
@DaveRandom but i m navigating to the same page
with rowid
and in edit i m fetching that successfully
 
user895378
@NikiC The changes in the diff report are all valid, but there's a problem with an unchanged line just above:
 
user895378
if (!strncasecmp(http_header_line, "Location: ", 10)) {
 
user895378
8:10 PM
That only catches location headers followed by a space after the colon.
 
user895378
Location:http://mysite.com is valid
 
@rdlowrey #fail
@samir What variable is not set in edit mode that you are expecting to be set?
 
user895378
Zero or more LWS (tabs or spaces) are allowed after the colon.
 
each one :(
@DaveRandom i can do it with sessions as @MadaraUchiha suggested
but do u think using session to store such variables is a good approach i dont think so
 
@MadaraUchiha wiki.php.net/rfc/secure_unserialize Is that enough?
 
8:15 PM
@rdlowrey Actually there are few pretty serious problems in that file surrounding that general issue. } else if (!strncasecmp(http_header_line, "Transfer-Encoding: chunked", sizeof("Transfer-Encoding: chunked"))) { :-(
 
@NikiC Yes, thanks
 
user895378
@DaveRandom Oh nice. Yeah I was about to look into the rest of that. I suspect there are lots of "goodies" hiding out in there.
 
@samir Sessions are neither a generally good nor a generally bad approach, they are use-case specific. The key point that puts a lot of people off is that they are fundamentally incompatible with REST. I'm having a little difficulty working through your file (it's post-lunch on Easter sunday and I'm a little drunk) but it looks to me a quick-ish fix would be to convert your edit link to a <input type="button" name="Edit" value="<?php echo $row['item_id']; ?>">
...but obviously that value="" isn't going to work for you in terms of the UI. I suspect you'd want a hidden input.
 
@DaveRandom hahahah
ok better take rest
 
user895378
Yeah, same problem on line 742 ...
 
user895378
8:19 PM
} else if (!strncasecmp(http_header_line, "Content-Type: ", 14)) {
 
driving and programming are prohibited in such conditions
;)
 
@rdlowrey eih
 
user895378
 
nothin I want to get involved in ^^
 
@rdlowrey I really can't quite wrap my head around #768, really not sure where a null byte would come from.
Certainly seems like an odd criteria for detecting the start of the body
@NikiC You appear to have opened the HTTP pandora's box in front of two people who have read every inch of RFC 2616 several times over. You have no-one but yourself to blame for this.
 
user895378
8:22 PM
@NikiC Are you being passive-aggressive about suggesting @DaveRandom and I contribute some improvements to php-src on the http front? :)
 
:-P
 
@rdlowrey yes :P
 
We really should create a non-shit API for the core actually, put our money where or collective mouth is. I'm sure @igorw would take at least a passive interest as well.
Now, to learn C properly...
 
user895378
Yeah, that's the trick.
 
user895378
If I had a real HTTP api in core and not userland my webserver would be seriously legit.
 
8:25 PM
@DaveRandom you didnt learn C first?
C should always come before PHP
 
Yeh, I realise that now. But I'm entirely self-taught and when I started I had no idea what I was doing.
Although to be fair, I still have no idea what I'm doing.
 
C is not used in web design. Some people only learn what pertains to their specialty, such as web design. Some people don't program because it's fun.
 
user895378
@DaveRandom same.
 
@bizzehdee Wrong.
 
brb
 
8:28 PM
@bizzehdee Preferably, C should not come at all.
 
@DaveRandom, im entirely self taught. my timeline (of the languages/markups i use on a daily basis) goes.... VB, C (and by proxy, C++), PHP/HTML, JS, CSS, C#
timeline/order
dont use VB anymore though, not even VB.NET, C# has entirely taken over that particular niche
 
VB is an abomination. Its designers should be brought up on charges of crimes against humanity.
2
I really don't know what they had against punctuation keys but they clearly didn't enjoy pressing them.
 
@rdlowrey LWS = [CRLF] 1*( SP | HT ) - the single space is actually part of the field-value.
 
@DaveRandom, it WAS helpful in teaching people "how to program". once you are aware of "how to program", learning a new language is easy. ie. im learning java (for android) at the moment. went from knowing nothing last weekend, to having 2 useful apps (at least for myself) built
 
user895378
@hakre Yes, but:
 
8:32 PM
@hakre The field value MAY be preceded by any amount of LWS, though a single SP is preferred.
 
user895378
> The field-content does not include any leading or trailing LWS: linear white space occurring before the first non-whitespace character of the field-value or after the last non-whitespace character of the field-value. Such leading or trailing LWS MAY be removed without changing the semantics of the field value.
 
user895378
So regardless, the SP shouldn't be required for PHP's implementation to function.
 
@rdlowrey no it should not. The separator char is the ":" and not that plus SP.
and LWS is here: tools.ietf.org/html/rfc2616#page-15 (edit)
 
one app was something my wife and i used a piece of paper for when my son was first born. tracking his milk intake, his nappy changes, his sleep, our sleep and everything else. so wrote a simple push button app, with LARGE buttons, with LARGE text, for new parents who can hardly see due to sleep deprivation. took me 2 days to learn everything i needed and actually write it, then refine what i had written...
 
8:34 PM
Unquoted whitespace doesn't have a semantic meaning in any part of any standard header value, I don't think. It's just a token separator.
 
actually, back in college (i had to go to get some paper to show i know what i know so i could get a job), i learned pascal and then delphi in an a single afternoon
 
I'm sure @rdlowrey will now prove me wrong about that though.
 
user895378
I'm surprised no one has complained about problems resulting from that code before. There are plenty of sites on the interwebs that won't append the leading space after the colon.
 
@rdlowrey There are an equal number of answers saying "add a leading space" though, which is probably why. People just "fix" and forget.
 
@rdlowrey is that code for the built-in webserver in PHP? Just joined back.
oh fopen wrapper.
 
user895378
8:36 PM
^^ that
 
maybe that is the reason so many users scream: take curl!
 
user895378
And the SP is hardcoded in for Content-Length: and Transfer-Encoding: as well
 
this needs fixing.
 
@bizzehdee I'd rather use f*cking QBASIC than VB...
 
only if you program sounds as well with qbasic.
 
user895378
8:38 PM
I suspect there are probably lots of other problems lurking in PHP's HTTP support ...
 
Although that's not a fair comment, because I'd also rather chew off my own arm and beat myself to death with it than use VB.
 
@DaveRandom, well luckily, most people recommend C# or Java as a learning language now as both are "easy" to learn compared to other languages, and they have application within business, so it is something once you learn it, it is actually useful to you
people/colleges/universities
 
Yeh, this is an unpopular opinion in here I imagine but I think Java is an awesome teaching language
Not so great for doing real things, but great for teaching.
ffs brb ~30mins
 
@DaveRandom in school we learnt Java right after we covered C basics. the C we learnt was basically a subset of Java.
 
lol found a flaw in the HTTP specs.
 
8:40 PM
@DaveRandom, my personal preference when people ask me is C# as it can be applied to both desktop AND web within business and is also easy to teach and now has a FUCKING ENORMOUS support base
 
IMO Java is a terrible language to start with when learning programming, there's way too much noise in there, which makes it hard to understand the essentials -- or to even see them.
 
user365265
finally, after an anoyng weekend and sleepless nights, i've figured how to use #PHP querypath lib.
 
user365265
DOM specification is not platform-specific. #PHP #DomElement tends not to assume the existence of types such as null.
 
anyone bought a raspberry pi yet?
 
user895378
8:59 PM
Hmm ... when I click the "Fork" button on the php-src github page I get a 404.
 
> give her some time; give her some space
 
user895378
hehe
 
@rdlowrey Fork not found... Does that mean it doesn't give a fork?
Alright. I think I'm good to go. Later all, see you 3 timezones away
 
flying round the globe?
 
Nah, still in the US
Seattle, here I come
peace
 
9:12 PM
@rdlowrey if you like, I can give you access to my fork: github.com/hakre/php-src (it just worked now)
 
fucking microsoft "this key is for upgrades only, not clean installs"... what the fucking bollocks does it matter. i bought a key, let me use it.
now i have to install vista to upgrade it to windows 7 so i can actually use my laptop again
 
user365265
@bizzehdee nobody forces you to use a dos operating system !!
 
NT based operating systems are not dos based. 9x based were dos based. windows hasnt had anything to do with dos since XP
 
9:29 PM
@bizzehdee Go with Linux
Unless you need gaming and stuff
 
linux isnt a good desktop OS. nothing in gnome or kde or xfce feels like it has been finished, or polished. it all feels like it "will just do". also, couldnt live without photoshop or MSVC (2010 currently)
*linux based os's are not good as a desktop OS
 
user895378
@hakre + @ircmaxell It seems to be working now. Momentary github flickering I guess.
 
used to dual boot ubuntu, but i wouldnt ever touch ubuntu, or anything based on ubuntu again after certain recent decisions regarding the project its self, and its governing and its partnerships
 
user895378
@bizzehdee Things like that are why I always use pirated windows copies even though I actually own licensed versions. MS makes it too annoying.
 
@bizzehdee Plus there's the fact that Ubuntu is Swahili for loser.
 
9:33 PM
@bizzehdee you never only pay for the key ;)
 
It isn't, I just made that up
It might be
I hope it is
 
@DaveRandom lol
ubuntu is actually for those who fear to use debian.
like me, but I use fedora ;)
 
@rdlowrey, i used to do the same, but got tired of chasing around after updates to recrack. only reason i installed vista and am currently upgrading to win7
 
and openbox which is part of the lxde spin is a very good desktop system
 
Meh, I really shouldn't be here. I'm kinda drunk and seem to be listening to and enjoying All Saints o.O
 
user895378
9:34 PM
I actually like Win7. Vista was terrible, though.
 
and gnome3 is a nice looking desktop UI for those who need that.
I know win7 from a friends computer. it looks quite ok compared to vista.
and I hope I never need to meet a win8 system in real world.
 
debian feels like its not stable because of how old everything feels and how featureless packages are compared to what is actually around at the moment, fedora is just... shit. looks shit, runs shit, installs shit
@hakre, if you get past "metro" and just use it as a replacement start menu, and use the desktop, win8 is a slightly faster win7 that takes up a few extra gb on your hdd
 
Can it possible to compare mysql 'date' type data with html form's 'text' type data
 
@bizzehdee if I would be a windows customer I would actually ask the vendor why it's not possible to make windows 7 that much faster, too (without wasting time for learning metro and waste those few extra gb on my hdd)
 
9:38 PM
only linux based os i like to use now is gentoo, but, even then, i dont like not having msvc and photoshop.
 
@bizzehdee can't you run msvc in wine? And some older versions of photoshop I think do it as well.
 
@hakre it is, but microsoft wanted to push metro and the appstore model... so we have windows 8, and the performance enhancements plus a few other bits where what ms used to sell it to people who actually know things
@hakre, not the newer versions of either. if wine cant run the newer versions, its not stable enough for me in general
if i have to use unix based os's, i avoid desktop, and to use command, i would rather use bsd such as freebsd or openbsd. proper unix based, stable too
both routers at work run openbsd, and all 8 servers run freebsd (free has more packages available by default)
 
xfce + gimp
 
gimp is.. and there is no other way of saying this... fucking terrible
everything about it
 
user895378
^ I can neither confirm nor deny this statement, but I know my way around photoshop too well at this point to negotiate the learning curve for GIMP.
 
user895378
9:49 PM
Just not worth it.
 
Depending on what you're doing, XNview is good for simple image editing.
 
@Mooseman, on some days, quite advanced photo manipulation, other days, quite intricate website design
 
@bizzehdee XNview won't be good for you then.
 

« first day (897 days earlier)      last day (4061 days later) »