php

ExpressionEngine 2: Sharing Libraries, or Loading Libraries from other Modules

I’ve got a number of custom modules that use a few of the same common libraries, in particular my database class. Is there a place I can put this commonly used class for use in modules via $this->EE->load->library('mydb'); or, is there a way to load that class in one module when it’s located in the libraries folder of another module? ...

Meaning of ? mark in SQLite

What does the ? character in this SQL query mean? $res = $dbConn->fetchPairs('SELECT name FROM tree where parent = ?',$key); ...

What is the best authentication script?

Hi, I'm planning on making some dynamic PHP websites and I need a free Authentication system that allows me to create control panel for these sites' admins. It should contain : Remember password Lost password Maximum login attempts per specific interval users Management Thanks. ...

array_push and in_array problems

I am having a bit of difficulty with this. I want to allow a user to check if a username is available through an AJAX request. The AJAX request calls my php and PHP returns true if the username is not available or false if available. I wanted to merge the username into the array (if found) and then use in_array to locate a match. It isn...

Stored procedure causes "Commands out of sync" on the next query.

I am running a query with a mysql stored procedure : $AddProf_qr = mysql_query("call AddStudent('$d_Pass', '$d_Titl', '$d_Firs', '$d_Midd', '$d_Last', '$d_Addr', '$d_City', '$d_Stat', '$d_County', '$d_Zipc', $d_Gend, '$d_Birh', '$d_Phom', '$d_Phoh', '$d_Phoo', '$d_Email', '$d_Webs', '$d_Natn', '$d_Profsn', '$d_Compny', '$d_Desig', $d...

Is it good practice to use break and continue in PHP?

Hi, is it good practice to use break and continue as sentinel for loops in PHP? e.g. if (!empty($var)) break; ...

Plugin Architecture in PHP

Hi! I am planning on doing a research on how to implement a plug-in architecture in PHP. I have tried searching the web for possible references, but I thought that maybe my search for a good reference would be faster and more relevant if I asked here. Has anyone here tried using plug-in architecture for web projects? Thanks, Erwin ...

summarise php array into treeview

Array ( [00000000017] => Array ( [00000000018] => Array ( [00000000035] => I-0SAYHADW4JJA [00000000038] => I-RF10EHE25KY0 [00000000039] => I-8MG3B1GT406F ) [00000000019] => I-7GM4G5N3SDJL ) [000000...

mysql query against wildcard

I have a mysql query in php, using match / against to filter results. Im trying to get a wildcard after $string so the next character can be anything. Help? "SELECT * FROM $table WHERE MATCH (message) AGAINST('$string%' IN BOOLEAN MODE)" ...

Wordpress Plugin or quick php function for conditional image size

my index.php has a body column width of about 400px The single.php has a column width of about 550px Is there a plugin or quick way to make all images (not just the post_thumbnail) display at full size (i.e., image.jpg) on single.php but use the thumbnail size (i.e., image-350x***.jpg) on index.php? ...

How can I split this string with a hyphen?

So I have a string that stores the phone numbers like so, $phone = "123456790". How can I split it to print it in this format: 123-456-7890 ? ...

PHP Paypal DoDirectPayment Method

Hi. Im getting this response from paypal and don't know how to work with it: "The totals of the cart item amounts do not match order amounts". These are the values Im passing, though just examples: $_POST["AMT"] = 41.95 $_POST["SHIPPINGAMT"] = 19.95 $_POST["NETAMT"] = 22 Not sure if the values have something to do with the proble...

Cake PHP - problem with auth component

Hello, My problem is that a variabile is not past from the controller to the view when the user is not logged in, but it is viewable when the user is logged in. My controller method looks like this: function publicprofile( $username ) { $user = $this->Users->find('first', array('conditions' => array('username' => $username))); ...

Codeigniter Trackback Question

I am trying to use the trackback library in codeigniter, but I am always get this An unknown error was encountered The following is my code(controller). There is other code validating the form etc but not effecting the trackback $id = $this->input->post('id'); $ping_url = $this->input->post('ping_url'); $title = $this->i...

How can I know the status of a call - Asterisk and PHP?

I'm developing an application with PHP and a Asterisk Server. One of the features of the application is to check the call status (ringing, answered, hung...) of an specific caller ID, so I would like to know how to do this, because I'm trying with a socket and the command status but I think it has to be a better way to do it. Thanks in ...

[PHP] Page/Form goes back to itself upon submitting instead of going to the specified page

We just started PHP in my webscripting class today, and I'm already having problems with my first PHP assignment. Its more of me not understanding what is going on or overlooking something I don't fully know yet. The code here: http://codepad.org/KnHda3iS is supposed to go to php4_1input.php but upon submitting it goes to back to itsel...

Load image using referrer header

Greetings, I'm trying to load an image dinamically. Seems like the server doesn't like me loading that image outside form their domain, so I always get with a 404, when in fact Firebug seems to load it and FF as well. What's the best approach to remove the referrer header from the GET request sent to the server via the browser? I was t...

php image create and jquery dialog

Hey All I want to be able to show an image made on the fly with php in jQuery Dialog window. When I try this all I get is the binary data for the image. But creating the image on a normal php page is not a problem. I have a simple php script to create the image public function image() { header('Content-type: image/png'); //...

PHP SESSION: SESSION Variables Automatically Reset after Unserialize()

I am testing codes from build internet which is a tutorial of OOP. I got a error message: unserialize() expects parameter 1 to be string, object given in includes/global.inc.php on line 20 Here is the code of serialize(): $_SESSION['user'] = serialize(new User(mysql_fetch_assoc($result))); And here is the code of unserialize...

Load more function in Javascript

EDIT: This question was initially too general, I think. So What I really need is a very good tutorial on how to implement the Load More function on Safari for iPhone just like the Twitter website(mobile.twitter.com) does. Just a wordpress plugin won't really help. But if the plugin is well explained, like if it is wptouch, home(that also...