I'm building a page with a custom template.
The thing is, I need this page to be password protected, or at least accessible to logged in users, but even if I set it as such (Private/Password protected) in the New Pages section in WordPress Administration, it won't display the menu entry nor the content (if Private) or it would show the ...
I'm using a cURL script to send POST data through a proxy to a script and I want to see what raw HTTP headers the cURL script is sending. List of things I've tried:
echo curl_getinfo($ch, CURLINFO_HEADER_OUT) gives no output.
file_get_contents('php://input') gets some HTTP headers but not all.
print_r($_SERVER) also gets some HTTP head...
Hi,
I'm trying to use PHP to create a file containing a list of phone numbers.
It's working OK however if the phone number begins with zero, the digit is dropped from the excel file.
Does anyone know how to set the formatting correctly so that it remains in place?
Any advice appreciated.
Thanks.
...
I have an array $x with nonzero number of elements. I want to create another array ($y) which is equal to $x. Then I want to make some manipulations with $y without causing any changes to $x. Can I create $y in this way:
$y = $x;
In other words, if I modify $y created in the above shown way, will I change value of $x?
...
Hi there,
I'd like to get the title tag and RSS feed address (if there is one) from a given URL, but the method(s) I've used so far just aren't working at all. I've managed to get the title tag by using preg_match and a regular expression, but I can't seem to get anywhere with getting the RSS feed address.
($webContent holds the HTML o...
Given that my class looks like this:
class Methods{
function a(){
return 'a';
}
function b(){
$this->a();
}
function c(){
$this->a();
}
}
Is it possible to ensure that function a can only be called from function b?
In the above example function c should fail. I could just incl...
I have a table with just as ID and a value. Let's say this list have 4 items, such as Apple,Banana, Zuchinni, and Other. I want to sort the list alphabetically, but always have 'Other' be the last option. Is there a way to accomplish this using a query?
...
I have a list of points with x, y coordinates. I know how to get the distance between points with sqrt(pow($x2 - $x1, 2) + pow($y2 - $y1, 2)) and the angle between points with atan2(y1 - y2, x1 - x2).
How can I calculate the relative angle between the points (left, right, straight)? So, if I'm at point 1, what is the relative direction...
Sometimes when one of our Apache web servers is restarted, we experience segmentation faults when any PHP page is subsequently accessed. The following line is printed in the httpd error_log:
[Wed Jun 16 10:59:33 2010] [notice] child pid 31513 exit signal Segmentation fault (11)
There will be one of these lines for each PHP page that is...
Hello I finally got PHPMailer to work with Google but now I am finding out that I am getting this output to the screen after the message has been sent.
SMTP -> FROM SERVER:220 mx.google.com ESMTP f34sm21891943qco.35
SMTP -> FROM SERVER: 250-mx.google.com at your service, [76.28.109.170] 250-SIZE 35651584 250-8BITMIME 250-AUTH LOGIN PLAI...
Hi Guys,
I want to insert a node with children at a specific location in the XML file. How do I do it?
For eg. If I have an XML like:
<myvalues>
<image name="img01">
<src>test</src>
</image>
<image name="img02">
<src>test</src>
</image>
<image name="img03">
<src>test</src>
</image>
</myvalues>
I want to insert:
...
hey folks,
I'm fairly new to PHP so am not sure how to do this.
I have records in a database that link to images (profile pictures) that i want to display 5 along and 4 down. How would I do this?
Thanks alot!
Jonesy
...
Hi,
I know that there are really a mass of XML XSLT php merging threads at SO. But php specific i could not found what might my problem:
$xml = new DOMDocument;
$xml->load("f.xml");
$xsl = new DOMDocument;
$xsl->load('test.xsl');
// init and configure processor
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // import xsl do...
Here is the header from firebug that shows the scope of the PHP Session cookie:
Set-Cookie PHPSESSID=f0e2dfe56cc78be718c8154ac80d1ae2; path=/; domain=pix-all.com
But still the PHP Session cookie is been sent for any requests to static.pix-all.com
Cookie PHPSESSID=f0e2dfe56cc78be718c8154ac80d1ae2;
What could be the problem?
...
Are there any APIs that check the grammar of a given string?
If so can you give examples?
...
I'm accessing an array by reference inside a foreach loop, but the unset() function doesn't seem to be working:
foreach ( $this->result['list'] as &$row ) {
if ($this_row_is_boring) {
unset($row);
}
}
print_r($this->result['list']); // Includes rows I thought I unset
Ideas? Thanks!
...
I have some code as follows:
$query = <<<QUERY
SELECT
*
FROM
names
WHERE
create_date > date('Y-m-d H:i:s');
QUERY
How can I put the date('Y-m-d H:i:s') in there without breaking out of the <<< statement?
...
I am calling the results form a query to a list on my site based on if the item is "downtown_hosted". This works fine but I would now like to sort that list DESC, but can't seem to get the syntax correct.
Below is what I have:
$result_events = mysql_query("SELECT * FROM events
WHERE downtown='downtown_...
Hi-- I'm seeing some strange behavior from some dynamically generated PDFs using the TCPDF library in PHP.
Standard lamp stack-- however, if you try to open the PDF from Windows with Acrobat Reader, it gives an error that the "file is damaged and could not be repaired". From Mac, Linux, etc. the file works fine, and opens fine. It also ...
I am using jquery button click to post all the values in a selectbox to a PHP page, but this code does not seem to work. Can anyone please help?
<script type="text/javascript">
$(function() {
$("#btn1").click(function () {
var arr= new Array;
$("#target_select option").each (function () {
// You ca...