php

PHP Classes and including files

Hi all, I am needing some information on including files in PHP classes. E.G. include Foo2.php; //<--- Is this good? class Foo { function doFoo(){ include("Foo2.php"); //<--- or is this better? //do something with vars from Foo2 } } I was wondering what the differences were beside scope and if there...

Naming of interfaces/abstract classes in PHP 5.3 (using namespaces)

Hi guys, Prior to PHP 5.3 I used to name interfaces/abstract classes like this: abstract class Framework_Package_Subpackage_Abstract {} Framework/Package/Subpackage/Abstract.php interface Framework_Package_Subpackage_Interface {} Framework/Package/Subpackage/Interface.php Now with PHP 5.3 and using namespaces I can't use my conventi...

Pass large variables with php and http?

Hi, i want to pass large variables to a PHP script on another server with http like: "example.com/get.php?data=this is quite alot data..." I always get the server(apache) response: "Request-URI Too Large" Any ideas hot to pass the big variables to that script? ...

Google Maps Problem with Zend Framework

Hi I am having issues inserting a map from google maps and using the send framework. My issue is similar to Question 921811 However when adding the script to my view I am getting the googlemaps api in twice and no map being rendered by the view. This is what I am adding to the view script <?php $this->headScript()->appendFile('http...

online mp3 player

Hi i'm looking for a piece of software that'll allow me to play mp3's from my webserver though a simple web app. support for playlists would be nice ,but non-manditory, though a shuffle funtion is a must. I can run php, ruby, or python apps on my server, and woudl prefer something free or open source (as long as the price is nominal thou...

good idea to integrate CodeIgniter with phpBB3 User System?

Is there a way to integrate CodeIgniter with phpBB3? The reason I ask is because I would like to use the user system as a base for my future CodeIgniter Application. Is it a good idea to use phpBB as a base user system? ...

Error Levels and Error on which line?

I have a PHP script vieworder.php that includes other scripts at the top. <?php include "../includes/config.php"; include "../includes/session.php"; include "../includes/functions.php"; //... ?> I get an error on this PHP script. It tells me this: Warning: mysql_num_rows(): supplied argument ... in vieworder.php on line 185 Do I n...

Regular Expression to collect everything after the last /

I'm new at regular expressions and wonder how to phrase one that collects everything after the last /. I'm extracting an ID used by googles gdata. my example string is http://spreadsheets.google.com/feeds/spreadsheets/p1f3JYcCu_cb0i0JYuCu123 Where the ID is p1f3JYcCu_cb0i0JYuCu123 Oh and I'm using PHP. ...

Why won't this echo in PHP?

I'm curious why this won't echo the HTML; I've perused the other questions in SO having to do with echo and print. It must be the PHP while loop in the string, but I've escaped the double quotes. There is something more complex happening, namely the error "Object of class WP-Query could not be converted to string." Am I being too simpl...

Redirect doesn't work after using AjaxContext

In my controllers init() method I call the AjaxContext-Helper and set it for some methods/actions in that controller. Like so: public function init() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('setlabel', 'html'); $ajaxContext->initContext(); } Now when I want to use redirect ...

MySQL warning of Unknown column that exists

Having found out how to find PHP problems. I am now trying to solve them, but I have no clue on this one. I made use of mysql_error and I have found: 1054: Unknown column 'o.user_id' in 'on clause' Is there something wrong with this: $sql="SELECT o.*, u.user_name, u.email, od.artist_id,cm.nexchange_price FROM ".$tableprefix."...

Custom Event Calendar

Anyone know a good source for building a custom event calendar? ...

javascript menu like mtv

Hey people I'm seeking an js menu like the link below. http://www.mtv.com/mtv2/ jQuery would be a plus! ...

php regex for html

hey guys, I'm trying to make a regex for taking some data out of a table. the code i've got now is: <table> <tr> <td>quote1</td> <td>have you trying it off and on again ?</td> </tr> <tr> <td>quote65</td> <td>You wouldn't steal a helmet of a policeman</td> </tr> </table> This I want to replace by: quot...

Variable persistence in PHP

i have a php page, on that page i have text boxes and a submit button, this button runs php in a section: if(isset($_POST['Add'])){code} This works fine here and in that section $name,$base,$location etc are calculated and used. but that section of code generates another submit button that drives another section of code. it is in ...

PHP Function to Join Strings?

join_strings(string $glue, string $var, string $var2 [, string $...]); I am looking for something that would behave similar to the function I conceptualized above. A functional example would be: $title = "Mr."; $fname = "Jonathan"; $lname = "Sampson"; print join_strings(" ", $title, $fname, $lname); // Mr. Jonathan Sampson After gi...

Django single sign on and Php site: cross domain login ?

Hello DJango warriors ! I am building a small app as a service in django and now is the time to integrate it on some clients PHP web app. Our client A from domain www.a.com handles his own authentication for his users and probably use cookies for sessions. How could i make logged in users from his domain also logged in on my Django ap...

Accessing Undefined Arguments

Is there a way to pass an unlimited amount of arguments to a function, and access all of those arguments without needing to define each one in the heading. Here is an example to make it more clear: function doSomething($var1="", $var2="".........) { // Do something with the arguments } I don't want to have to go define a bunch of ...

How should I build a gaming community

I've been wanting to build my own gaming community site (like http://fragbite.com) for a long time. I have started many times but just quit after a couple days because it gets very messy. I've been playing around with PHP and MySQL off and on for 3 years, but I've never gotten in to OOP. I have tried, but I usually end up with the "old ...

Advanced Date-Validation with PHP

I've got to validate numerous dates with my current project. Unfortunately, these dates can vary wildly. Examples include: 1983-07-10 (After 1970) 1492-10-11 (Before 1970, year of Unix Timestamps - this eliminates strtotime() on some systems) 200 B.C. (Really old...) Dates will not exceed 9999 b.c., nor will they be future (beyond 't...