« first day (1367 days earlier)      last day (3807 days later) » 

00:01
I know not of what you speak. ref?
oh right afaik that's just screwing with the guts of PHP, rather than building something new on top of it
8 mins ago, by DaveRandom
I don't speak from any real position of true understanding there though
@NikiC do you think it will be possible in near future: chat.stackoverflow.com/transcript/message/17676422#17676422 ?
@DaveRandom yep
@bwoebi which shows intent. Which may not be a bad thing...
00:29
Anyone here?
00:46
@DaveRandom I don't even have a Canadian bank account :-P
I just used html redirect.
@RahulKhosla Dude, do it via HTTP.
echo "<meta http-equiv='refresh' content='0; url=".$row['link']."' />";
^ That one.
HTML meta-redirects are filthy.
Just do it via HTTP Location.
I tried php header (Location).
I got errors.
00:52
Right, because you had output before it
Yes.
I couldn't solve it.
I needed that output.
Um, you can easily solve it; don't output anything before you set headers.
I needed it.
You needed what?
Outputs.
00:53
No you didn't, not if you were using a Location header.
That doesn't make any sense.
Can I send you my full page code?
No, you can't.
And show you where to look?
No, you can fix your own code so that you aren't trying to both output a response body, and set HTTP Location headers in the same response.
If you have already identified that you are in fact dumping output before trying to set headers, then you have already identified your problem, and now the next step is to fix it.
And thats the problem I cant.
00:56
Chances are, if you are stuck in a situation where you can't separate the code that sets headers from the code that writes output HTML, then your code is mucked, and you need to refactor into separate modules each area of responsibility.
Take a look:
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/photo/download.php:67) in /Applications/XAMPP/xamppfiles/htdocs/photo/download.php on line 77
Yea, I know, everyone gets that error.
77: header ("Location: ".$row['link']);
67: </form>";
Yea, that's where you're setting the header; what's line 67?
Right.
12/13: <?php foreach ($downloadStmt as $row) { ?>
<h1><?php echo $row['name']; ?></h1>
00:57
So? 67 is probably the last line of output, and is hence the one referenced in the error.
That's not actually relevant though; the fact that it is a problem to begin with is what you need to fix.
63–67:
} else {
echo "<form method='post' class='dlForm'>
<input name='downloading' class='btn btn-auth' value='Download' type='submit' />
</form>";
Which means, refactor your code, because you're probably doing way too much shit in a single file/function/class.
Lemme guess, you have SQL mixed in the same file with HTML?
So, you have SQL intermixed in the same file with HTML?
00:58
Refactor everything.
I think SEc
Your code is broken.
Sorry to tell you, but it is. If you have SQL, PHP, and HTML in the same file, you fucked up awhile ago.
Yeop. Refactor everything; as in, take the SQL and put it into a file elsewhere, which probably means a function (method) which probably means a class.
And just include a functions file?
01:01
Don't do what Wordpress does.
But... eh... sure?
But really does it matter?
Probably 1,000,000 better than what you've got going on now.
Security risk?
Yes.
It matters like, fucking hugely.
Reasons?
Im mainly worried about security.
01:02
Um, because you want to separate the respective concerns of your codebase into whatever modules the language supports, so you can easily swap, change, reintegrate, and bugfix stuff without EVERYTHING fucking breaking?
Yea, you should be worried about a lot more than security based on what I'm seeing.
How so?
Whats wrong?
Because you have a markup, imperative, and query language all in the same file?
God dammint
Sorry dude.
No worries, im glad you stopped me now.
Before I make more fk ups
...
01:04
I'm going to recommend something, I dunno if anyone else has mentioned yet in the periodic assistance I see going by; do some reading.
A lot of reading.
Read other code, not books.
I ALWAYS SAY THAT! I never read books for a reason.
Just code snippits.
See what other projects, of a similar type are doing; or at least in the same language (PHP, of course)
No no no no no, reading books is necessary.
But not for you, not right now.
Also, saying that you "never read books" probably contributes to the problem here.
I'm just suggesting you review other projects because it's probably going to be faster for you to understand what they're doing right and you're doing wrong.
And then move onto reading materials on architecture.
Ok thanks.
Just wondering on what the heck to do now.
rm -rf ./my-project
nonononono
01:08
Nah, don't do that.
I can't I'll actually cry.
But put aside the "project", and consider making toy applications, using other projects as a guide for architecture, organization, and strategy.
I've only got 2 months for this project, I go back to uni in September.
You definitely should read about dependency management/injection, separation of concerns, or more broadly, SOLID/GRASP, but I honestly don't think you're there yet, based on the number of syntax-related questions you come in with.
You. Aren't. Going. To. Finish. It.
Not in 2 months anyway.
Im so close with what I have.
You should see it!
01:10
No, you aren't.
Want me to put it online?
Not if you have code like that littered throughout it.
I don''t want you to do anything except start reading and learning, rather than trying to cash in on a pipe dream.
I don't know what your intentions are with the project, whether they're monetary or as a work piece, but trust me; it's not going to be pretty. Toy projects for now.
Toy projects; work on big stuff when you have a grasp on how to manage the big stuff.
If your idea holds water, then if you learn quickly enough it'll still be a possibility.
And I don't think you're taking it this way, but rest assured I'm not trying to insult or berate you; I just think that you're not ready to handle the project you've set out to do. You need to do fundamentals -> syntax (per language) -> basic architecture -> system architecture -> project
Hi, but bye as well; my coffee is getting cold.
01:13
Anyone know how to fix this problem with MAMP?
Cannot send session cache limiter - headers already

I've looked it up for the past half hour and haven't gotten anything
Cya, thanks Dan.
Enjoy your coffee
^^^^^^^^ @RahulKhosla See?
35 secs ago, by Destiny Dawn
Anyone know how to fix this problem with MAMP?
Cannot send session cache limiter - headers already

I've looked it up for the past half hour and haven't gotten anything
01:14
Yes?
I do that all the time.
Headers. Headers everywhere.
Anywho,
01:15
@DestinyDawn Functions that send/modify HTTP headers must be invoked before any output is made.
I run ob_start();
session_start(); when the page is first loaded
Sec. I saw a post on that.
Alright
<?php
ob_start();

// code

ob_end_flush();
?>
That help?
Doesn't seem to work sadly, I just keep getting these odd errors nonstop about this. It was working, now it isn't
01:18
I get: Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/photo/download.php:67) in /Applications/XAMPP/xamppfiles/htdocs/photo/download.php on line 77
session_start(): Cannot send session cookie - headers already sent by (output started at /Users/mac/----/Home/PHP/----/----/index.php:1) in /Users/mac/---/Home/PHP/----/----/index.php on line 2
That's the error I'm getting now
Whats on line 1.
<?php
Haha
:D
Any spaces?
01:21
Line 2?
session_start();
BOM
Look that up.
I've been looking it up, just haven't been able to figure anything out
What're you coding in?
What application?
Dreamweaver
01:24
Been there, done that, @DanLugg told me off.
Haha, recommend any better ones?
Netbeans
You need JDK first, im on a macbook.
PHPStorm is awesome but I'm a NetBeans person.
Hence NetBeans.
Which one is best?
Netbeans is really good.
I've been using it for a few weeks.
01:26
NetBeans is free, if you wanna throw a bit of money in then PHPStorm is the way to go.
I'll be sure to try it out after this, but I'll love to figure this probably out haha. I've had so many problems with PHP. I'm new to it
Me too.
9
A: UTF-8 Without BOM?

JordanYou can do this by opening the page properties and encoding. Instructions below are for Dreamweaver CS3 and are hopefully similar to the version you're using. Open your document Open the Modify menu Choose Page Properties Select the Title/Encoding submenu Select the Encoding dropdown and choose...

I started with ASP.NET. I'm normally working on iOS but I figured the backend is better using PHP
What does session_commit() do?
ASP.NET is good but only because C# is good. The problem is the whole .NET part.
01:30
I removed session_start()
No longer getting the error
But I can't store the login information any other way
Anything in the session setting it off?
i don't understand?
I assumed the $_SESSION superglobal links to session_start();
It should
Are there any $_SESSION's = headers?
01:32
Yes, I set the UserID as a session variable but whenever I leave the page, all session data is gone
Remove that see what happens?
Then nothing happens, haha.
Wonder what happens if you destroy the session.
session_destroy(): Trying to destroy uninitialized session in
After the session_start?
Not sure if it will help.
01:35
Nope, I just added session_start() before it, but now I am getting the original error again
:(
Have you posted?
Posted*
I have not yet
session_start(): Cannot send session cookie - headers already sent

This is the error
@DestinyDawn Did you read the answer I linked?
01:36
The UTF-8 one?
Don't post a headers already sent question; it'll get closed instantaneously.
Yea, that one.
I'll try that now
Also, stop using Dreamweaver.
If editors/IDEs were people, Dreamweaver would be eating paint chips in the corner.
Which one do you recommend again?
I'll try to download that one and try it
NetBeans because free; PHPStorm because better.
01:38
Netbeans
How much is PHPStorm?
I dunno, 99 USD?
Something like that.
I'll try the demo
PHPStorm costs, don't get student version, you can't create commercial projects, its like $25 I think.
Moral of the story: don't use Dreamweaver.
01:40
Lesson learned, I'll attempt NetBeans. Any recommendations if it doesn't fix it?
Most people who do some graphic design work in Adobe CS get warped into Dreamweaver because it's the first "half-decent looking" one they see.
^ I did that.
I only used it because of the autofill
Adobe EdgeCode or CodeEdge or whatever, looks kinda okay actually. It's like Atom.
Heavily customizable, etc.
01:42
@DestinyDawn If the linked answer doesn't fix it? Then I dunno; could be an included file, could be something else, not sure.
I'm using a template if that helps
No idea. If it's a Dreamweaver template, it's probably a problem.
Wouldn't be programing without problems
You'll have less sans-Dreamweaver.
There's enough problems without it.
Removing the template fixed it
01:43
What was the "template"?
I made a template for dreamweaver so I didn't have to constantly recreate pages
Ah. Here's a good template for PHP:
<?php
Nope.
01:45
If a file contains only PHP code, don't use a closing tag at the end.
That fixed all problems
Lovely
Thank you so much guys
No prob.
Don't think I helped but ok :)
@RahulKhosla You don't necessarily need to close <?php, it's actually best practice to leave it open if there's no html, you might prevent sending some whitespaces
One mor quick question!
*more
01:47
* which might cause "headers already sent" errors
Could you submit a form with a <a> tag? I'm trying to use a <a> tag to log out
^^^^ :-)
@DestinyDawn why do you want to submit a form with <a>?
I dunno; you can submit a from via JS, or you could style the button to look like a link, or you could support a GET request to do the log out.
@HamZa anchor tags look better, like link buttons in asp.net
01:49
You can style buttons to look however you want.
<button style="...">
@DanLugg Could I actually detect the # in a URL? If I do href="#logout"
Rather than a query string
If you wanted to do it via JS, then yes. The fragment isn't sent to the server.
Ah, query string it is
Just style the button. Every other option is going to be icky.
@DestinyDawn meh, you either use button + form or just a link to /logout
01:51
And if you do use a link, you probably want rel="nofollow"
@DanLugg I tried styling a button like that, but it's kind of difficult
What does nofollow do?
nofollow is a value that can be assigned to the rel attribute of an HTML a element to instruct some search engines that a hyperlink should not influence the link target's ranking in the search engine's index. It is intended to reduce the effectiveness of certain types of internet advertising because their search algorithm depends heavily on the number of links to a website when determining which websites should be listed in what order in their search results for any given term. However, new information suggests that search engines will depend less on links in the future and more on other...
^ we need a bot :P
Ah, thank you. I never even knew about that
@HamZa ;-) Why, we have you?
hehehe :)
01:53
:-D
I forget, is there something better than nofollow? @HamZa
How could I see if there is a GET or a POST value without throwing a warning?
@DestinyDawn isset
@DanLugg no idea
Thank you, sorry for all the 'noob' questions
Okay, back to SQL I go.
02:12
Is there a de facto for storing IPv4/6 in MySQL? A pair of BIGINTs? A single BINARY(16)?
I'm getting conflicting information.
@DanLugg You remember when you said not to have PHP and HTML and SQL mixed?
Mmhmm?
Sec sending a paste.
Is this enough to use? pastebin.com/GCXvKtvE
And pastebin.com/aW22i8qb (db-functions.php is the SQL/PDO stuff).
Sure, but !isset($_SESSION) will always be false
Try session_id (IIRC) should return an empty string or false if there's no active session.
So I shouldn't even have 2–5?
02:21
That's getting better; again though, I can't stress enough to look at other projects. Seriously read for like, a week.
Or a month.
 
2 hours later…
04:05
@DanLugg nothing if you maintain phpdbg :-D
04:43
heloow
is anyone available?
05:03
@bwoebi @NikiC well.. I had to read twice before noticed that I misread that message. So, my eyes failed. If I posted something offensive then shame on me, yep
 
1 hour later…
06:18
@NikiC -fpermissive will allow that cast. But aside from that you should be able to write C++ compatible code.
Just curious if anyone had ever got it working.
This answer is probably my most link-heavy answer yet ;-)
But I felt it was important to know what exactly is the difference between node value and text content :)
Yes, we get it =p
06:59
morning
morning
07:15
hello
Moring
@bwoebi You also would have had a license based on your php-src work ;)
A penny spent on PhpStorm is a penny earned.
hehe.. those guys are based in St. Petersburg ?
07:39
Ah, poor Andrea ... got himself into a Mexican standoff there :)
07:57
good morning
user924016
Morning

« first day (1367 days earlier)      last day (3807 days later) »