php

WebDesign: Header file, but with custom Page titles?

I've been using headers to create templates for websites. It's easy, and very convenient for debugging. I now face the problem of using head BUT with custom page titles. If this is my header.php > <html> <head> <title> My Site : ??? </html> </head> <body> </body> </html> I need ??? to be replaced for every page. I...

how to extract and separate php and html from source file

Any suggestion on how to extract into separate files php code and html from a source file which is sprinkled with both. ...

CSS Pop up box that works in all browsers

I want to display a pop up box when a visitor clicks on my google map marker. I already have the text I want to display when they click the marker. ...

How can I put double quotes inside a string within an ajax JSON response from php?

I receive a JSON response in an Ajax request from the server. This way it works: { "a" : "1", "b" : "hello 'kitty'" } But I did not succeed in putting double quotes around kitty. When I convert " to \x22 in the Ajax response, it is still interpreted as " by JavaScript and I cannot parse the JSON. Should I also escape the \ and unesc...

Getting Occasional Errors Returned Instead of PHP Images

I have a script that colors the requested country on a world map with GD and PHP. The PHP requests are called with checkboxes. It kind of looks like if you call the PHP scripts too fast then it returns an "Xed out" error image. Is there a way to queue the PHP requests with setTimeout or something else, so a new checking event never fa...

php - How do I fix this illegal offset type error

I'm getting "illegal offset type" error for every iteration of this code. Here's the code in case anyone can help: $s = array(); for($i=0;$i<20;$i++){ $source = $xml->entry[$i]->source; $s[$source] += 1; } print_r($s) Any ideas. Thanks in advance. ...

problem showing pictures stored outside web root folder

On a website users can upload pictures. For security reasons these are stored outside the webroot (public_html) folder. When I need to display the picture, I send the headers and have "readfile" read and output the picture data, like so: header("Pragma: public"); header("Expires: 0"); // set expiration time header("Cache-Control: must-r...

Performance issue when querying a large xml file through php/ajax on Apache Server

Hey, I have a simple "live search" (results displayed while typing) web site. This make up is Ajax to PHP querying a pretty large XML document (10,000+ lines). This is all been hosted on a local Apache server (xamp). The scale of the xml document seems to be causing huge performance issue with results taking 10ish seconds to give the r...

Avoiding html thinking you are using a custom tag

I am trying to output a text value from a php array. The value is <Carlos> However when echo'd to the page nothing shows because the browser has transformed it to <Carlos></Carlos> How do I stop it from transforming it into tags? ...

Apache FOP generating blank page

Hello,I am trying to generate a PDF using Apache FOP and Java. I am using a valid xsl-fo file which I can create a pdf with using the command line FOP. My problem occurs when I try to run FOP using the Apache FOP Libraries. Running across a java/php bridge. The bride is properly configured and java / php communicate. On the java side ...

Howto see if form fields are identical in Zend framework

Hi there, In Zend Framework (1.10) i want to check if two input fields are identical I have the following code in my form: $this->addElement('password', 'password', array( 'label' => 'Wachtwoord:', 'required' => true ) ); $this->addElement('password', 'verifypassword', array( 'label' => 'Bevest...

AJAX form sections - how to pass url of next stage of form

Hi, I've got a multi-part form (in a PHP MVC setup) which I have working correctly without javascript enhancement. I'm starting to add the AJAX form handling code which will handle each stage of a form submission, validating/saving data etc, before using AJAX to load the next stage of the form. I'm wondering how best to pass the URL of t...

How can I separate words in td with an html tag?

How can I use jQuery to separate multiple words in a td with an HTML tag such as <br/>? For example, <td>hello bye</td> would become <td>hello <br/> bye</td>. ...

MySQL performance

Hi, I have this LAMP application with about 900k rows in MySQL and I am having some performance issues. Background - Apart from the LAMP stack , there's also a Java process (multi-threaded) that runs in its own JVM. So together with LAMP & java, they form the complete solution. The java process is responsible for inserts/updates and fe...

What kind of string is this? What can I do in php to read it?

This is a string (see below, after the dashed line) in a database.inf file for a free program I downloaded that lists some websites. The file is plain text as you can see , but there is a string after it that looks base64 encoded (due to the end chars of ==). But b64_decoding it gives giberish. I wanted to decode it so I could add to t...

PHP: prepared statement, IF statement help needed

I have the following code: $sql = "SELECT name, address, city FROM tableA, tableB WHERE tableA.id = tableB.id"; if (isset($price) ) { $sql = $sql . ' AND price = :price '; } if (isset($sqft) ) { $sql = $sql . ' AND sqft >= :sqft '; } if (isset($bedrooms) ) { $sql = $sql . ' AND bedrooms >= :bedrooms '; } $stmt = $dbh->pre...

What is the ASP.NET equivalent to memcached in PHP?

Is there an equivalent in ASP.NET to memcached usage in PHP? Is there even a way I could use memcached from the VB code behind, or something like it? ...

pdf reading in the site

i need to provide pdf reading in my site, but i haven't done such before, so could you tell me how i can do it(just give me an idea, or some links...). thanks ...

PEAR:DB connection parameters

I just finished my first PHP site and now I have a security-related question. I used PEAR:DB for the database connection and made a separate parameter file for it. How should I hide this parameter file? I found a guide (http://www.kitebird.com/articles/peardb.html) that says: Another way to specify connection parameters is to put ...

joining / merging two arrays

I have two arrays like this, actually this is mysql data retrieved from two different servers: $array1 = array ( 0 => array ( 'id' => 1, 'name' => 'somename') , 1 => array ( 'id' => 2, 'name' => 'somename2') ); $array2 = array ( 0 => array ( 'thdl_id' => 1, 'otherdate' => 'spmethi...