php

Php : How to add odd/even loop to my unordered list

Here an example my wordpress post. I want to add some class to the last of <li> something like <li class='lastli'> <ul class="tabs"> <?php global $post; $myposts = get_posts('numberposts=3'); foreach($myposts as $post) : setup_postdata($post); ?> <li><a href="#"><?php the_title(); ?></a></li> <?php endforeach; ?> ...

What is the best platform for Collaborative Blogging?

Hi guys, I have a project where the requirement is to have an "open blog" -- anyone can blog and administrators will approve & publish blog entries. I was just wondering if anyone had recommendations for a good platform to do this? I'm looking at Posterous, I like the ease of posting via email and the fact that anonymous bloggers don'...

Best methodology for PHP+APACHE+MYSQL Development

Hi! I want to start learning PHP. I have had a look at the various options available to install the PHP+MySQL+Apache combination. But it all seems too cumbersome and a lot of editing to the CONF files always leads to one problem or the other. So I had a couple of questions to ask: 1) How will something like WAMP help me? If I instal...

'Hotfixing' MVC-based functionality

I have an existing web application based on rudimentary file-by-file PHP. You know the type. I need to modify some of the application's functionality substantially, and it's a modification that would benefit greatly from using modules for new functionality. Problem is, I've never tired to work in an MVC style environment on top of a non-...

How import contact from yahoo/gmail/hotmail using php script

How can we import contact from yahoo/gmail/hotmail using php script and or using curl. Thanks ...

php,codeigniter

how can we done two pagination in one page using codiegniter ? pls help me ...

How can I force PHP to use strings for array keys?

I've come across an old app that uses an id to name type array, for example... array(1) { [280]=> string(3) "abc" } Now I need to reorder these, and a var_dump() would make it appear that that isn't going to happen whilst the keys are integers. If I add an a to every index, var_dump() will show double quotes around the key, my gu...

Codeigniter white screen of death on models

If there is an error in my model codeigniter will just show a blank page. I have error reporting set to E_ALL and DB debugging turned on. Is there any way I can get the errors to show up? ...

How to have cakephp Deliver content on different subdomain ?

I am building a portal which will have different cities content.. When someone comes to the website i want them to choose the city and then proceed to http://city1.site.com or http://city2.site.com can this be done using a single database and installation of cakephp ? ...

jQuery AJAX - Return dynamic content

Hello, I am making a jQuery Ajax form submit to a PHP page that I want to return values dynamically instead of all at once. For example, if my jQuery code is: jQuery.ajax({ type: "POST", url: "$PathToActions/Accounts.php", dataType: "html", data: "action=register&accounts=" + accounts, success: function(re...

How do I post JSON payloads to a web service using PHP?

Hi all, we are using a web service which receives JSON payloads and sends back JSON payloads as response. I know how to do it c#, but unfortunately it doesn't seem easy doing the same thing in PHP. here is our c# code, what is the equivalent piece of PHP code of this?? String str = "https://thewebservice.com"; str += "?...

which is better to get the contents of a web page

To get the contents of a web page which is better: 1) To use Curl 2) file_get_contents 3)Any thing better than the above two. Thanks for answers in advance ...

maintaining a count in foreach

$count=0; $numb=50; foreach ($sepkeys as $dbkey) { for ($page=10;$page<=$numb;$page=$page + 10) { // the if block $count=$count+1; } } I am trying to maintain a separate a count for each key number in the above code. Eg: key- 574, it searches from pages 10-50 and increments the count. The problem that I have is the cou...

Test site for examining POST data

Is there a test site that allows me to feed in a URL and data that I want to be POSTed to that URL? I am testing a form submission thru curl in php and it doesn't seem to be working. ...

Which wamp/lamp development environments have openSSL

I'm looking for a wamp/lamp development environment that supports OpenSSL out of the box so I can do things with https://. I'm not sure if OpenSSL is a feature of Apache or PHP, but I would rather not add that myself. If your development environment supports it, please add it here. ...

Difference between single quote and double quote string in php

Hi, I'm not a major in PHP programming but I'm a little confused why I see some codes in PHP with string placed in single quote and sometimes in double quote. I just know in .NET, or C language, if it is in single quote, that means it is a character, not a string. ...

How to remove "blank markup" with PHP - i.e. multiple nested elements with no text node.

I've installed CKeditor on a client's site that allows them to enter some text using a WYSIYG editor. It is locked down for the most part, only allowing bold, italic, unordered lists, etc. I also run the user submitted HTML through HTML purifier to make sure they don't get smart and start trying to add tables, for example. It is also a ...

Compare group of tags to find similarity/score with PHP/MySQL

My Question is, how do I compare a group of tags to another posts tags in my database to get related posts? To start off, I've searched the internet and stackoverflow to find out how to do this. My closest find was this post http://stackoverflow.com/questions/2153062/how-to-find-related-items-in-php. But it actually doesn't solve much f...

Interspire Template

In Interspire I copy a template & paste it then rename it & I customize it according to my theme but when i go into admin & in admin when i click on design mode then there should be site open for making changes but in my new template it is not open in proper way & I am not be able make changes in this mode please tell me why it is ...

Hosting a php application on a Windows Server system. Any issues / advice?

We've built a php application that we need to host on a Windows Server 64 bit platform (due to another software being present that we need to access). However, our php application has been built on a linux environment. Is there anything we need to be watchful of when running apache and this php application on a Windows environment? ...