I use this to pull values from a custom field with several values:
<?php $mykey_values = get_post_custom_values('services');
foreach ( $mykey_values as $key => $value ) {
echo "<li> $value</li>";
} ?>
I want to sort the output according to the way I have set up the values in the key (alphabetically)
...
Hello all,
I am trying to figure out how services like snap shot are so fast in showing a preview of a site as a small thumbnail when you hover over a link?
I mean I can generate a thumbnail of a site and show it but it will take me 10 seconds or more but for services I have seen that provide this, its almost a second or two. How are t...
I'm running PHP 5.1.6 with a 64-bit platform, 7.5 GB memory. I have the memory_limit set to 4 gigs.
I'm zipped a large amount of files (output size ~= 2gb), so I need this memory available.
When zipping the largest of my files, those that approach the 2gb limit I've imposed, the script fails with:
Integer overflow in memory_limit che...
How do I add the character - within the preg_match?
preg_match('#^(\w+/){0,2}\w+\.\w+$#', $string)
But it must be before the last . within the string. I've tried just about everything I know here. I know that the - needs to be escaped. So I tried to escape it in various places, but it's not working :(
argggg
...
Query to find "All bars that sell three different beers at the same price?"
My Tables are
Sells(bar,beer,price) - bar - foreign Key..
Bars(name,addr) - name primary key.
I thought of something like this but that dosent seem to work ...
Select A.bar As bar , B.bar as bar
From Sells AS A, Sells AS B
Where A.bar = B.bar and A.b...
Under the structure tab, when EXPORTing a database using phpmyadmin there is a check box labeled:
Add DROP TABLE / VIEW / PROCEDURE / FUNCTION
What does this do?
...
$LDATE = '#' . $_REQUEST['LDateDay'] . '/' . $_REQUEST['LDateMonth'] . '/' . $_REQUEST['LDateYear'] . '#';
$RDATE = '#' . $_REQUEST['RDateDay'] . '/' . $_REQUEST['RDateMonth'] . '/' . $_REQUEST['RDateYear'] . '#';
include("../../sql.php");
$myconn2 = mysql_connect(/*removed*/, $username, $password);
mysql_select_db(/*...
Hello.
I'm trying to remove the 'index.php' from CI Urls.
I've tried many solutions, none of them worked. I've already set these variables in 'config.php':
$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
And my current .htaccess is:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST...
I'm trying to make a soap request and having difficulties.
Here is my php:
<?php
$option=array('trace'=>1);
$soapClient = new SoapClient('http://www.domain.com/ws/AccountManagement.wsdl', $option);
$headers = array('LOGIN_ID' => '[email protected]', 'LOGIN_PASSWORD' => 'mypassword');
$header = new SoapHeader('https://www.domain.com', '...
Hi all
I've inherited a Joomla 1.5 site and I am trying to find a Joomla component that will let me add a signup/prizedraw page where people can also recommend the compo to a friend in the one form.
Basically
1 - email to go out to our existing database asking them to recommend a friend for the chance to win x prize
2 – they are direc...
I am trying to output a simple link.
This works great:
$url = 'http://www.google.com';
echo $url;
This doesn't work great:
$url = 'http://www.google.com';
echo urlencode($url);
The second example tacks on "?SID=xxx" to the end of the URL for some reason. How do I prevent this from happening?
Note: The code to generate the URL ha...
i've implemented this pagination class for search.php page in a separate file called class.pagination.php, but when i execute the search page, nothing happens. it just displays a blank page.
this is my search.php file, where i'm calling this class:
<?php
include 'config.php';
require ('class.pagination.php');
$searc...
I have a website with a jQuery based autocomplete search functionality which works great.
Currently though I have just one search box for all categories, what I want is for someone to be able to type in, say for example, dorian gray dvd (in any order) which will search for dorian gray within the dvd category. What this will require then...
I'm trying to come up with a regex that constructs an array that looks like the one below, from the following string
$str = 'Hello world [something here]{optional}{optional}{optional}{n possibilities of this}';
So far I have /^(\*{0,3})(.+)\[(.*)\]((?:{[a-z ]+})?)$/
Array
(
[0] => Array
(
[0] => Hello world [s...
I have created a category template in Wordpress for all posts that are in the 'blog' category. The file name is single-blog.php. There is some conditional code in single.php that checks whether the post is in the 'blog' category and if it is it redirects it to single-blog.php. That seems to be working fine.
The problem is that on a...
In my application I have "ApiController" with "actionUsers", so in Yii the path becomes api/users. Now in order to get certain users info I use the following path api/users/id/10 where 10 is the userID and id part of the path is basically a GET parameter (api/users?id=10).
Is there any way to do the same thing without id part of the pat...
A former developer wrote or client-server api in PHP. It simply sends messages as xml using post/response in a very simplistic fashion. The problem is that even when there is an error (ex: invalid arguments passed into the server side) we get a HTTP 200 response with a page like this
<h4>Unknown error!</h4>
In firebug I can see tha...
I am using PHP filter to perfom basic sanitization and validation of form data.
The principle problem I am having is that I mark my form up so that all the data is in one array for the POST input. e.g. form fields, page[name], page[slug], page[body], page[status], etc.
Using the following:
filter_input(INPUT_POST, 'page[name]', FILTER...
I'm getting an odd segmentation fault in PHP.
Every few times, when I run:
php -v
I see:
PHP 5.2.6 (cli) (built: Aug 19 2009 16:59:56)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Segmentation fault (core dumped)
Analyzing the core dump (backtrace with gdb):
#0 0x00002ba641...
I have a Flex program that gets a JSON array from a PHP script. The PHP script doesn't contain just a simple JSON array but it grabs data from Activecollab and do some work on the data before encoding the data.
The first test involve a small JSON array that took a short time to encode by PHP. However, when I try to scale up the test,...