php

< and > are stripped out of the parse result when using PHP/libxml

Hello, (I'm using PHP 5.2.6 and phpinfo says it has libxml 2.6.32 loaded) I'm also using wordpress and whenever xml_parse() function is called I get &lt; and &gt; stripped out from the result, instead of being converted to "<" and ">". I found people talking this is a bug which hits newer versions of libxml but I have the old one and...

php, jquery, load function and page address

Hi, i have two files. In first (parent, address: www.myaddress.com/fun/test.php) is jQuery function: <script type="text/javascript"> $(function(){ $(document).ready(function() { import_f = setInterval(function() { $('#file').load('fun2.php?id='+ Math.random()); }, 5000); ...

Storing HTML5 Geolocation information in MySQL

Hi, I've been experimenting with a simple project that essentially just stores the number of visits to the sites, along with the latitude / longitude of the user (it's mainly for people visiting via the iPhones Safari browser). I've managed to store the 'clicks' to the page via PHP / MySQL, and I can display the users lat / long via th...

How to create PHP/JSP/ERB tags using XSLT?

I have a bunch of XML files which I use to generate HTML pages. Those pages ultimately get marked up (by hand) with some <%= %> tags and made into Ruby .erb templates. Is there a way to generate the special tags <?php ?> or <%= %> directly during the XSL transform? I've tried using a <![CDATA[ ... ]]> block, but then the output generat...

Each time I view a php page on localhost, it downloads the page

Hi, I have altered the httpd.conf file good to my knowledge by adding index.php in the directory index, LoadModule php5_module "d:/php/php5apache2_2.dll" AddType application/x-httpd-php .php PHPIniDir "d:/php" But any .php file I load, it downloads it. Any help would be appreciated. Thanks Jean ...

Wordpress 3 - Remove Links from Posts via functions.php

Is there a way that I can remove links in posts via my functions.php file. Basically I don't want anyone to be able to go outside of the blog posts that are viewed. I have hundreds of posts so I obviously can't go through all of them and remove them manually. Or could I use javascript? Thanks so much. Updated: The jQuery below is gre...

The server committed a protocol violation. Section=ResponseStatusLine" For PHP webservice

HI I am calling a web service in my C# Code. The webservice is bulit in PHP. I am calling its loadunload method. The webservice returns me the "The server committed a protocol violation. Section=ResponseStatusLine" error if I call the service with in 5 to 10 second delay. Here is the code I am using to call the service. private MyServ...

Convert string to uppercase in PHP but not html markup

Im a bit stumped on how to make a string uppercase in php while not making the markup uppercase. So for example: <p>Chicken &amp; <a href="/cheese">cheese</a></p> Will become <p>CHICKEN &amp; <a href="/cheese">CHEESE</a></p> Any advice appreciated, thanks! ...

How to build Exception Logger system in PHP that can have different Logger implementations e.g. File/DB and is testable

I'm building a PHP library that throws various custom Exceptions when it encounters errors. I need to log those exceptions and provide various implementations of the Logger so they could be logged in a file or a database. The exceptions need to be logged whether they are caught or not, so that excludes implementing any of this in a cust...

File uploads without $_FILES

Is it possible in PHP to configure it to somehow not save files to disk at all? As a matter of fact, the best thing would be to get the script going before even reading the entire POST body. (Keeping my hopes high ;)) ...

What is the "for" syntax in this code?

for(;;) { if(!$monitor->Throttle($cause)) die('Fatal error: '.$monitor->error); if($cause == THROTTLE_CAUSE_NONE) break; sleep(60); } i'm a beginner php developer. So how do you read the "for" syntax in previous code. is it valid ? i got them from http://www.phpclasses.org/blog/post/132-Accelera...

XMLRPC Not working on Localhost

Hey guys, I've been working on a Wordpress theme for a while now and all works fine when it's on my server, but when I load it up on my machine locally I am unable to utilise certain functionality, namely the ability to post from outside the admin panel. To do this I use XMLRPC and the following code - $params = array(0,$username,$passw...

Controllers in two level subdirectory

Is there any hack to provide two level sub directory controllers support ? ...

Continous integration tool for symfony project

I have to set up continous integration for php. My CI server should be able to build the project, run the unit tests and create a report with the result. What would be the best continuos integration tool for a symfony project? I can't decide between phpUnderControl + CruiseCotrol, Xinc, or Hudson. ...

redirecting users if server is overcrowded or busy using php?

is it possible to use php to redirect users to page i.e. busy.php when the server is busy or overcrowded, or something similiar? thanks :)) ...

HTTP header response data

I want to calculate the size in bytes of the http response headers and data in PHP. Any help would be appreciated ...

Serving images directly from server with getting path from PHP script.

Hello everyone, as most of you probably know, we can serve images from PHP using constructs like this: RewriteRule ^images/([a-zA-Z0-9]+)\.jpg script.php?image=$1 And then in PHP: header('Content-Type: image/png'); $image=imagecreatefromjpeg($pathComputedSomewhereElse); imagejpeg($image); That's dead simple, but that's not my prob...

upload file using php copy command

I have one public website where users have option to upload pdf file and read that pdf when they need. I use php command $error = copy($tmp_name, $fpath); to save file to server.... the issue I am facing is any one can upload any type (.exe, bat) of file but I only need pdf? when try to browse pdf file, if some one change its (.e...

Getting the actual (absolute) execution time of the last query in PHP (excluding network latency etc)

I want to get the actual Mysql query execution times while they run in my project so running PHP microtime() before and after and subtracting won't work. When we run a query in command line, the result displays the timing information something like this:- xxx rows affected in YY sec How to get the same time information using PHP. I s...

need quick help with regex issue in php

Hello, What's a quick way for matching the following in a multiline string using preg_match? id=334534534 id= is constant, the digits are what I need to extract. ...