I have the following:
$reg[0] = '`<a(\s[^>]*)href="([^"]*)"([^>]*)>`si';
$reg[1] = '`<a(\s[^>]*)href="([^"]*)"([^>]*)>`si';
$replace[0] = '<a$1href="http://www.yahoo.com"$3>';
$replace[1] = '<a$1href="http://www.live.com"$3>';
$string = 'Test <a href="http://www.google.com">Google!!</a>Test <a href="http://www.google.com"...
Although I'm sure it's possible I cannot see how I would be able to do the following.
Using .htaccess to point the html errors to a single error handling page (this bit not a a problem).
That page then checks what the error code actually was (404, 500 etc.) and displays a message according to each one.
I am trying to do it in a PHP en...
In order to put ads on my wordpress site, but only every few posts, I want to add a simple conditional to the bottom of each post, containing my ad code.
I have ssomething like the following:
<?php if (the_ID() % 3 == 0){ ?>
ad code
<?php } ?>
But all this does is echo the id of the post.... for EVERY post!
What am I doing wrong?
...
Hi.
I have a two tables:
Clients
Cities
Then in the search form I have three fields:
A text input form to fill with the name of the client
A select box to choose the city where they want to search(table cities)
Another select box to choose the main business that the user wants to search for(businness is included in the clients tab...
I would like to iterate over the data rows stored in a Zend_Db_Table_Rowset object and then drop/unset some of the rows, if they don't fulfil certain criteria.
I could use toArray() to get only the data rows from the object and then it would be easy to unset the rows I don't need. But since I want to keep my object for further use I don...
I've seen a number of different solutions for doing this but I wonder if anyone can suggest which is the most elegant and secure version of letting users upload their own files to a folder on their own shared hosting? (php.ini etc is out of bounds).
Files will be anything up to 100mb in size, so maybe an FTP based solution would be best...
I have created a java letter game applet using netbeans 6.0 which also has a Microsoft Access Database for the High Scores.
I want to upload it into a webpage (like how its done on miniclip facebook etc) I'd like to know how it could be done
...
PHP Print_r is useful to print out array and dictionary collection.
is asp.net build in this function??
...
Hi, I have a multidimensinal array.. Something like this for example:
Array (
[0] => Array
(
[title] => Star Trek - Viaje a las estrellas
[country] => Venezuela, Spain, long title, poster title
)
[1] => Array
(
[title] => Viaje a Las Estrellas
[country] => ...
Hi,
I have a quick question about how to serve data from a repository in a application that I am writing using the Zend Framework.
My current structure is:
/application
/filespool
/library
/public
In the filespool are a number of user identifiable folders that contain user content that is uploaded via forms, mainly jpg/png and pdf. ...
I have a content type with a CCK integer field which takes a unix timestamp. I would like to create a view with a filter that takes the MySQL function "UNIX_TIMESTAMP":
If there is no way of doing this, how can I alter the SQL generated for the view?
...
I'm using the basic php example for the global modifier, and it doesn't work for me :-|
$a = 1;
$b = 2;
function Sum()
{
global $a, $b;
$b = $a + $b;
}
Sum();
echo "***: ".$b;
Here is the result...
$ ***: 2
Is there any parameter on the php.ini that might effect this?
...
I'm working on setting this up on Mac OS X Leopard.
I'm having a devil of a time getting PHP5 working as fastcgi under lighttpd. I've verified that I've compiled php with fastcgi enabled. I've tried configuring lighttpd as I've seen in various documentation.
The core bit that I'm not understanding is if php-cgi is supposed to create t...
Hello,
I have a local server where I do all my testing and work. Once I am done, I simply upload the db schema along with the relevant code. However the problem arises when I make some changes to the schema. I have to manually type the "alter table" query on my live server.
Is there a way to get the incremental changes that took place...
Hi all,
I create a software using php. Now need to sale this software .So, I need to encrypt my code that nobody can view my source code. can anybody help me to do:
1. Encrypt my PHP code but software functioning will remaining same.
2. Also I need to bind the software for a particular authorized pc & it will not run any other pc except ...
Hello,
I have come accross to this function below and I am wondering wether this is the right way of using the error handling of try/catch.
public function execute()
{
$lbReturn = false;
$lsQuery = $this->msLastQuery;
try
{
$lrResource = mysql_query($lsQuery);
if(!$lrResource)
{
throw new MysqlException("Unable to execute...
Hi,
I'm building a website that fetches text from another page and insert it into the database.
The problem is that all the special characters are saved in the database using the HTML encoding so then I need to convert the output using:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
I mean, what I have rig...
Okay, my situation is such: I need to send the contents of a JavaScript array to server where a PHP script will persist individual array entries in a MYSQL database. I am NOT using jQuery but I am about to integrate Prototype framework into my project.
I gather that the JS array can easily be converted to JSON using the toJSON() method ...
In CodeIgniter or core PHP is there an equivalent of Rails's view partials and templates?
A partial would let me render another view fragment inside my view, like have a common navbar.php view that I could point to inside my homepage.php view. Templates would let define the overall shell of an HTML page in one place, and let each view ...
Title kinda asks it all. I'm not referring to $_REQUEST, $_SERVER and all the pre-defined. I just want to know if on line 400 of my program I can somehow see all the variables that have been created up to that point.
Duplicate of:
http://stackoverflow.com/questions/717852/php-get-all-variables-defined-in-current-scope-symbol-table
...