Hello; I've got an Object Oriented library I wanted to add a method to, and while I'm fairly certain I could just go into the source of that library and add it, I imagine this is what's generally known as A Bad Idea.
How would I go about adding my own method to a PHP object correctly?
UPDATE ** editing **
The library I'm trying to ad...
Quick and simple (I hope) question; If a user inputs new lines in a text field, ie:
43 Dennis
Beeston
How can I save the new line rather than have it transferred to the mysql server as one line?!
I am using PHP and mysql.
Many thanks
...
I've got a wordpress theme that I update very often with new functionality. I've been sending users a zip file each time I have an update. It's a bit cumbersome since they have to (1) temporarily activate a new theme (2) delete my theme (3) install the updated theme (4) activate the updated theme (unless they are ftp savvy which most are...
Hi the folks!
I'm building a Open Source product and I thinking about Localization, I've read about gettext but there seems to be a lot of problem to get it to work in different systems (servers,os etc).
How would you handle this? Is there a secure way to help gettext work on several systems? Perhaps it already is?
Regards from Sweden...
Lets say I have this array:
$array = array(1,2,'b','c',5,6,7,8,9.10);
Later in the script, I want to add the value 'd' before 'c'. How can I do this?
...
I am developing locally with PHP on Xampp.
I am trying to use recaptcha.
Do I need public and/or private key?
Thanks in advance.
...
Hey, not sure why CodeIgniter is giving me a blank page when I load a simple model. I'm breaking the code down, backwards, and I can't figure out what's breaking. Here's the controller:
class Leads extends Controller {
function Leads() {
parent::Controller();
$this->load->scaffolding('leads');
}
function index() {
$data ...
I have a couple of simple forms that send an html-only email. Most clients (Gmail, Lotus Notes 8, hotmail/live, windows live mail, outlook express) receive the emails just fine, but Outlook 2007 does not.
The code looks like this:
$data="
<html>
<body>
<strong><u>$sub</u></strong><br><br>...
Lets say I have this array:
$array = array('a'=>1,'z'=>2,'d'=>4);
Later in the script, I want to add the value 'c'=>3 before 'z'. How can I do this?
EDIT: Yes, the order is important. When I run a foreach() through the array, I do NOT want this newly added value added to the end of the array. I am getting this array from a mysql_fetch...
I'm having a bit of a problem I have created a post and it shows on my blog but as soon as you click on the title link it says "Sorry, no posts were found." and even in the homepage where the recent post doesn't work.
...
I want to hide this specific in the blog and other page I have this code :
<?php if (is_page(array ('2','4','6','8','10','12'))) : ?>
<?php else : ?>
<?php include('stats.php');?>
<?php endif; ?>
it won't show on 2,6,8,10,12 which are the pagesbut it shoes in 4 which is the blog please help.
...
I have the following data being returned from my database query:
+---------------+-----------+------------------+--------------+-------+
| district_name | school_id | school_name | section | score |
+---------------+-----------+------------------+--------------+-------+
| My ISD | 11 | My First School | English...
Hello,
I want to pass both the values using ajaxForm, displaying both the values separately in test.php
-------test.php-----------------------------------------
<script language="javascript" type="text/javascript">
$('#test_form').ajaxForm({
target:'#result',
success:function() {
$('#result').show();
}
});
</sc...
I'm not sure how to create a threaded comments system in PHP and MySQL which can handle hundreds of comments at a time.
Something like this is the only thing I can come up with
$query = execute_query...('SELECT * FROM `comments` WHERE `post` = "1"');
foreach($query as $comment){
$replies = execute_query...('SELECT * FROM `comment_r...
Someone extremely smart at work told me try catches which don't throw will affect performance on a site with millions of users. based on the unit test posted showing equal performance, I'm wondering if this is related to an os level and/or web server specific situation. For instance, web server's implementation of asynchronous work occur...
I've got a minor problem with a database admin page that I use to update values and totals in a MySQL database for generating various figures and data for a website.
A bit of background - the database table in question holds fundraising totals for a charity bookstall, with the table having three columns - id, date, and amountraised. Sum...
I have a table that holds products, another that holds variations and a third that hold product variations (many products can have many variations..both ways). I want to display (group by) each product and show the variations.
what i've read is just looping thru and comparing id's to see which record you are on, if a new one then adjus...
Hello,
I have a PHP based website that uses coupon codes. I can restrict search engines from finding the landing page of a coupon code (like if it was an ad on another page).
But I also want to restrict the coupon code so that it only works if they came from the site serving the coupon code. That way, if someone find the code, they ca...
Do you have a nice class you use for measuring time a PHP script loads certain blocks of code? Would you care to share what YOU use?
...
Assume you have several arbitrary classes like below:
class Foo
{
$foovar;
public function __construct()
{
$foovar = "Foo";
}
public function getFoo()
{
return($foovar);
}
}
class Bar
{
$F;
public function __construct()
{
$F = new Foo();
}
}
My question is is it p...