php

What is this XML Parse Error?

I am using the following script to generate a RSS feed for my site: <?php class RSS { public function RSS() { $root = $_SERVER['DOCUMENT_ROOT']; require_once ("../connect.php"); } public function GetFeed() { return $this->getDetails() . $this->getItems(); } private function dbCo...

Problem with character encoding on email sent via PHP?

Hi everybody, Having some trouble sending properly formatted HTML e-mail from a PHP script. I am running PHP 5.3.0 and Apache 2.2.11 on Windows XP Professional. The output looks like this: Agent Summary for Support on Tuesday April 20 2010=20 Ext. Name Time Volume 137 Agent Name 01:27:25 1 138 =09 00:00:00 0 139...

Using a Time Zone Conversion When Dynamically Generating Results

Hello, If I understand correctly, the code below converts $row["datesubmitted"] from one timezone to another. I would like to print the converted $row["datesubmitted"] dynamically in an HTML table. Is there a way that I can apply the conversion below for each row that is pulled from MySQL? I assume that I can't just plug $row["dt"]...

Hacking the WordPress Category Widget

The default WordPress categories widget does not allow excluding named categories. I've created a plugin which creates adds a Customized category widget to the "Available Widgets" listing which gives me some control over the items I want to exclude. Code is below... <?php /* Plugin Name: Custom Categories Widget Plugin URI: http://mys...

PHP extend a class method that is called from another class which extends it and calls the method with parent::method

I am trying to extend a class and override one of its methods. lets call that class A. My class, class B, is overiding a protected method. Class C extends class A and Class D extends class C. Inside of Class D, the method I am trying to overwrite is also extended here and that calls parent::mymethodimoverriding. That method does not exis...

C# Equivalent of Snoopy

Snoopy is a PHP class that provides the functionality of a web-browser. Is there anything that does the same in C#? I'm having lots of trouble with handling cookies, etc. ...

How do I find out the version of HTTP in a request using PHP and Apache

I need to determine whether an HTTP request was an HTTP/1.0 or an HTTP/1.1 request in my PHP script, which is running under Apache. Is there a way to query this information? ...

how to find and clean wordpress from script/s that changes your blog posts titles on Google and yahoo with embarrassing "Vigra text"?

one day after managing to defend against a massive DDoS attack now http://arabcrunch.com is hacked by someone who seems to change the posts title into Viagra ad on google search engine look how they damaged us: .google.com/search?hl=en&client=safari&rls=en&q=Viagra+Online+Pharmacy+-+Buy+Online+Viagra%2C+Cialis%2C+Levitra+wordpress+hack...

How to set up a PHP daemon ?

I will be writing my first daemon in php and I have a couple really basic questions that I need help with. What packages need to be installed on my linux server and Does anything in PHP need to be enabled? So far I have gotten this - http://pear.php.net/package/System_Daemon/download Where on server do I save my daemon files? I hav...

Task management algorithm in C#

Hi guys, i am looking for efficient task management fo C# what i mean by task management is executing pre-defined interval time of task. Example: task a needs to be run every 1 mins task b needs to be run every 3 mins task c needs to be run every 5 mins these tasks can be added and removed in arbitary time... And the task that i men...

How can I use jQuery for messing with a particular div, but not in the current document - in a variable, that contains HTML?

How can I use jQuery for messing with a particular div, but not in the current document - in a variable, that contains HTML? The point is that I want to show a preview of a page (a piece of it's content) in a modal window, when the link to this page is clicked. Well, onClick I load this whole HTML into a variable via JSON and then... ho...

Strange characters and encoding while using twitter API

I begun developing my own SIMPLE twitter client in my server (to bypass twitter.com blocking rule stablished by some dumbass at govt. office) Please check this image so you can see the accented characters converted into weird symbol: It is being developed with this class Twitter PHP class by Tijs Verkoyen This is my heading code, ...

Alternate way for string replace and array

Is there any way to replace titles faster then str_replace function? I've got a file that is 2000 lines of array changes. That hurts my webpage. ...

Why don't these two wordpress php blocks work out the same?

This first bit works: $my_id = 617; $post_id_7 = get_post($my_id); $title = $post_id_7->post_excerpt; echo $title; While this second bit doesn't: $post_id_7 = get_post(617); $title = $post_id_7->post_excerpt; echo $title;...

Can I extend the CI_Profiler class to display SESSION variables as well?

If so.... any idea how? ...

MySQL greatest value in row?

Hi! I'm using MySQL with PHP. This is like my table: (I'm using 3 values, but there are more) id | 1 | 2 | 3 ---+---+---+---- 1 | 3 |12 |-29 2 | 5 |8 |8 3 | 99|7 |NULL I need to get the greatest value's column name in a certain row. It should get: id | maxcol ---+------- 1 | 2 2 | 2 3 | 1 Are there any queries that wi...

Best practice -- Content Tracking Remote Data (cURL, file_get_contents, cron, et. al)?

I am attempting to build a script that will log data that changes every 1 second. The initial thought was "Just run a php file that does a cURL every second from cron" -- but I have a very strong feeling that this isn't the right way to go about it. Here are my specifications: There are currently 10 sites I need to gather data from and ...

zend_db and join

Hello, I am trying to understand how to use Zend_DB in my program but I have some problem. The class below (DatabaseService) work when I pass it a simple query. However, if I pass it it query with a join clause my page just hangs and not error is return. I cut and paste the qry in a query browesr and it is valid Any help would be gre...

Creating an element and insertBefore is not working...

Ok, I've been banging my head up against the wall on this and I have no clue why it isn't creating the element. Maybe something very small that I overlooked here. Basically, there is this Javascript code that is in a PHP document being outputted, like somewhere in the middle of when the page gets loaded, NOW, unfortunately it can't go ...

preg_replace: wildcards do not match umlaut-characters

i want to filter a String by using the \w wildcard, but unfortunately it does not cover umlauts. $i = "Die Höhe"; $x = preg_replace("/[^\w\s]/","",$i); echo $x; // "Die Hhe"; However, i can add all the characters to preg_replace, but this is not very elegant, since the list will become very long. ATM, i am preparing this only for ...