Hi I have followed a tutorial to create and event list in wordpress using post and Custom Fields view demo
here is my code:
<?php // Get today's date in the right format
$todaysDate = date('M d');
?>
<?php query_posts('showposts=5&category_name=events&meta_key=Date&meta_compare=>=&meta_value='.$todaysDate.'&orderby=meta_value=order...
The code below helps be to get the WHOLE XML and put it into an array. What I'm wondering is, what would be a good way to get the XML only from item 3 - 6 or any arbitrary range instead of the whole document.
$d = new DOMDocument();
$d->load('http://news.google.com/?output=rss');
foreach ($d->getElementsByTagName('item') as $t) {
$...
I am keeping a large amount of words in a database that I want to match up articles to. I was thinking that it would just be better to keep these words in an array and grab that array whenever needed instead of querying the database every time (since the words won't be changing that much).
Is there much performance difference in doing...
I'm trying to suggest a solution for a friend who owns an existing web shop. The current solution isn't cutting it.
The new solution needs to have a few things that look like they're enterprise-only if I go with Magento, and $12k a year for a store with maybe $20k in stock just doesn't work.
The site should have items, which have on...
shell_exec():
I'm doing a PHP site that uses a shell_exec() function like this:
$file = "upload/" . $_FILES["file"]["name"];
$output = shell_exec("leaf $file");
echo "<pre>$output</pre>";
Where leaf is a program that is located in the same directory of my script, but when I tried to run this script on the server, I just got nothing....
Basically I hate a satellite website that is including form.php from an entirely different server.
<?php
include("http://blah.com/form.php");
?>
The form.php on the other sessions loads classes and all kinds of other things and generates a form dynamically based on a ton of MySQL data. Unimportant. My issue is that when the form i...
Hey. Am new to the world of web programming and learning a bunch of fairly simple new pieces of tech, trying to piece them all together.
So, we have a simple client (currently iPhone, to move to J2ME soon) that's pulling down lists of data via PHP, which is talking to a MySQL db. I have a rudimentary user/login system so that data is ...
I need to convert
$text = 'We had <i>fun</i>. Look at <a href="http://example.com">this photo</a> of Joe';
[Edit] There could be multiple links in the text.
to
$text = 'We had fun. Look at this photo (http://example.com) of Joe';
All HTML tags are to be removed and the href value from <a> tags needs to be added like above.
W...
I install php 5 (more precisely 5.3.1) as apache module.
After this one of my application becomes randomly hang up on mysql_connect - sometimes works, sometimes no, sometimes reload of page helps.
How can this be fixed?
I use Windows Vista, Apache/2.2.14 (Win32) PHP/5.3.1 with php module, MySql 5.0.67-community-nt.
After a minute I o...
The site I'm working on needs to fetch the tweets from 150-300 people, store them locally, and then list them on the front page. The profiles sit in groups.
The pages will be showing
the last 20 tweets (or 21-40, etc) by date, group of profiles, single profile, search, or "subject" (which is sort of a different group.. I think..)
a ...
hey folks, this is a really simple question. I'd like symfony to dump everything on its mind to the browser. I deployed to production, and nothing's working. not the logs, not the views, nothing. I just get a blank page.
is it possible to just see all of the [php/symfony] errors, somehow?
...
I want to extend Nodes with the title of the parentnode so I can display a hierarchy link.
I have a solution that sometimes works:
function modulename_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
{
switch ($op)
{
case 'view':
loadParentTitle($node);
break;
}
}
function loadParentTitle(&$node)
{
...
How can I recursively find the total value of all children of an array that looks something like this?
[0] => Array
(
[value] => ? // 8590.25 + 200.5 + 22.4
[children] => Array
(
[0] => Array
(
[value] => ? // 8590.25 + 200.5
...
Here is scenario :
I have some web services (JAX-WS) that need to be secured.
Currently for authentication needs I providing addition SecurityWService that give authorized user some userid & sessionid that is need to be described in request to other services.
It would be more better to use some java security. We have many of them but c...
what is the best way to get parent array key with multidimensional arrays?
for example I have this array:
array(
[0] => array(0=> sample, 1=>picture, 2=>frame, 3=>google)
[1] => array(0=> iphone, 1=>orange, 2=>love, 3=>msn)
[2] => array(0=> joe, 1=>geee, 2=>panda, 3=>yahoo)
)
now I need to search for example google and ...
Hi.
Consider strip_tags() .
strip_tags("<b>TEXT</b>");
Output:
TEXT
But what if i want to nullify the effect of the tags but display them as well?
Output:
<b>TEXT</b>
Would i have to use preg_replace() ? Or is there a more elegant solution available?
Thanks :D
...
I have created a website about some beer brand and had to include age verification page. The verification script is written in PHP and uses sessions to store verification variable. The script works the way that no matter form which link you will try to enter the website it will take you to the verification page first. The verification is...
Hi ,
Trying to grab the params after ?. I need them to add to the Zend_Paginator.
ex: http://www.example.com/test/show?name=xxx&age=20&sex=m
Building a paginator for search results.
Is there any solution for that ?
$router = new Zend_Controller_Router_Route_Regex(
'test/show\?(.*)',
array(
...
I need to compress a string so it is shorter for a GET method form. Is there any way to compress a string and it will be decrypted later? That way...
?error=LOTS OF STUFFLOTS OF STUFFLOTS OF STUFFLOTS OF STUFFLOTS OF STUFF
is shorter in some sort of key
?error=somekey
so I can get back the result later. Not using MySQL preferably.
...
I need to find a certain key in a pdf file. As far as I know the only way to do that is to interpret a pdf as txt file. I want to do this in PHP without installing a addon/framework/etc.
Thanks
...