php

JQuery/AJAX: Loading external DIVs using dynamic content

I need to create a page that will load divs from an external page using Jquery and AJAX. I have come across a few good tutorials, but they are all based on static content, my links and content are generated by PHP. The main tutorial I am basing my code on is from: http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/ T...

How to improve performance of MySQL query with frequent insert rate?

I'm having approx. 200K rows in a table tb_post, and every 5 minutes it has approx. 10 new inserts. I'm using following query to fetch the rows - SELECT tb_post.ID, tb_post.USER_ID, tb_post.TEXT, tb_post.RATING, tb_post.CREATED_AT, tb_user.ID, tb_user.NAME FROM tb_post, tb_user WHERE tb_post.USER_ID=tb_user.ID ORDER BY tb_po...

Is it possible to use authentication in RSS feeds using php?

I'm trying to develop a feed for an intranet document management system, so that staff can be notified of new documents. I have actually completed coding it, but there is no way to authenticate the user. Also I'm not successful in adding the feed to news readers, but works with firefox Live Bookmark. Any Ideas Update: Since I couldn'...

Merge post from two different wordpress to one post page ordering by date

With full access to both db , order last ten post from two different wordpress blogs, ordering by post date. In local way, not using foreign services (with sql and php for example) ...

php script can't send headers because headers have already been sent, but are characters outside the script

This are my first two lines: <?php header('Content-Type: application/x-javascript'); And it gives me the headers already sent in line 1. It is intended to generate a JavaScript file that loads from an HTML page, when checked the JavaScript file from Firebug i got the following file: 1 <br /> 2 <b>Warning</b>: Cannot modify head...

PHP PDO: Can I bind an array to an IN() condition?

I'm curious to know if it's possible to bind an array of values to a placeholder using PDO. The use case here is attempting to pass an array of values for use with an IN() condition. I'm not very good at explaining, so here's some psuedocode to demonstrate... I'd like to be able to do something like this: <?php $ids=array(1,2,3,7,8,9);...

Uncaught SoapFault exception: [HTTP] Error Fetching http headers

Hi, I'm trying to create a soap connection to Magento's web services, however I'm getting an error when I try and create an instance of the soap client class. I can view the wsdl file in firefox without problems and I can watch php make the request for the wsdl in apaches logs but it still fails. Nusoap can connect. $proxy = new Soa...

Session problem during refresh.

When i refresh my flex application, the page does not hold its state and gets back to login page. I am not sure why this occurs, Here is my peiece of code handling session. public function doLogin($username,$password) { include("connection.php"); session_start(); session_register("session"); $query = "SELECT * ...

Open source PHP reporting tool

Hi All I am developing web based application, i need php reporting lib/class to make the job easy. I need PDF/Excel format. The report based on related db tables(member bills, member info) Is there any advanced open source solution ? Thanks ...

PHPXMLRPC Blog post to Drupal with metaWeblog.newPost: Wrong number of method parameters

I'm trying to post a simple text string to my drupal site. It needs to be done with metaWeblog.newPost because with blogger.newPost sets all the text as title. I've already tried that one. I've got this thus far: require_once('xmlrpc-v1.174.inc'); $appkey = "0001000"; $blogid = "blog"; $username = "xxxx"; $password = "xx...

Proper use of quotes for output of JavaScript in a variable

I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query("SELECT * FROM posts WHERE userid = '$user_id' ORDER BY DATE desc LIMIT 5")or die (mysql_error()); while ($row = mysql_fetch_array($result)) { $source = $row[source]; $source = "'$source'"; $p = $p.'<div id="red-div"><div id="smartass"><di...

echo include in php?

hi, I need to echo an include from my php function. I have tried the below but neither work? Does php support this within a function? echo "<?php include ('http://www.mysite.com/script.php'); ?>"; echo "include (\"http://www.mysite.com/script.php\");"; Thanks ...

How to Fix 'No Suitable Nodes' Error?

I have a site with an image uploader, and whenever a user tries to upload an image, they are getting this error message: "No suitable nodes are available to serve your request." I've contacted the hosting company(mosso) and they have said that it is nothing on their end. Any idea what causes this issue, and what I can do to fix it? ...

Generate random player strengths in a pyramid structure (PHP)

Hello! For an online game (MMORPG) I want to create characters (players) with random strength values. The stronger the characters are, the less should exist of this sort. Example: 12,000 strength 1 players 10,500 strength 2 players 8,500 strength 3 players 6,000 strength 4 players 3,000 strength 5 players Actually, I need floating,...

How to install ImageMagick on MAMP?

I'm running OSX Leopard with MAMP (a sandbox consisting of Apache/MySQL/PHP). I installed ImageMagick using MacPorts by following this tutorial: http://www.brybot.ca/archives/getting-imagemagick-and-more-to-work-with-mamp-on-os-x/ Then I added extension=imagick.so to the php.ini But PHP won't recognize it. It keeps telling me: Fatal e...

Zend Framework won't let me include Google Maps API

Hi! I'm experiencing this problem: I want to add the Google Maps API to my Zend Framework application using the HeadScript Helper in the bootstrap: $view->headScript() ->appendFile('/static/js/jquery-1.3.2.min.js') ->appendFile('/static/js/jquery-ui-1.7.1.min.js') ->appendFile("http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;...

How to modify an attribute of a Zend_Form_Element in a Decorator

Is it possible to alter an html attribute of a Zend_Form_Element in a Decorator previously added ? Lets say I have a decorator named RichTextArea. When I add it to a Zend_Form_Element_Textarea, I want the decorator to add the class "rich" to the textarea. The final output should look like this : <textarea name="content" id="content" c...

Easiest drop-in PHP authentication solution?

Forgive me if this has already been asked (and feel free to provide a reference and close this). The ultimate goal is to associate some data with each user (obviously) and display that data to users differently based on their roles. I have looked extensively for a simple, drop-in solution for authenticating users in PHP. I am not look...

Download part of HTML page as text (PHP)

So I have an 'export' application that arrives the user at an end page with a textarea with lots of text. Now the workflow is to copy and paste that text from the textarea into a file. The exported code is getting larger, and we want to encourage users to do this more often, so the copy/paste route is no longer desirable. (Not to mentio...

Advice on a Canadian SMS Gateway provider

Hey everyone, I am curious as how to how much trouble / money it would be for me to be able to accept incoming text messages to a number, which I would then pass to a server side application in PHP. I'd ultimately send SMS messages back out via email addresses. Does anyone know any good Canadian providers to accept incoming SMS message...