php5

J-query J-player is not auto playing

I have used jPlayer in my music site .The actual songs data in dynamic.It is been adding on user checks from 10 listed songs on every page.jPlayer is getting added with the playlist but not autoplaying.when i'm clicking manually only it is getting palyed. I tried with playItem= 0,playItem= 1,playItem= 2...etc., Can any body suggest be ab...

OOP design: How to incorporate DB handling into application objects

This is a design problem I face regularly and I'd like to find some general insights about the subject. The code provided here is just an example. In the design phase it's easy to decide you need an object: User ========== Unique ID Login name Password Full name And it's easy to convert it into a database object: CREATE TABLE user (...

How can I access static assets in a Zend Framework Module?

In a Zend Framework 1.10 application, I have a controller UsersController in a module api and in the index view of that controller I would like to reference a static asset (like a javascript file). How can I do that without putting the file in the main public? so, we have a directory setup like this: zfproj/ ../applicati...

PHP Object Question

Unfortunately I cannot provide any code examples, however I will try and create an example. My question is about Objects and memory allocation in PHP. If I have an object, lets say: $object = new Class(); Then I do something like $object2 = $object; What is this actualy doing? I know there is a clone function, but thats not what I...

spl_object_hash for PHP < 5.2 (unique ID for object instances)

I'm trying to get unique IDs for object instances in PHP 5+. The function, spl_object_hash() is available from PHP 5.2 but I'm wondering if there's a workaround for older versions. There are a couple of functions in the comments on php.net but they're not working for me. The first (simplified): function spl_object_hash($object){ i...

Adding description tag to PHP image gallery

I am trying add a descriptive tag under each image but most of the code is in PHP and i am not to familiar with how to program it without screwing up the whole structure. Here is the website: http://suncoastdeck.com/index.php?page=portfolio&amp;start=0 Here is the code for the portfolio page: <div class="content-box"> <? //to...

jquery validate multiple or indivual containers for errors

Hi, is there a way to choose different containers with the jquery validate plugin for showing the errors in an independent container or a way to create a new container for every error but not just use the same one ? currently my code looks like this: $(document).ready(function(){ $("#loginForm").validate({ errorClass: 'err...

Is there a way to avoid the "redeclared function" fatal error while defining functions within functions in PHP?

I've been implementing a certain plugin (dtabs) on my page in Wordpress but after upgrading to the latest version, I found that I now have an error the 2nd time I call the main function called dtab_list_tabs(). The way it works is, the plugin gets include_once'd but the main function is called however many times you want to place tabs i...

Function to create objects?

Is there a function I can use to instantiate an object with arguments? #include <database.h> class database { function __construct($dbhost, $user, $pass, $etc) { /* etc */ } function query($sql) { /* dowork*/ } } $args = array('localhost', 'user', 'pass', 'etc'); $db = create_object('database', $args); // is there a function li...

if a php class is defined as final, does it make sense to define it's methods as final as well?

I have a class defined as final. Does it make sense to define the methods as final as well? I know that since the class itself is final it can't be extended, which would make the method final declarations redundant, but I want to work up documentation on the class and others, and thought it'd be help since the final property of the metho...

Memcache on windows, error php5.dll not found

I use php 5.3.0 and after hours of searching found a php_memcache.dll that is compiled for that version, now as I start php it gives me an error "The program can't start because php5.dll is missing from your computer. Try reinstalling the program to fix the problem." As I see it there is php5ts.dll in php folder, and I can't find php5.dl...

Is it Safe to Set PHP Max Execution Time to 600?

I'm installing a newer version of vTiger CRM. One of the prerequisites is editing php.ini max_execution_time to 600 instead of the default 30. This gap in settings has me questioning if it's safe to increase the execution time? Especially by so much. Thanks. ...

Method Chains PHP OOP

Hello, After seeing another question just started, I wanted to ask as to how something is actually achieved. When I use some frameworks they do this like $object->select('something') ->from('table') ->where( new Object_Evaluate('x') ) ->limit(1) ->order('x'); How do you actually do this kinds of chains...

format JSON value with a php function and print result inside a div#id

So far, I have got the following: $.getJSON('getinfo.php', { id:id }, parseInfo); function parseInfo(data) {    $('div#info').fadeOut("fast", function() { $('div#info').html(data.desc); } } I am able to print the results (data.desc) inside the div#info html tag, but before I do so, I want to format data.desc with my php fu...

how to test a facebook application?

I am developing a facebook application using php5. I am using dreamweaver as the editor. I want to test the application. I have a test account. But, now, how do I test the application using that test account? Do I need to submit my application prior to testing? ...

How to write declared as function SplitEmailAddress($address).

Whose argument will contain string data consisting of a valid email address. this function will take the email addres as the argument and return an array with two keys: user to the username part and domain for the domain part of the address Example: $arr= SplitEmailAddress('[email protected]') $arr['user'] should contain the ...

How to read XML string with PHP

Eg: $xmlstr ='<Address><to>Sriniva</to><from>Chennai</from><country>India</county></Address>'; ReadXml($xmlstr) Output -> Address to: Srinivas from: Chennai country : India ...

How to Reformate phone number with PHP5

funtion declared as function ReformatePhoneNumber($number), whose argument will contain string data representing some phone number data(entered by the user). A valid phone number may consist of between 7 and 12 digits (0,9). Assume that in between some adjacent digits there may optionally appear either a single space. or a single hypen(-...

why can't i echo my cookie? (PHP)

$username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $firstName = $_COOKIE['firstName']; $lastName = $_COOKIE['lastName']; $active = $_COOKIE['active']; $email = $_COOKIE['emailAddress']; then when using echo "<b>Username:</b> <? " . $username . "?>"; echo "<a href=logout.php>Logout</a>"; ...

PHP var_dump array

array(14) { [0]=> string(1) "1" ["id"]=> string(1) "1" [1]=> string(7) "myUserName" ["UserID"]=> string(7) "myUserName" [2]=> string(10) "myPassword" ["passwordID"]=> string(10) "myPassword" [3]=> string(24) "[email protected]" ["emailAddress"]=> string(24) "[email protected]" [4]=> string(7) "myFirs...