« first day (1006 days earlier)      last day (4167 days later) » 

19:00
Hi any one there I have a question regarding godaddy domain
go ahead, dont ask.
I have an icon folder in my website and go daddy has an icon folder too in apache
when I have upload my code , there is a conflict between them
without rename the folder is their any way resolve that conflict
@dark put your icon folder in a different directly maybe
a level deeper
directory*
then again I need to change path in my website
id just check the godaddy folder and delete it if it is not of any use to you
19:03
its same like I have rename the folder :)
Is a relational database really just associating a certain thing with every new entry.
Someone
He ask why to do $_POST outside my class because once I saw they made a special class with 2 methods to check if there was a post request and 1 to return the variable ($_POST[$var] as $var
For example, if I have a table with username, password and id. Then I have another table with their full name with a user_id that should be the same as the id in the user table. Is that what a relational database is?
@Tredged be more specific i find it very hard to understand what you are talking about
what sort of class
@Tredged huh?
19:06
?
Never mind
in PHP OOP can you do $_POST[] to pass all variables ?
@AshKetchum yeah sort of but you would usually have a table to hold all use related data
Anonymous
@Tredged what do you mean 'to pass' all variables?
I mean every input
19:08
a use may have multiple addresses so you would have an addresses table. it would hold maybe an id, user_id, street_1, street_2, tow, city, country
@David tow?
a user can have as many addresses as you allow then just by adding another row to the addresses table
Anonymous
I a note sure, I understand all. But, I am certain, it is possible.
@David I have one big database with two tables. One table has username, password and an ID which I would call the user id. The second table has more detailed information like "favorite color, favorite food..." with a column called user_id that matches the id of the user in the other table.
@cspray i was listing off address information and i made a typo. it was right in the middle of street/address 2 and city. what could it possibly be?
@cspray planet?
19:09
For example if you have $_POST[naam] which contains Tredged and i have $_POST[drink] which contains Cola can i use $_POST[] to pass both ?
Anonymous
Yes. Generally, that is how the $_POST functions. But, they must be posted from the same field.
Anonymous
later you can check their values, using var_dump($_POST)
and if they are different field?
@AshKetchum yeah you can do it that way if you want
it can help though to keep as much related data as possible in the same table. it saves you have to query two tables to get the data or joining them together with a JOIN SQL statement
@David If u dont mind u have the same opinion about my question?
19:13
depends on what you are trying to accomplish though
@David a second opinion would do me good
Anonymous
If they are different, you have to use javascript to tame all the inputs under the $_POST object...
@Tredged when you say to pass both do you mean passing them into a function?
something like $koffiepost = new koffiepost();
$result = $koffiepost->koffie('string', isset($_POST['submit']));
19:16
@Tredged sorry i am still a bit confused about what you are trying to achieve
Anonymous
@Tredged are the inputs posted from inside one form i.e. <form> all inputs </form> ?
yes
@Simon_eQ
Anonymous
If that is the case, it is possible.
Anonymous
Just pass $_POST only, then you can manipulate is at any level
19:20
possible to make it public $email = $_POST['email']; or not?
@Simon_eQ
Anonymous
Yes. It is possible
@Tredged No, it isn't.
@MadaraUchiha Why not?
Anonymous
You can override ($_POST['email'] = 'newemail') or assign ($name = $_POST['email']) a variable to it.
You can't initiate class properties to statements, only to literals (The value can't be determined at runtime).
You must use a constructor in this case.
$email = "[email protected]" is valid. $email = someFunctionCall() is not.
Anonymous
19:23
I was assuming he is using a constructor. Since, the data is being pulled from a user..
2 mins ago, by Tredged
possible to make it public $email = $_POST['email']; or not?
Read the question well
public $email = $_POST['email'] will certainly fail.
Would $email = this->someFunctionCall(); work then?
if the function is in the same class
@MadaraUchiha
@Tredged No.
The value must be determined at compile time.
Example
Also
19:25
Lmao ur good @MadaraUchiha thanks.
Anonymous
class {
	public $data = [];
		function __construct($data){
			$this->email = $data;
		}
		function getEmail(){
			return $this->data['email'];
		}
}
Anonymous
something like that?
@Simon_eQ $this->data = $data;, you mean, right? But yes, that's correct
@Tredged 3v4l.org/HchYL This however works
(The (new Object)-> syntax is available only from 5.4+)
Thanks once again both of you.
@Tredged Sure =)
Anonymous
19:28
Yes, I meant data->['email'] anyway, I forgot to give the class a name too :p
hey all - is there any obvious reason why a php file would work when accessing it via http in my browser vs. running it in a cron?
as a cron_job? @KevinMurphy
You mean as URL?
19:30
@KevinMurphy You mean it doesn't work as cron, but it does work when accessed in web server context?
wget -O - yoursite.com/tasks.php >/dev/null 2>&1
should work?
@MadaraUchiha yes sorry! :P my worrding was probably off.
this is what i tried: php /home2/fluxil/public_html/dev/twitter/index.php
@Tredged TIAS.
TIAS?
@KevinMurphy what does index.php contain?
@Tredged Google "TIAS Acronym"
19:31
LOL
what did i do wrong xd
@MadaraUchiha a couple functions to dump latest tweets into a database
Oooh.
@MadaraUchiha " Invalid argument supplied for foreach() in <b>/home2/fluxil/public_html/dev/twitter/index.php</b> on line <b>22</b>" - yet accessing it via the web works perfectly.
@KevinMurphy Function definitions?
Can you share your code?
@MadaraUchiha TIAS for this? wget -qO /dev/null yoursite.com/tasks.php
19:32
@MadaraUchiha sure, one sec.
@KevinMurphy Let me guess, you're passing $_POST or $_GET in the foreach on line 22? :P
@Tredged TIAS = Try it and see.
2
Ye I figured xd
@MadaraUchiha nope :p pastebin.com/LVgawW2m - some keys were removed so i didn't have to reobtain them
@KevinMurphy Well, judging by the error, $data is not iterable.
What does the var_dump tell you?
Or print_r in your case.
i'll uncomment it and run the cron again, one sec!
yeah so.. it doesn't return anything but that foreach error.
19:41
@KevinMurphy That means that your variable is empty :)
Problem solved.
yeah so i guess it has to do with using cURL in a cron, maybe?
gosh dang it.
I guess it's debugging time for you :P
please correct this: DELETE a GROUP BY Symbol HAVING MIN(Volume)<50000
19:42
i don't even know how to debug this lol
i dont wanna use sub-query
Has anyone any thoughts on docpad.org?
@AdamLynch Hadn't heard of it before. Looks interesting.
@LeviMorrison yeah, I read about it in NetMag and couldn't remember the name til now
19:50
@ircmaxell Are you just pumping products out or are you just on an advertising push? lol
just rediscovered it
don't know of anyone who used it though
does anyone else know why a php script with cURL inside.. would not work in a cron_job?
Just pumping them out
@MadaraUchiha 3v4l.org/jHeQS If u see this and someone says there is no modal and view what does he mean lol ?
the two today were pet projects I've been thinking about for a while
19:51
3v4l.org/jHeQS If u see this and someone says there is no modal and view what does he mean ?
@Tredged You know, an application doesn't have to implement MVC
There doesn't need to be a model or a view or a controller.
Ah ok
@MadaraUchiha There doesn't need to be a model and a view and a controller. :P
|| ||
but kinda make no sense
@Kuraiinazuma Why not?
The point of MVC is to separate the difference responsibilities of a full application.
19:54
@MadaraUchiha @AdamLynch What if I do want to use MVC what names do u guys suggest me using?
Handling input, handling output, and doing the actual work of the application.
That's MVC
You can take whatever you want out of that.
for the controllers
hm
call it constroller
@Tredged Zend, Symfony2 and CodeIgniter are popular
I use Symfony2 day to day and it's alright
anyway there is no need to make your own, just use one of the thousands existings
and if you are not fammiliar what is mvc i sugget you to look at those lessons
sec
19:56
Thanks guys :)
epic bookmarked, thanks.
@Kuraiinazuma Wrong choice.
See my comment on that video.
what? its normal to call directory models
@Kuraiinazuma It's not normal to have "Model***s***"
hm anyway i think its a good starting lessons
to get familiar with
147
Q: How should a model be structured in MVC?

DietpixelI am just getting a grasp on the MVC framework and often I wonder how much code should go in the model. I trend of have a data access class that has methods like this: public function CheckUsername($connection, $username) { try { $data = array(); $data['Username'] = $user...

@Tredged If you want an introduction to MVC
later on he gonna use framework anyway
I recommend the article found on Symfony's book
Holdo n
I stopped watching the moment he named the directory "models", but the fact that you have a class that acts as *a model*, you are doing MVC wrong.
20:00
That article is great.
@Baba There's the model, there's the model layer. But once you have a model, you're doing it wrong.
@MadaraUchiha yeah that is... That swayed me a lot
@MadaraUchiha agree with you
It's really amazing my comments received "too many negative votes"
this is the most annoying thing gah.
The amount of clueless noobs is too damn high!
20:03
anyone know when phpmyadmin dropped php 5.1 support?
what version of phpmyadmin that is
@bizzehdee I'm afraid to ask why you care.
migrating from a server that refuses to upgrade from 5.1, and refuses remote mysql access, so i cant dump the database without that version number
I got an email about a job using PHP4
imagine that ha
@AdamLynch I have one response for an email like that.
20:06
Can someone advise me on something
31 secs ago, by Madara Uchiha
user image
@Tredged Yes, you should do it :)
Don't ask whether someone is here to help you If someone is around and wants to help they will.
@AdamLynch =)
20:08
htaccess if I have a file that is for example over.php how do I make it that it does blabla.com/over
I mean /over/ to over.php in public_html instead of public_html/over/
has anyone else ever come across curl not working inside a php cron?
Options +FollowSymLinks
RewriteEngine on
RewriteRule http://www.**********k.be/inloggen/(.*)/$ /forum/inloggen.php?$1=

something like this
@KevinMurphy If you only put the curl into the script, without anything else. Does it still not work?
@MadaraUchiha what do you mean?
@KevinMurphy If you have a script with only the curl, without anything else, does it still fail?
20:11
@MadaraUchiha I think I got it - one sec. i'm using curl to run the cron instead of php now :P
and just curing the web address instead of the file.. strange but idk.
No-one :(
hehe
@MadaraUchiha yeah apparently I need to run the cron with curl
Basically what I want to achieve is blabla.be/over/ goes to map /over/over.php
just realised, this is the first bit of PHP work i have done since changing jobs 8 weeks ago
@Tredged its a bit tricky, watch the link that i posted even if its not correct way to use mvc you will learn alot
@Tredged there is example how to do this sort of things
20:16
@Kuraiinazuma Like :P
@Tredged like this
        $url = isset($_GET['url']) ? $_GET['url'] : null;
        $url = trim($url, '/');
        $url = explode('/', $url);

        if (empty($url[0]))
            $url[0] = "Index";

        $file = 'controllers/' . $url[0] . '.php';
but first rewrite htaccess
its not best example, but it will do
IMHO it's worth to get known with the apache docs on that topic because you will look there more often in your life.
@ircmaxell please ping me when you have time to help me write some C code
and by C, I mean macro soup
@igorw Hey, spotted your answer about running Silex from the command line ... much appreciated :D
20:27
@NikiC Just like true-- and false++ :)
@MadaraUchiha all issues fixed woot.
Thanks @Kuraiinazuma and @hakre
@Jack glad to help.
there's another way btw, that works for all PHP scripts:
SCRIPT_NAME=/index.php SCRIPT_FILENAME=$(pwd)/index.php PATH_INFO=/foo QUERY_STRING="bar=baz" REQUEST_URI=/foo REQUEST_METHOD=GET php-cgi index.php
In fact, this answer highlights that wonderful behaviour :)
side-note: also works for non-PHP CGI scripts
side-side-note: CgiHttpKernel
20:35
@Gordon I've taken some inspiration from your cv backlog implementation regarding rendering html templates :) I didn't want to install a dep on PHPTAL, so rendering using DOMDocument now =D
@igorw Hmm I suppose that would work too :)
But now I'm curious to find out how to run POST requests; of course, I can create those with phpunit ...
@Jack easy: change GET to POST, add a HTTP_CONTENT_LENGTH header and pipe your post data into the process
bleh, nvm .. just write a wrapper ;)
or for the silex one from the answer, just change GET to POST and set the content
Hmm true, I could try adding ` < myfile.txt` as the interpreter options from within the IDE :)
> Decrementing NULL values has no effect too, but incrementing them results in 1.
20:42
So I need some opinions here:
How does that make any sense at all?
I am thinking about installing ubuntu server on my desktop computer and using it as a local web server instead of remotely connecting to an online server. However, I will be developing on my laptop. The laptop will be on the same wifi network, but would this idea work?
Also, what if I don't install Linux and just install Apache, MySQL, PHP etc. over Windows XP?
@AshKetchum Yes. But just use a VM and don't lose a box to being a dedicated dev server, it's not like it will need to cope with a high load.
Also CentOS ftw
20:45
@DaveRandom I have Windows 7 on my laptop. So what you are saying I should just download a VM, install Linux on it and start it up but I can still develop on real machine (Windows 7) instead of on the VM?
@DaveRandom Yeah, you like that? :)
Also $Apache < $Nginx
The output of nginx is fed into apache? ;-)
@AshKetchum Yeh exactly: virtualbox.org
@Jack pedant :-P
The only but about using nginx with php is that we're back to preforked era ;-)
Though, fpm is a good step forward.
20:47
It's still much better for a dev server
For a start the config file is half-way sane
Definitely, I used to have those horrible rewrite rules to get anything working with pretty url
Although at the end of the day, your dev env should be as close to your live as possible, so if you live runs Ubuntu + Apache then your dev should as well
the problem with nginx is .htaccess, so many people rely on it for shared environments, its hard to live without it
@DaveRandom That's why we run nginx on live servers as well :D
@bizzehdee Yeh but who cares about shared environments? :-P
user895378
20:49
<-- not interested in shared environments or hacky performance assassinations like .htaccess
^^ that
user895378
Did I mention .htaccess will murder your performance? Because .htaccess will murder your performance.
i used to do, when i had 6500+ customers... cant give every customer their own server when they only pay £99 for their package
or their own vps
.htacess is the serial server assassinator.
@rdlowrey why? because it needs to read an additional file?
20:51
What's that great XSS script again? (the one with the unicorns and the rainbows)
Apache's implementation of it is particularly bad, with it's woolly rules about scope and the fact that if you have an n-level deep directory structure below docroot it will search all n levels for htaccess files before it even inspects any of them and what they do
It's sorry stat()e
user895378
You're talking about file stat misses fractaling out on every single request. htaccess is terrible.
You can disable any htaccess right?
so , did i miss anything important
i agree apache's is bad, but the lack of it is just as bad
20:52
Nothing much, only the end of life as we know it
It was awesome
I wouldn't call the lack of Apache a bad thing :)
@DaveRandom yeah, searching for a .htaccess is slow, but if it's enabled and you place an .htaccess somewhere it won't affect a lot your performance
user895378
Not to mention it's terrible design to split your application logic into web server configuration files scattered all over the document root. I do blame apache for making people think that abomination is okay.
@bwoebi Really? You've benchmarked that?
Actually I know you haven't or you would have said that
@rdlowrey Well, usually it's just the bootstrap that's in there. It should be anyway.
user895378
20:54
It basically boils down to this: there is nothing webscale about .htaccess :)
lol
@DaveRandom no, but fetching a .htaccess is just one file reading, detecting a .htaccess (which it will do every time) at every level is much more a performance killer
@rdlowrey In fairness, it was the right solution at the time. The problem is that they didn't do something about it when people realised it was a bad plan.
user895378
@DaveRandom You're absolutely right.
user895378
The "right" way to do things evolves over time as we learn more about the problem at hand. Apache was the right solution at the time, but not now.
20:56
for example is it possible using a custom js script if ur on a website to a hide a specific div (that shows a banner)
user895378
Unless your corner of the internet still only needs to serve a handful of users at a time ... then apache will continue to be awesome for you.
does anyone here listen to BPM on sirius xm?
@bwoebi Oh sorry I misread that. Yeh the problem is re-stating everything every request, the actual I/O and applying the rules isn't too much of a problem, especially given that they generally change pretty rarely so the rules they define can be cache in mem
Which is why I prefer writing whatever is inside .htaccess into the httpd.conf instead. And use AllowOverride None should prevent the scanning.
@rdlowrey Unless you install wamp/xampp. Then you are a lost cause.
20:57
just asking myself if I really should now begin (re)reading parts of rfc 2616 … or if it's too late (if I'm already too tired)
user895378
@DaveRandom This is true.
user895378
RFC 2616: curing insomnia since 1999.
3
Evening rfc bitches!
For a moment I read cursing insomnia lol
user895378
@PeeHaa 'evening
20:59
@rdlowrey Still up? Or again?
On that note, it's 5am here, so I'd better get back to sleep ;-)
@rdlowrey okay, will test that now :-)
@rdlowrey You think so? Get a load of RFC2131, that's my current bedtime reader
night @Jack

« first day (1006 days earlier)      last day (4167 days later) »