« first day (715 days earlier)      last day (4224 days later) » 

12:20 AM
Is it possible to use $_POST['']; in the same page the textbox is in?
 
anyone?
 
@user1079641 yes it is. Try it
 
hmmm ... this PDF-maker idea might not be as good as i hoped .. the spec is 1310 pages
 
@tereško what's wrong with existing PDF-generators in PHP?
@tereško what's wrong with existing PDF-generators in PHP?
 
@Jocelyn Just saying, but I only ask here when I tried it and failed.
 
and , have you actually used those things ?
 
I have a textbox with name "full"
 
@tereško what's wrong with existing PDF-generators in PHP?
 
<? $full=explode(" ",$_POST['full']); ?>
doesn't work
 
12:30 AM
i already answered
 
$full[0] and $full[1] doesn't print out anything.
 
1:04 AM
Is there a mysql_real_escape_string equivalent in PDO to secure the database from mysql injections?
 
No, because there is no need to escape data. It is done automatically
 
So I shouldn't worry about hackers attacking my database through sql injections, correct?
 
The parameters to prepared statements don't need to be quoted; the driver automatically handles this. If an application exclusively uses prepared statements, the developer can be sure that no SQL injection will occur (however, if other portions of the query are being built up with unescaped input, SQL injection is still possible).
 
By the way, I have regular statements, instead of the binded ones that involve the colons and all that, if it helps you understand
 
Sorry my previous answer is wrong: there is a function to escape data: php.net/manual/en/pdo.quote.php
You should read all the manual pages about PDO, it contains lots of useful information and examples: php.net/manual/en/book.pdo.php
 
1:11 AM
@Jocelyn I think you need a wooden stake for that little person you are talking to
 
@PeeHaa That looks like a very painful alternative...
 
@Jocelyn, tell PeeHa I tell him to shutup for once.
 
@user1079641 I have enough with my own problems, I won't handle yours.
 
@Jocelyn Only thing that is working against a vampire
 
Anyway, I am off to bed. If you want to use some closevotes, check the links above
See you later!
 
1:15 AM
@Jocelyn Already gone through them
later
 
@PeeHaa I started using tortoiseSVN, I think it is exactly what I needed. I just need some practice with the tool now...
 
@Jocelyn It's pretty easy if you get the hang of it
@SomeKittens np :)
 
ugh. I don't mind helping noobs out with hw (I do it a lot here at school), but copypasta the whole question? Just switch to Journalism or Communications already.
 
lol
 
@SomeKittens I might be annoying but even I don't do that lol.
 
2:07 AM
later all
 
 
1 hour later…
3:47 AM
Can anybody tell me which is the best php Editor?
 
4:19 AM
@PhillipMclauren For which platform? Windows, Linux, or Mac?
 
why php dnt have any good written open source project available to learn things Data Mapper,DDD
 
hiya
i've been working on a problem past few days
had no luck
so here is what I want
I have a contact from which uses this
<?php
require_once( dirname(__FILE__).'/form.lib.php' );
phpfmg_display_form();
function phpfmg_form( $sErr = false ){
$style=" class='form_text' ";

?>
the problem is that I can't call membership functions such as
`echo $loggedInUser->user_id;`
member functions are defined in a config file which is included by require_once("models/config.php");
 
4:42 AM
@Sidath Can you provide more code? It isn't obvious what the problem is from what you've posted.
 
<?php
require_once( dirname(__FILE__).'/form.lib.php' );
phpfmg_display_form();
function phpfmg_form( $sErr = false ){
$style=" class='form_text' ";

?>

<form name="frmFormMail" action='' method='post' enctype='multipart/form-data' onsubmit='return fmgHandler.onsubmit(this);'>
<input type='hidden' name='formmail_submit' value='Y'>
<div id='err_required' class="form_error" style='display:none;'>
<label class='form_error_title'>Please check the required fields</label>
</div>

<?php echo $loggedInUser->user_id; ?>
that is the form.php
 
@Sidath So what file is the line require_once("models/config.php"); in?
 
If I put the following on very top or very bottom, it echos what I want
<?php
echo $loggedInUser->user_id;
?>
here is the `config.php`
<?php

require_once("db-settings.php"); //Require DB connection

//Retrieve settings
$stmt = $mysqli->prepare("SELECT id, name, value
FROM ".$db_table_prefix."configuration");
$stmt->execute();
$stmt->bind_result($id, $name, $value);

while ($stmt->fetch()){
$settings[$name] = array('id' => $id, 'name' => $name, 'value' => $value);
}
$stmt->close();

//Set Settings
$emailActivation = $settings['activation']['value'];;
$mail_templates_dir = "models/mail-templates/";
$websiteName = $settings['website_name']['value'];
:(
 
6 mins ago, by Shaquin Trifonoff
@Sidath So what file is the line require_once("models/config.php"); in?
@Sidath
 
line require_once("models/config.php"); is in form.php
form.php is included in quotation.php
 
4:53 AM
@Sidath And quotation.php..? :-)
 
url/dir/quotation.php
:(
 
@Sidath So how does models/config.php actually get included in form.php??
 
it is not
`models/config.php` is included in `quotation.php`
sorry. what I've said earlier is wrong
line require_once("models/config.php"); is in quotation.php
@ShaquinTrifonoff
 
@Sidath It's a huge mess of includes :-) So, the next file: where is quotation.php included in form.php?
 
here is the `quotation.php`
<?php
require_once("models/config.php");
securePage($_SERVER['PHP_SELF']);
include("../includes/header.php");
include("../includes/db.php");
include("left-nav.php");
if(mysql_num_rows(mysql_query("SELECT cxid FROM orders WHERE cxid= '$loggedInUser->user_id'"))) {
header("location:/clients/account");
}
elseif (isUserLoggedIn()) {
include ("form.php");

}
else {
header("location:/clients");
}

include("../includes/footer.php");
?>
 
5:19 AM
erm.... @ShaquinTrifonoff, You there boss?
 
@Sidath So quotation.php is supposed to get included in form.php some way or another, right?
 
it's the other way around
`form.php` is incl in the `quotation.php`
 
5:37 AM
@ShaquinTrifonoff For Windows platform.
 
@ShaquinTrifonoff... :(
 
@PhillipMclauren I use Notepad++.
@Sidath It's spaghetti code :P
 
@ShaquinTrifonoff thanks :)
 
@ShaquinTrifonoff so what would I do then?
 
@Sidath I don't know. What is your code supposed to do?
 
5:42 AM
I need to echo logged in user info in the contact from
 
@DaveRandom Can you help @Sidath?
 
6:02 AM
@DaveRandom?
@anybody?
 
6:33 AM
hey
It seems that the problem is caused by this function
function phpfmg_display_form( $title="", $keywords="", $description="" ){
@header( 'Content-Type: text/html; charset=' . PHPFMG_CHARSET );
$phpfmg_send = phpfmg_sendmail( $GLOBALS['form_mail'] ) ;
$isHideForm = isset($phpfmg_send['isHideForm']) ? $phpfmg_send['isHideForm'] : false;
$sErr = isset($phpfmg_send['error']) ? $phpfmg_send['error'] : '';

# FormMail main()
phpfmg_header( $title, $keywords, $description );
if( !$isHideForm ){
phpfmg_form($sErr);
}else{
phpfmg_thankyou();
 
// FormMail main()
phpfmg_header( $title, $keywords, $description );
if( !$isHideForm ){
echo '**!$isHideForm**';
phpfmg_form($sErr);
}else{
echo '**else**';
phpfmg_thankyou();
};
echo '**footer**';
phpfmg_footer();

return;
}
@Sidath What does it output?
 
contact form header, a thank you message and contact form footer
 
@Sidath That code that I posted, it should output something like **else****footer**.
 
!$isHideForm
**!$isHideForm**
that's the output
@ShaquinTrifonoff
 
6:48 AM
@Sidath What?
 
@ShaquinTrifonoff
here is what I got when I add your code
`**!$isHideForm** `
 
@Sidath That means that phpfmg_form($sErr); will execute.
 
@ShaquinTrifonoff errors like missing required fields etc.
 
@Sidath Where should $loggedInUser->user_id display?
Which file?
 
@ShaquinTrifonoff in the form.php included in quotations.php
@ShaquinTrifonoff: is there a way I can email You the files?
 
7:32 AM
@ShaquinTrifonoff @vascowhite @ircmaxell @DaveRandom,
Is there anyway to pass data parameters without been seen in the address bar as an <a href> link?
using javascript or something?
 
@Sidath probably
@Sidath Please
@Sidath dont
@Sidath ping
@Sidath all the time
@Sidath its annoying
 
:D
okay
er.. is there anyway to find a way?
 
@Sidath especially when you're rude enough to ping multiple users who haven't previously been involved in your conversation!
 
Okay I'm Sorry Sir!!
Any help?
 
@Sidath congratulations, you just made it to my ignore list.
 
7:37 AM
why?
What is this ping you're talking about?
I don't even know what that is!
Are you referring to tagging? using @?
 
8:32 AM
Hello everybody I am facing this problem from many days can anyone suggest some solutin stackoverflow.com/questions/12614890/…
 
@Sidath Yes, ping means putting @ in front of someone's username, it notifies the user. Example: @Sidath.
@Sidath Click the picture --^
 
9:04 AM
does WHERE in mysql query allow you to manipulate separate columns? For example, can I do WHERE (firstname+" "+lastname)="some name"?
 
RewriteEngine On
RewriteBase /lamed/
RewriteCond {%REQUEST_FILENAME} !-f
RewriteCond {%REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/
Why error 500?
 
@UnoMeinAme This is the PHP room you need

SQL

Got a SQL question? Any SQL flavor here, just ask. Indicate yo...
@hakra You have an imposter stackoverflow.com/users/1709282/hakra
 
9:37 AM
2 messages moved to recycle bin
morning
 
HI
 
morning.
 
any one have any good programming related youtubes to share?
 
hello
 
@vascowhite lol, I need to switch my name back probably :)
 
@Petah what are you interested in?
 
oop, security etc
google tech talks
 
@vascowhite i saw some people saying service layer in zend framework should be used as api for controller and then some people says it should be used to encapsulate functionality that does not fit into model class.would you like to reveal your approach :)
 
@hakra Especially as you probably don't want to be associated with his answers :0
-1
A: Receive Ajax and display output in a Photo؟

hakrayou can use this to show the photo $("document").ready(function(){ $("textarea").on("keyup",function(){ $values=$(this).val(); $.get("ajax.php?message="+values,function(data){ $("#ajaxResponse").html("<img src="+data+" height='10' width='10'>"); }) }) }) ...

@Tarun I tend to use a gateway layer composed of several specialised gateways that provide db abstraction for a single class or for a group of related classes. But why ask me in particular?
 
9:49 AM
@vascowhite only you were seems to be active in the room when i asked this question. and your profile was telling me that you can help me.
 
@vascowhite well, there are more than one duplicate name on this site :)
 
hi guys
 
@Petah Have you seen already the other talks by Misko Hevery?
@FilippoAlessi Good day Mr. Alessi.
 
9:59 AM
is gateway layer refer to classes extending Zend_Db_Table_Abstract
 
@Tarun No, I never extend Zend_Db_Table_Abstract. I prefer composition over extension.
Unit testing a class that extends Zend_Db_Table_Abstract is just about impossible if you want to stay sane.
 
@vascowhite then to what gateway layer refer
 
@hakra no
 
@Tarun the classes that deal with the process of persisting/hydrating objects, whether that is to/from a db, file or something else.
 
Guys, have you ever thought that Facebook does not have one line of Php Oop? Here is shown that the procedural is not less than the OOP... What do you think?
 
10:06 AM
i was reading the book zend framework 1.8 web application development,in that book he was making a storefront application having models like product,category. and some resource classes extending zend_db_table_abstract like model_resource_product
 
@FilippoAlessi I don't care TBH
 
@FilippoAlessi where did you get your information from?
 
Every model class having a has-a relationsip with resource classes
 
@FilippoAlessi i think you are making up reasons why you should not learn OOP
 
@FilippoAlessi so developers.facebook.com/docs/reference/php/facebook-api states: $facebook = new Facebook($config);
how is that not oop
 
10:09 AM
@vascowhite thank you very much but seriously i need some examples to get over it
 
@tereško i know oop
php5 was released in July 2004, Facebook in February
 
at the core of it OOP is a method of code organization.
 
@tereško :D
the oop police
 
@tereško I know, I emphasize only that facebook was not written in php5 oop (because php5 was released after Facebook) and now is the largest community in the world.
 
10:11 AM
@FilippoAlessi facebook might not have started with oop but i can almost guarantee they use it now
 
@FilippoAlessi with PHP4 it was already possible to use OOP php.net/manual/en/migration5.oop.php
 
lol
the first quote of that page is In PHP 5 there is a new Object Model.
 
Ahahahah
 
either way facebook has been in constant development with hundreds of developers for 6-7 years since that
 
seems like you assume that once code is written, it never ever gets updated
 
10:13 AM
where as the original code probably took 1-2 people 4-6 months
@tereško know any good oop youtube videos?
 
@Petah it is said that the engine of the site has never been touched ...
 
cite your references
 
ok, one moment
 
@Petah , which particular aspect of it ?
 
the aspect you feel important
or one of
 
10:18 AM
assuming you have already seen "clean code talks" : infoq.com/presentations/principles-agile-oo-design
 
@Petah youtube.com/watch?v=4F72VULWFvc <- I like this one, too
 
i was more looking for youtube videos so i could watch it on my tv in bed
and yes i have seen "The Clean Code Talks -- Inheritance, Polymorphism, & Testing"
that would be one of the few i have
it was great
 
@Petah Found! Sorry for the language of the article, it says that just because Facebook does not want to rewrite the basic site then created HipHop. it.techerald.com/page/hiphop-de-facebook---qu-es.html
 
it taught me about LOD which i first herd of from you @tereško
 
@FilippoAlessi , it it is a tech-article , and it is not in english , i would not trut it anyway : codinghorror.com/blog/2009/03/the-ugly-american-programmer.html
@Petah , the list of videos that i have collected can be found here : stackoverflow.com/questions/9846220/php-oop-core-framework/…
but most of them are on vimeo
you could instead watch this one : youtube.com/watch?v=bxxIXPc9IR8
it's not about OOP , but about PHP itself
 
10:23 AM
"It wasn't initially, but these days it is. Not all the older code has been modernized yet (a truism in software development), so the most accurate answer is that the code base is a mix but new development is generally OO-style. Given the combination of a growing engineering team and ongoing efforts to refactor old code, it's safe to say that the non-OO code is a constantly shrinking percentage of the total.

The abstractions we use for data access and so forth these days are pretty much OO-only."
@FilippoAlessi that is a quote from a FB developer
@tereško thanks ill watch The Clean Code Talks - "Global State and Singletons" tonight
 
So Zuckemberg in 2012 would have preferred to write facebook in oop?
 
@FilippoAlessi to write a program as big as facebook requires more than one persons incite
 
@FilippoAlessi You can not ask that question that way, in 2012 Zuckerberg would have done nothing in that direction.
 
@Petah of course!
:)
 
@FilippoAlessi do you not like oop?
 
10:29 AM
Are there some kind of canonical questions 1.) "How to debug PHP?" and 2.) "How to debug AJAX and PHP?"
 
xdebug, and firebug + xdebug?
 
@Petah I like it. I was just a little surprised by that article.
@hakra @Petah is the question addressed to me?
 
@FilippoAlessi No, it is dedicated to a large share of new SO users that are just posting code chunks and asking "why does this not work?".
 
Ah :D
hi
 
10:33 AM
@tereško do you like any particular php framework?
 
not really
 
@Petah i like Aptana a lot!
do you like it?
 
the IDE?
 
well my question was about frameworks, not IDEs.
and i have not tried, nor seen it before
i use netbeans
 
10:35 AM
@Petah i have long-standing bias toward Kohana , but i am aware that it's quite horrible
 
@tereško do you do much JS?
 
yes , without jquery
 
how do you feel about the OOness with JS?
considering its so different from PHP
 
10:57 AM
we have two of those now?
 
Hello all. Yeah, I was just looking at the extra hakra, what an extraordinary coincidence.
 
@hakra who gets pinged now?
 
@Gordon you
 
@Petah there is both hakras in here. autocomplete gives me two. but which one will get pinged?
 
@Gordon Wasn't it you who said this lately?
1
A: Javascript, php, HTML and CSS what next

hakraif you want to become an expert programmer, google SOLID, buy GOF, buy POEAA, buy Clean Code, lookup GRASP, DDD, CQRS, DCI … but dont ask for PHP books. That's the most reasonable suggestion I can give you when you ask for Expert PHP books really. maybe start here: ustream.tv/recorded/22783515 ...

 
11:09 AM
@Paul rofl. yeah
 
There is definitely something fishy going on.
 
@Paul fixed
 
@Gordon me :)
 
mornings
 
good mornings.
 
hello
I have a quick question
I am trying to setup php on a YAWS
I tried both on Win and OSX and still nothing done
has someone had the chance to try it out?
no one? :(
 
11:56 AM
I don't even know what YAWS is
 
Interesting, sO4F9# was cracked before paSSw0rd was... I wasn't expecting that...
 
@ircmaxell what are you running?
 
john the ripper
 
YAWS is Yet Another Web Server
quite handy ws when it comes to erlang
by default it doesn't support PHP but by adding references to it
it should work
 
12:06 PM
hakre & @hakra, Congratulations on your new daughter hakra. I imagine that you aren't related?
 
12:49 PM
Good afternoon
Hey @Paul you dont post on Code Review anymore?
I like your a lot of answers there.
 
user1125394
@ircmaxell is ophcrack also good for this?
 
this isn't using rainbow tables, but dictionary attacks and brute forcing
so it's useful against salted passwords
 
I like IGHASHGPU
very fast.
Have you tried that @ircmaxell
 
I don't have a GPU available
 
Oh ok, well it crack my name (md5) in 1 second
 
1:02 PM
but if I did, I would use OCLHashCat
 
6 letters
Hmm that look good
 
user1125394
there is no way I guess to recompute a rainbow table fastly with a prepend salt?
 
@I'll-Be-Back Thanks, I had a break for a while after I reached the php tag bronze badge. I'm just starting to get back into posting a few reviews (albeit at a slower rate).
 
@Paul Cool - check out my latest question if you can codereview.stackexchange.com/questions/16018/…
 
what 6 letters?
@cyril you can, but that's wasteful. Just check the hashes as you're computing it...
 
1:09 PM
@ircmaxell my name 6 letters.
cracked in 1 second
 
which 6...
 
using md5
@ircmaxell I've hashed my name to MD5. IGHASHGPU managed to crack it in a second.
 
give me the hash
 
f3224d90c778d5e456b49c75f85dd668
 
@I'll-Be-Back Ok, I'll have a look tomorrow.
 
1:13 PM
Cool @Paul
 
./john ../../test/illbebackpass.pass
Loaded 1 password hash ( md5_gen(0): md5($p)  (raw-md5)  [SSE2 10x4x3 (intr)])
shahid           (illbeback)
guesses: 1  time: 0:00:00:04 (3)  c/s: 17534K  trying: sax6nn - shahif
 
user1125394
hey shahif
 
4 seconds on a CPU...
 
Cool
@ircmaxell try writing in PHP and see how long it will take hah
 
$ ./john --pot=new.pot ../../test/md5_no_salt.pass
Loaded 4 password hashes with no different salts ( md5_gen(0): md5($p)  (raw-md5)  [SSE2 10x4x3 (intr)])
foobar           (test0)
foo              (test1)
fo0              (test2)
3d$              (test3)
guesses: 4  time: 0:00:00:03 (3)  c/s: 18343K  trying: 2c$ - 3CN
$ ./john --pot=new.pot ../../test/salted_md5_unique_salt.pass
Loaded 4 password hashes with 4 different salts ( md5_gen(1): md5($p.$s)  (joomla)  [SSE2 10x4x3 (intr)])
foobar           (test0)
Once I bcrypt on minimum settings finishes, I'll post it (it'll be a while)
 
1:20 PM
what CPU do you have?
 
user1125394
GPU are anyway perfect to do this stupid things
 
user1125394
learned a little of CUDA last year but don't remember
 
i7 2.4ghz
@cyril Nope. cracking bcrypt is actually more efficient on a CPU than a GPU
bbl
 
Try to get this working :)
$values = function (DOMElement $table) {
    $result = $table->ownerDocument->xpath('./tbody/tr', $table);
    var_dump($result);
};
just a little quiz. DomDocument::$ownerDocument is write protected.
 
ownerDocument->documentElement? not that i have a real clue what you are doing there or why
 
1:34 PM
Take the following extend from DomDocument for example, it is (next to some load error helping) adding an xpath function:
class MyDocument extends DOMDocument
{
    public function loadHTMLFile($filename, $options = NULL) {
        $errors = libxml_use_internal_errors(true);
        $result = parent::loadHTMLFile($filename);
        libxml_use_internal_errors($errors);
        return $result;
    }

    public function xpath($expression, \DomNode $contextnode = null) {
        $xp     = new DOMXPath($this);
        $result = $xp->query($expression, $contextnode);
        return $result;
    }
}
If you now run an xpath query that returns a list of DomElements those have the ownerDocument property.
However, that one does not have the xpath function as the document object.
 
Oh that part :) I assumed to tacked on the xpath funtion there. Yeah it's not all that easy to extend DOM properly.
For inspiration take a look at theseer/fdom. That one extends all the Dom objects and makes that work
 
Well, I did not need to extend all DOM objects for that.
Quiz is: make this work by changing or adding a single line of code: codepad.viper-7.com/RnysA0
@edorian Yes, my fault, DomElement::$ownerDocument that is.
okay, finally I have a clue why this works.
Here is the solution btw: codepad.viper-7.com/UJT6YF - if you keep a variable pointing to $this the owner document will be preserved.
$this->keep = $this;
 
user1125394
1:49 PM
php is hacky
 
@hakra The codepads are not loading for me. Sorry. (I'm on 56kbit/s atm, irc, github and chat work finshish but some sites have issues ;) )
 
user1125394
@hakra weird not working on eval.in/1243
 
user1125394
Forbidden access to file `de.php.net/manual/en/function.date.php';
 

« first day (715 days earlier)      last day (4224 days later) »