php

Paypal IPN script: create a php on my site that receives confirmed payment messages and inserts into wordpress db

There are two parts to this question, so I'm going to pubish it as two separate questions. The first one deals with interfacing with IPN and is this: I need to create a simple .php script that can interface with Paypal's IPN system everytime I receive a confirmed payment for a given product. The script will then install the user into m...

PHP parse csv list and insert each record into wordpress users database

I've got an excel file containing a list of records by firstname, lastname, email_address, transaction_id I'd like to create a script that reads in the excel data (can be csv or whatever export is easiest to work with) and inserts each record as a user in my wordpress database with the role of "member". ...

Testing Zend Framework controllers that return HTML5

I have a controller test case that looks like the following: class LoginControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function testLoginFormIsShown() { $this->dispatch('/login'); $this->assertQuery('form#login'); } } However our site is written using HTML5 and contains elements like <...

php mysql connection does not show results why

this is driving me crazy why aren't the results showing??? function runSQL($rsql) { $connect = mysql_connect('localhost','xxx','xxx') or die ("Error: could not connect to database"); $db = mysql_select_db('xxx'); $result = mysql_query($rsql) or die ("Error in query: $query. " . mysql_error()); return $result; mysq...

php: trying to merge multiple pngs together getting error

Note sure what i am doing wrong here... but im trying to merge 3 pngs over into one and it is throwing an error Warning: imagepng() [function.imagepng]: gd-png error: no colors in palette in C:\wamp\www\jeep\public\test\png_2.php on line 22 $x = 300; $y = 300; $final_img = imagecreate($x,$y) or die("Failed in call to imagecreate()...

Action if isset..php/javascript

Hello. I am storing a session variable when a comment is inserted.. called user_message.. and i want to, when user_message, have been stored, THEN, show message on index.php index.php is right now: <div id="message"> <? echo $_SESSION["user_message"]; ?> </div> But you will need to refresh(f5) the site, to see the message AFTER its st...

Storing contents of a PHP array in a MySQL database

I am having trouble storing array contents in mysql I am using the code below foreach($found_entry as $key => $sd) { echo "$key => $sd <br>"; $insert_found_row = mysql_query("INSERT INTO myTable values ID = \"$sd[0]\" ,Folder = \"NULL\", Tsi = \"$sd[11]\", PT= \"NA\" ") or die(mysql_error()); echo "$sd"; If I ec...

Method "_getTable" does not exist and was not trapped in __call()

So here is a method I have in my controller: private $_tables = array(); private function _getTable($table) { if (!isset($this->_tables[$table])) { include APPLICATION_PATH . '/modules/' . $this->_request->getModuleName() . '/models/' . $table . '.php'; $this->_tables[$table] = new $table(); } return...

how i can use this Pagination code as Multiple Table

I had found a pagination code on paging entries using PHP and MySQL.....(which I downloaded in here)i found out that it was designed for a single table only.....Now my problem is how about paging a "mulitple queried table (2 or more tables temporarily combined). My idea is to make a derived table out from it, but, still failed, maybe i'v...

how to organize code for different "mobile device interfaces" and "desktop interfaces"

I am planning for a web application. I am using the PHP framework Kohana with Smarty. My web application will also have mobile device interface. Now, there will be lot of common and lot of separate code for the two interfaces. How should I organize the the code so that: There is no duplication of code. Unnecessary code does not get lo...

php classes dont work inside another class, but works outside global

i have this http://pastie.org/836744 script, which works outside the class completely fine, but it does not work inside another class, i have added the global vars in method too, which are being used inside other functions, but that didnt work. following is demo code include_once("prayer_calculation.inc.php"); $prayers = get_prayer_ti...

what is the difference between these two functions ?

what is the difference between these functions ? and why we are assigning an empty value to a function parameter ? function prints($var = '') { echo $var; } function prin($var) { echo $var; } Both prints the same result. what will happen if we assign an empty value to a function parameter ? ...

How to make sure that my ajax call pulls authenticated content

Hello guys, I am making an Ajax call within my page to a DB and pulling products that have images included. Here is the ajax call that i'm making: $.ajax({ type : "GET", url : "**https**://www.mydomain.org/getRow.php", dataType: 'html', success: function (msg) { $(".drag-desired").html(msg); $.event...

How to use Join in Zend Framework.

Hello, i am using Join query in zend.. like $select = $table->select() ->from(array('e' => 'EducationHistory'), array('status_DataDictionary_id')) ->join(array('r' => 'ReportOrder'), 'e.id = r.EducationHistory_id', ...

Storing important secret keys in php files

We're making an app using PHP and using some third party services that require a secret API key. We have a PHP file that contains all those keys definitions that we then import (using require_once) when needed. Is this approach safe? Should we store the keys in a different place? Thank you. ...

Array Foreach Loop

Hi All, I'm running a RegEx to match all instances of the Twitter hashtag. It returns it just fine, but now I just want to loop through the first set and return my #hello, #world, #hello-world....not the second set. Any help will be quickly rewarded! Array ( [0] => Array ( [0] => #hello [1] => #wor...

What kind of JOIN should I use here?

I'm new to JOINS in MySql. I have six tables: t1, t2, t3, t4, t5, t6. And I also have one main table: main_table. TOTAL 7 TABLES! The first column of ALL tables is called classified_id. If the user searches for "cars" then the main table will match everything in table t1 (which is the cars table) where classified_id is the same in bot...

javascript php editor

Is there and editor for PHP (or for any other syntax-highlight - able) language, written in javascript and available to use? ...

Why shouldn't I use unix commands from php?

Why would you prefer to keep from using bash commands via exec() in php? I do not consider portability issue (I definitely will not port it to run on Windows). That's just a matter of a good way of writing scripts. On the one hand: I need to write much more lines in php then in bash to accomplish the same task. For example, when I n...

run function if form fields are not null

Is it alright to post the isset password like this? I think it should be if(isset($_POST['username']) && isset(md5($_POST['password']))) - since it posts it encrypted, but if I wrap md5 around the password w/i the conditional, it does not work properly. if(isset($_POST['username']) && isset($_POST['password'])) { //run authentication ...