I am trying to create my first WordPress plugin. Even in trying to create the install function, things are being a pain. I want to set some global variables specific to my plugin rather than putting the literal values throughout the various functions. However, my install function does not pick up these global variables. Here is my code s...
I'm trying to accomplish a task and turns out that the code I need is packaged as a PHP extension, which according to what I've been told means I have to have root access to install it (I'm on shared hosting so that's a bit of a problem.
I'll solve this problem later, but for now I'm trying to understand the difference between an exten...
Hi...
I have a form containing several drop lists and a text field, and a button...
When I click the button, an ajaxfunction is called... the ajax then calls a php function which gets results from a mysql db...
The problem is that I cant do the same thing by just hitting enter in the form, the page just gets refreshed...
That explain...
My listener is part of a behavior, that should remove all is_published checks in the where clause of any called select query. Adding a part to a clause is really easy, but how to remove one.
There are some functions like Doctrine_Query->removeDqlQueryPart('where'),
but that removes the complete where clause, while I only need the 'is_...
I'm struggling to parse the below data using PHP. An API returns it, and I've tried various syntaxes. How do I return the data in a non-object way? Or, what's the syntax to call the data using the stdClass?
Could I convert this to one data based array, or even two? I'm lost when it comes to object-based data sets.
stdClass Object
(
...
Hi again...
I have a form that onsubmit calls an ajaxFunction()... The ajaxfunction calls a php function which returns results from a mysql db...
Problem is the back button... I want users to be able to search and then search again and then use the back button to get back to the previous search, but this wont work... Remember, the form...
-I have read about json being a simple way but also read its a bad practice to use eval() once the data is retrieved. So I don't know how so use the data returned.
-The only way i've been able to retrieve data from php scripts is if I echo the results already formatted (which is not very convenient). Also if there is a redirect in the p...
Hello, I have some troubles with encoding and mailing.
I send post-request to php-script, when I do
print_r( $_POST );
I could see my text normally, but when I'm trying to send it into email, using code:
$text = ...; // Includeing data from $_POST;
$headers = "From: test\r\n";
$headers .= "Return-Path: test\r\n";
$header...
I've been tearing my hair as to why this fails I have the following code
$query = "
SELECT DISTINCT title, caption, message, url, MATCH(title, caption, message, url) AGAINST ('$searchstring' ) AS score FROM news WHERE (valid = 1) AND MATCH(title, caption, message, url) AGAINST ('$searchstring' ) UNION ALL
SELECT DISTINCT title, captio...
Hi
I've successfully managed to connect to Apple's feedback APNS server but I'm not sure how to unpack the binary data you get from fread(). Does anyone know how to do this? The documentation says the first 4 bytes are the timestamp, the next 2 are the token length and the rest are the device token.
How does this info get unpacked into...
I'm reading a datetime field from mysql db. I'd like to convert it in PHP:
from: 2009-05-23 14:46:23
to 05/23/2009 02:46 pm
Notice the am/pm conversion.
Thanks in advance..
...
I have a $string variable, and I use
SELECT * FROM db WHERE description LIKE '%$string%' OR headline LIKE '%$string%'
As seen, i want to search the two fields "description" and "headline" to see if the string variable matches any of them...
Problem is that I want it to match whole words!!!
Ex: If description contains "hello", it is...
I am generating a lot of HTML code via PHP, but I need to store it in a variable, not display it immediately. But I want to be able to break out of PHP so my code isnt a giant string.
for example (but actual code will be much larger):
<?php
$content = '<div>
<span>text</span>
<a href="#">link</a>
</div>';
?>
I want to do som...
I am interested in making an application that can automatically determine what files are included in php.
What I'm getting at is that I would like to make either a C/C++ or a C# application that runs in the background and as you're developing on your local machine, it can display included files by php as you launch pages running on you...
can we write php tag libararies just like in java's tld?
...
Hi, I would like to integrate my tumblr feed in to my website. It seems that tumblr has an API for this, but I'm not quite sure how to use it. From what I understand, I request the page, and tumblr returns an xml file with the contents of my blog. But how do I then make this xml into meaningful html? Must I parse it with php, turning the...
I'm making a downloadable self-hosted web app (using CodeIgniter), and need the .htaccess rewrite rule to be able to tell if it's in a subdirectory or not to be able to make the rewrite rule correctly.
For example, if the app is being installed at example.com, then the write rule will look like
RewriteRule ^(.*)$ /index.php/$1 [L]
I...
Lets say I have two tables, 'a' and 'b'. The relationship of 'a' to 'b' is one to many. Lets both tables have the field status. This field has the values 'active' and 'inactive'. If I set the field status to 'inactive', does MySQL have a way to cascade this down to all tables tied to the row I changed the status value for? Or would ...
Hello,
Does anyone know where can I find the documentation source for the PHP functions?
(Something like XML files would be great!)
thanks
...
UGH.
Hi.
I have a form. I'd like to know how/if I could submit this form to an iFrame that has the page that will handle the file upload/naming.
If I try even something simple like post an input/text to the form, nothing happens (the handler is set to echo the $_POST). I have tried setting the iframe name/id et. al. and setting the fo...