php

POST to different page depending on SELECTvalue?

I have a form, depending on the selected value of my <select> box I would like to send to a different page. I do not know the best way to do this, but I am thinking that maybe the best way is to have an intermediate page to always post to, then have the intermediate page check the value sent from the <select> box and forward the POST va...

How to extract Heading tags in PHP from string

Hello everyone, From a string that contains a lot of HTMl, how can I extract all the text from <h1><h2>etc tags into a new variable. Possibly using preg_match_all and sending the matches to a single comma delimited variable. Thanks guys. ...

Is relying on $_SERVER['HTTP_ACCEPT_LANG'] ok for multilingual support?

Is there any pitfalls or downsides to relying on $_SERVER['HTTP_ACCEPT_LANG'] for language detection? ...

What is being encrypted when I use a salted CRYPT_MD5 to encrypt my password?

Using md5 on a string always produces an alpha-numeric encrypted result, ie: no symbols. However, when I using the php crypt() function, specifically the CRYPT_MD5 (and it is on, I've checked) with a salt, the supposed md5 hash it returns does not look like an md5 hash. For example: if I md5 the string 'password', I get: $pass = md5(...

SMTP e-mail RECALL from PHP

Hi, First of all I am aware that e-mail recall rarely works, and then usually only with Microsoft Exchange server. Despite the limitations, a client has requested this feature. My understanding is that the RECALL functionality in Microsoft Exchange is a proprietary extension of the SMTP protocol, and sends a new e-mail asking for a ...

Internet Explorer caching issue

Hi, I have a website that offers a service to subscribed members. It has been reported to me that one of the pages that has a form used to submit data to a mysql database has not been displaying saved changes. The form should display back data that has been stored in the database. (After the page has been submitted) I thought this was...

AJAX return data before execution has finished

Hi, I have a page that I am performing an AJAX request on. The purpose of the page is to return the headers of an e-mail, which I have working fine. The problem is that this is called for each e-mail in a mailbox. Which means it will be called once per mail in the box. The reason this is a problem is because the execution time of th...

Minify / Obfuscate PHP Code

Hi, I use haXe to generate php code. (This means you write you code in the haXe language and get a bunch of php files after compiling.) Today a customer told me that he needs a new feature on a old project made with haXe. He also told me that he altered some small things on the code for his own needs. Now I first have port his changes t...

Cookie being destroyed when browser quits

hello, I am currently playing around with cookies in my website, the first thing I do is run a check as to whether the user has cookie, if they dont I display a menu wth 3 options if they click it creates a cookie, but if then quit the browser the cookie is destroyed, here is my code, function createRandomId() { $chars = "abcdefg...

How can I divide a Perl array into smaller arrays?

Is there any Perl equivalent for php's array_chunk()? I'm trying to divide a large array into several smaller ones. Thanks in advance. ...

Google Apps Account Form won't pre-populate URL query string in iframe

I can not get pre-population to work on an embedded form... If I use the regular url... it works... https://spreadsheets.google.com/a/DOMAIN.org/viewform?hl=en&amp;formkey=12345&amp;entry_3=John&amp;entry_4=Doe but for a google apps account on an embedded form - does not work Loading... Form appears in the webpage, but the additiona...

shouldn't PHP array recursion throw an error?

This is the test and the response I get. I think this could be problematic and should throw an error or a notice but I cannot understand why is tolerated. <?php $test = array( 0 => 'test', 1=> &$test ); var_dump( $test ); // array(2) { [0]=> string(4) "test" [1]=> &array(2) { [0]=> string(4) "test" [1]=> &array(2) { [0]=> s...

Array in Object passed by value?

Maybe I am overlooking something, but I stumbled across this: $employees = new stdClass(); $employee_id = 5; $employee = array(); $employee["id"] = $employee_id; $employee["name"] = "John; $employees->$employee_id = $employee; Now I want to change the employee Name: $employee = $employees->$employee_id; $employee["name"] = "Tom"; ...

PHP Loop Question

Hello, echo "<table><tr>"; while (list ($key, $val) = each ($users)) { echo "<td>$val</td></tr>\n\n"; } echo "</tr><tr>"; while (list ($key2, $val2) = each ($enable)) { echo "<td>$val2</td></tr>\n\n"; } echo "</tr></table>"; I want to format this into table with side by side where should be $val $val2 Currently its in $val $val...

using mysql_close()

is it necessary to use mysql_close() at the end of a query in PHP? ...

PHP what happens when a string is double times mysqli_real_escape_string

I'm using mysqli. When I echo mysqli_real_escape_string($db,mysqli_real_escape_string($db,'"')); which one of those will be the output: 1. \" 2. \\\" ? Is there a safe way to check whether a string has been already escaped? Unfortunately, I cannot test at present as I cannot access MySQL for 24 hours. ...

Simple XML HELP !!!!

Hi , I need some help , All I need to do is change "HERE" to a the value of $date $line1 = $sxe->addChild("date","HERE"); How can I add the value of $date into the area were "HERE" is ? Please help ...

Flash MP3 player with javascript controls.

While the question may seem fairly basic I seem to be at a loss to actually find anything that fits my needs, which are: Skinnable (although not 100% required) Controllable through javascript (start, stop, change track) Event triggers for custom functions (on track finish mainly) Actual documentation - rather that 'it can do this, but ...

PHP: parse JSON from jQuery

I'm trying to parse a simple JSON string, but I'm not used to do it from PHP. To do my testo I've wrote a js page where the data is created, sent to php page and returned back to do some test. how can I access to json data from PHP and return them back? the string from jQuery: var json_str = '{"id_list":[{"id":"2","checked":"true"},{"...

Rows & cols SUM

Hello, i have a really complex query (mysql + php) and i would like to know the easiest way to sum columns and rows of a table apart from using SUM(x). Maybe a javascript could help. Thanks in advance. ...