php

Search with PHP for calendar dates within a MySQL array?

I'm building a calendar and I'm really dumb when it comes to arrays. First of all, I need to query my database, so: $events = mysql_query ("SELECT id,title,date WHERE date BETWEEN 2009-01-01 AND 2009-01-31") or die(mysql_error()); So, now I need to order those events so, when I'm echoing my calendar table, I can check this array for ...

search engine (solr/sphinx) question

i want to make my threads content searchable with full text search engines like solr. but i wonder one thing. should i index just the thread.title, thread.body and post.body or should i index username, created date, nr of posts, views, country, region and city too that belongs to thread? i mean when an user search for a thread he will ...

Webservice Wants Byte[] - How do I send that from PHP?

I've got a webservice written in c#, which accepts as a parameter an array of bytes (byte[]). I'm trying to consume the service using PHP, but am having problems getting the parameter to the correct type expected by the webservice. Anyone know how this is accomplished? ...

Regular Expression to fetch vertical offset from CSS

I have been fiddling with this for almost an hour and am getting nowhere. Regexes are not my strong suit. I have data like the following: .cke_button_about .cke_icon { background-position: 0 -76px; } .cke_button_maximize .cke_icon { background-position: 0 -108px; } I need to replace the vertical values (-76px and -108px) using preg_r...

Getting parameter names from SOAP request with PHP SOAP extension?

Given that the following client.php creates this request XML: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.dev/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas....

php vs htm, weird gaps

the normal one: http://labvc.x10hosting.com/AT/site/home.htm VS the odd one: http://labvc.x10hosting.com/AT/site/home.php when i look at the code side by side, its almost identical, the only thing that would make them give that weird gap should be the CSS but they're using the same sheet. ideas? EDIT: I checked and made ...

Zend Framework app as a web service

I'm developing a zend framework app that's just going to act as a web service. I have no need to ever output HTML at any point in the application and don't even want the overhead of creating empty view files. I want my app to output XML by default, JSON if requested (via the format parameter would be fine). Is there any way to do this ...

Can't get Xdebug to work on Windows 7

I installed the latest XAMPP package which includes PHP 5.3.0. I am trying to enable Xdebug, but it just won't work. Here's what I changed in the php.ini shipped with XAMPP: ; uncommented zend_extension = "X:\xampp\php\ext\php_xdebug.dll" ; added the following lines: xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote...

How to offer code for others to embed your content into their html pages?

Maybe the answer to this question is less complicated than I am making it... I have a Zend Framework PHP web application. I am going to create a simple API that will output a report for the user's account. The content will be as simple as this: <ul> <li>Item 1</li> <li>Item 2</li> </ul> I want to offer a code snippet that the...

What is the proper PHP function documentation format?

PHP documentation is one wild animal, even the underscore_vsCamelCase styling isn't this varied. So given all the types of PHP documentation I have seen so far - which is the standard? How are my functions and methods supposed to be marked up so that the majority of IDE's and documentation libraries can read them? In the below examples ...

In jQuery.post, how do I get value of variable outside function?

I have the following function: var id = "10"; var type = "Type A"; var img = "myimage.jpg"; jQuery.post("my/path/somefile.php", { instance: 'getUrl', ID : id, type: type}, function(data) { jQuery('#logo').attr("src",data.url + img); },"json"); How can I get the value of img when I'm inside the function? How can I sett img = new...

PHP dynamically populating an array

I have an array that lists folders in a directory. Until now, I've been hardcoding the folder names, but rather than do that, I thought I could easily create a script to parse the directory and just assign each folder name to the array. That way, I could easily add folders and not have to touch the script again... The subject array crea...

PHP Checkbox Array

All, When a form gets posted, I get some checkbox values like the below: [chk0] => Array ( [1] => on [57] => on [83] => on ) [chk1] => Array ( [69] => on [71] => on ) [chk1001] => on [chk1005] => on [chk1008] => on Using PHP,How can I construct a JSON request with 2 arrays like this by using the ab...

Displaying Scheduled Events

I had this problem some years ago and back then I implemented a "different logic" in order to deliver the project but the doubt remains in my mind and hopefully with your help I'll be able to understand it now. Suppose I have some scheduled events on my database that may or may not spawn over several days: id event start ...

Mediawiki + AJAX + IE = broken

Hi All, I have created an extension for mediawiki that works in all major browsers other than IE (any version it appears). The extension relies on mediawiki's ajax wrapper to send an xmlhttprequest with parameters that essentially build a database query to a php script. This script will run a query based on the parameters and then cre...

$(document).ready(function() isn't called

Hi all I've set document.ready in the middle of a page. It was working fine on local server, on an online production beta server, but failed on the final server. Any suggestions? thx Code: $(document).ready(function() { And yes. JQuery is loading and it's working propely ...

PHP voting code works on 5.2.5 but not on 5.2.11 anymore

Ok, so a little while back I had some help writing some PHP voting code, it worked just fine after I upgraded my server to use the latest version of PHP. However now I have switched servers, and the PHP isn't as up to date as the other one. Anyways here's my code: <?php if(!file_exists('vote/1u.txt')){ file_put_contents('vote/1u.txt', '...

PHP to consume webservice that needs xs:base64Binary

I've got a webservice which expects a parameter of type "xs:base64Binary" - this is a file to store in the database. I'm trying to consume the service using PHP 5's native webservice classes. I've tried a few things: // Get the posted file $file = file_get_contents($_FILES['Filedata']['tmp_name']); // Add the file, encoding it as a ba...

Tracking information over many pages for a website

Hey SO, I have a sort of vague question that you guys are perfect for answering. I've many times come across a point where I've had a form for my user to fill out where it consisted of many different pages. So far, I've been saving them in a session, but I'm a little worried about that practice since a session could expire and it seem...

Find/Replace using Carp

I use carp free 3.6.4 to display content from some wordpress rss feeds onto a web page but there are always encoding errors (I get the diamond question (U+DDDF) whenever a blog user uses curly quotes and also after all question marks that are followed by spaces). I went into carp.php looking for the output so I can do an str_replace('U+...