php

How can I reproduce a SHA512 hash in C# that fits the PHP SHA512?

Hello :) The question is pretty much self-explanatory. I Googled many sites, many methods, tried many encodings, but I can't get it to match. I'm trying to make the string "asdasd" match. (http://www.fileformat.info/tool/hash.htm?text=asdasd) ...

EDI X.12 PHP Mapping - resources needed.

Hey everyone, Is there any php libraries or API's that help when dealing with X12 documents in php? Googling around doesn't help much, so looking for people with experience in this field. ...

Why would you merge $_GET and $_POST in PHP?

I just saw this code while studying the wordpress source code (PHP), You can see they mergre/turn all get and post values into 1 request array. Now as I know it, $_GET and $_POST are already available by calling $_REQUEST WITHOUT using the array_merge() function, so any ideas why they would do this? $_REQUEST = array_merge($_GET, $...

Insert once, but two records created in MySQL

for($i = 1 ; $i <= 3; $i++) { if(!empty($_POST['fl' . $i])) { $dml = "insert into flAptitude(accountId,language,qualification,certificate) value($accountId,'" . $_POST['fl' . $i] . "','" . $_POST['qualification' . $i] . "','" . $_POST['certificate' . $i] . "')"; mysql_query($dml,$con); file_put_contents("fl$i.txt",...

Fancy Upload without file browser

Is there a way to pass a list of files to fancy upload via java script rather then using the browse button and dialog? http://digitarald.de/project/fancyupload/#docs Thanks in advance. ...

innerHTML and PHP

I want to do some innerHTML replacements, but using PHP includes, I dont get how. I have done innerHTML replacements before, just not with PHP. I have: var xmlHttp function DisplayAerialProductListing() { var strStartCode="<p></p>"; document.getElementById("txtData").innerHTML= strStartCode; var code=""; code = code...

Why does comparison and empty() behave like this in PHP?

PHP: $a = "0"; $b = "00"; var_dump(empty($a)); # True (wtf?) var_dump($a == $b); # True... WTF??? var_dump(empty($b)); # False WWWTTTFFFF!!?? I've read the docs. But the docs don't give explanation as to why they designed it this way. I'm not looking for workarounds (I already know them), I'm looking for an explanation. Why is it lik...

Is it possible to convert a PHP function's parameter list to an array?

Suppose I have a function: function my_function($a, $b, $c) { ... } I want to be able to play with my parameter list as if it were an array - as with here, using a fake $parameter_list variable: function my_function($a, $b, $c) { foreach ($parameter_list as $value) { print $value."\n"; } ... } How can I do t...

jQuery not working in AJAX Loaded page

I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).Its a simple HTML document with a few buttons and associated animations upon clicking them (also using jQuery).The .click() properties associated are working fine when I load the page directly but the buttons fail to respond when I click them in the AJAX loaded ver...

Which PHP framework is most similar to Ruby on Rails?

I've been working a lot with Ruby on Rails in the past several months, and am loving it. Recently however, I've come into some work that requires PHP, and would like to retain a lot of the nice baked in features that Rails provides, such as: Restful Routes Easy Model Validation Good Application Layout Helpers and Observers Are there...

How can I convert a PHP function's parameter list to an associative array?

I want to convert the arguments to a function into an associative array with keys equal to the parameter variable names, and values equal to the parameter values. PHP: function my_function($a, $b, $c) { // <--- magic goes here to create the $params array var_dump($params['a'] === $a); // Should result in bool(true) var_d...

Finding Array length incakephp

Hi, In my cakePHP controller there is an action named saveReport() where $attribute_ids is an array holding all the selected attributes obtained from the Ajax post.. function saveReport() { echo $this->params['form']['formid']; echo $this->params['form']['reportTitle']; echo $this->params['form']['attr']; $attribute_ids...

What is a good approach on dealing with repetitive and lengthy validation codes?

I have only recently started web programming and I am pretty much amazed that although I am using a validation library, I still get 20-30 lines of code for validation alone, not counting error messages and callback functions. I am using the Kohana MVC framework and I was wondering if there was any way I can shorten my validation codes. I...

how can i make php alert pop ups just like in javascript.

i need a pop up window which asks me before proceeding to next like alert in javascript. Is any built in facility in PHP like that. ...

PHP,the wrong result when use mycrypt_cfb function.

here's the encrypt and decrypt function: function encrypt($key, $plain_text) { $plain_text = trim($plain_text); $iv = substr(md5($key), 0,mcrypt_get_iv_size (MCRYPT_CAST_256,MCRYPT_MODE_CFB)); $c_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $plain_text, MCRYPT_ENCRYPT, $iv); return trim(chop(base64_encode($c_t))); } funct...

PHP: How can I detect "@" in front of a call in my custom error handler?

I have a custom error handler attached to E_ALL PHP errors. In an external lib the call $row = @mysql_fetch_assoc($this->result); triggers PHP Warnings caught by my handler. Why? Shouldn't '@' make PHP ignore this? My question: Is there any way I can detect (in my error handler) that '@' was used? ...

How to integrate the simple openid with my site's existing logging system?

Can anyone post simple step by step integration for openid into a site which has a login system already.??? I decided to use php openid 2.1.3 but could get where to start and what to do... ...

Is __autoload() called for parent classes of autoloaded classes?

In the main.php, autoload is added and a new object is created. function __autoload ($class) { require_once($class . '.php'); } ... $t = new Triangle($side1, $side2, $side3); Then in Triangle.php, Triangle extends Shape as following. class Triangle extends Shape { ... So there is another class in Shape.php which is abstract cla...

what does this php error mean?

Warning: file_get_contents(http://localhost/sample_pie.php) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\EXACT\report.php on lin...

php - mac address

I want to get the MAC and IP address of the connected client using php. ...