php

=?ISO-8859-1 in mail subject

I'm acquiring the unread mails I have in my GMail account through PHP and its method *imap_open* When I get the subjects through the method *imap_fetch_overview* I get some subjects like this: =?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?= It's unreadable, I think because of...

Use of anonymous function shows up as unknown type

When I attempt to use an anonymous function in PHP (As an available callback), there are no syntactical errors or the like but when I attempt to execute the callback, it errors out outputting that the function must be named. gettype returns a null value. Anyone have any experience with this? http://pastie.org/1088386 ...

How to insert incoming e-mail message into mySQL database ?

Just to say... I have no idea how would I do this :). In other words, the thing is: You get a mail message from some guy [email protected], you make a reply with your own content, and [email protected] have your reply stored in his database. Additional: I use shared hosting, I code in PHP, I understand ASP. If you have an idea how to write...

Decoding gzip (using PHP sockets)

Ok, so there is this PHP implementation of Last.FM API some guy wrote and I'm using it for a small project of mine. His implementation doesn't request gzipped data from Last.FM servers so I decided to modify his implementation to work with gzip to reduce bandwidth. I have no problem in requesting gzipped data, that works just fine and al...

PHP - Merge and group array data

How to group this: Array( [0] => Array( [brand] => 'ABC', [model] => 'xyz', [size] => 13 ) [1] => Array( [brand] => 'QWE', [model] => 'poi', [size] => 23 ) [2] => Array( [brand] => '...

[PHP-MySql] Can SQL tell me how many row(s) were updated?

I would use only a single query: $sql = "UPDATE gallery SET order = (order+1) WHERE id_categ = ".$id; $res = mysql_query($sql); ... Is it possible? ...

PHP: Echoing double "

How can i echo " i mean if i want to show: "Patrik", i would do: <?php echo " "Patrik" "; ?> but as you know you cant do this ...

why strotime returns negative value in php?

Hi, I am using strtotime to convert a date to a unixtime stamp. Year, date and day comes as different values to code and I am using the below code to produce the timestamp. $year = '1961'; $month = '2'; $day = '15'; $date = $year."-".$month."-".$day; echo strtotime($date); The above code prints : -27648000 for me. If the year ...

How to remove the modifier from accesskey

Is there a way to account for all known OS/Browser combinations and have a single accesskey input for a link tag, without the modifier? As noted in Wikipedia (http://en.wikipedia.org/wiki/Access_key) I can have accesskey="d" and I know some users will input Alt+d some Alt+Shift+d. Is there a way around this? How can I allow a user to...

Highlight active link.

How can I have the active link highlighted when clicked but keep the home page link highlighted until another link is clicked? I'm using PHP if that helps. Here is my (x)HTML code. <div id="nav"> <ul> <li><a href="http://localhost/link-1/" class="active">Link 1</a></li> <li><a href="http://localhost/link-2/"&gt;Lin...

How do i go about removing 51365 from a string?

Hey All, Just wondering if you can help me out with something. I have a string with a series of numbers like 58498, 53980, 84578. Always 5 numbers in the series. Whats the best way to go about removing these? ...

PHP Regular Expression to get IP address from /etc/hosts

I'm writing a PHP script that autoconfigures a device over Telnet, and I need to grab some IP addresses from /etc/hosts I need it to grab the IP address only, and assign it to a variable based on the hosts name. Example: 192.168.1.50 machine 192.168.1.51 printer 192.168.1.52 sigpad The PHP script should be like this: $machineip = "1...

Magento search result to my way

Hi, i've been triyng to change the default result page of magento, i want the products grouped by categories, it don't include the subcategories but the products, the search criteria is the product name, so, i was triyng to use the defalt simple search of magento, untill now no result, maybe i have to override the search and make a new o...

500 Internal Server Error for addtype in htaccess

In reference to the accepted answer in http://stackoverflow.com/questions/3464141/php-website-to-aspx-net-website. Creating a new post since that post was over-loaded with comments. .htaccess file AddType application/x-httpd-php .aspx AllowOverride AuthConfig in apache config file. trying to parse php in the aspx page. index.html / ...

Mysterious text truncation error/bug in PHP results in ...cut...

I am experiencing a maddening issue with PHP that I can't seem to resolve. In some cases when a form is posted with a text area or text field and I am also using multi-dimensional arrays for the form field ids (e.g. name="blah[id][5]") the text that was posted in the text area or text field gets mysteriously truncated by PHP at 256 chara...

How do I integrate ASP.NET Membership in PHP sites?

I am looking to use an open source CMS/blog site like WordPress or Drupal. I need it to work with the ASP.NET Membership I already have running my current website and community site. I am assuming I need to muck with (hand write) some cookies to pass back and forth. So how would/have you done it? I am looking for creative ideas on how ...

Magento Column not found: Unknown column 'order_created_at' when accessing Sales Shipment API

Will appreciate any ideas on this error in Magento 1.4.1.1. I wonder why this happens but Magento 1.4.0 and Magento 1.3.2.4 works fine. The error is caused by accessing Magento Sales Shipment List API with "order_created_at filter. This filter worked in previous versions but with this version it fails. I wonder why this could happen. ...

how to obtain all subclasses of a class in php

Is it possible to get all subclasses of given class in php? ...

How to get only from string using javascript or PHP?

I have a problem to extract only 'a-zA-Z0-9- _' from string. Example; If i input "A cat นกห 004-1 กกกกก" it show me only 'a-cat-004-1' or if i input "aa مقتطف 4-5 aaa" --> 'aa-5-4-aaa' any idea? ...

Reading emails?

Hi everybody, I have thought some time about creating a PHP-based customer-service thingy that assigns different types of customer-related stuff to a ticket-id (#). For starters, I would like to be able read emails from an email account and assign a ticket-id to every new email that's received. I have no bloody idea of how I could ma...