php

AJAX: How to replace content of a DIV with a link in same DIV ?

I have index.php like this: <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript" src="ajax.js"></script> <a href='one.php' class='ajax'>One</a> <div id="workspace">workspace</div> one.php <?php $arr = array ( "workspace" => "<a href='two.php' class='ajax'>two</a>" ); echo json_encode($arr); ...

Calculations in mysql statement for rating

Hello, I want order a selection of items by the rating. There are 2 fields: rateup and ratedown. I use these fields to calculate a number and order the selection on that number. Can that be done in mysql? I have a querylike this, but this doesn't work: SELECT * FROM table ORDER BY (((9/rateup+ratedown)*rateup)+1) DESC How can I make t...

Calling php classes from other files

I am working on some custom post types. I finished the first one and realized that the metabox code I was using could be re-used by other, future, custom post types (as well as pages, posts, etc). So I put the class in its own php file and included it from the functions.php file of my child theme. I've never used classes before, but I...

Showing error no 0,when connecting to apns

Hi i am new to PHP .I am coded for Apple push Notification service on php. when i run the program it get error no 0.i am using SSH FTP server, but i connect to SSl FTP server. can any one help what i do for solving this error no 0.i used following code <?php //include_once('jsonwrapper.php'); //include_once('DBConnection.php'); $ms...

how to hide / show line from php designer IDE

hi everybody i wonder hide or show line from php designer. example; this is show lines function () { line 1 line 2 } this is hide lines function () {...} you can help me please ...

Using Ebay API - Large Merchant Service with PHP

I'm doing some tests in Ebay Sandbox to understand how Large Merchant Service works, so lookong at some examples here i came up with some classes and an xml file setup for US site. It works fine if I use this xml file, items are listed on ebay, but when i try to set the xml output for the italian site I mess something. So, this is the...

Handling deletion and renaming of relational records

I'm developing a relational system, that involves the following entities: Enquiry Quote Supplier Town Vehicle Enquiry is the main model for the system and contains foreign keys for all the other entities. Now what I'm concerned of is for example if the client goes and deletes a Town - the Enquiry record has a reference to the town i...

I have tried to login to facebook via curl,

I have successfully logged into facebook in this manner but cannot seem to keep the facebook logged in as soon as you click anything in facebook it redirects you to the login page. I pondered this + thought that it was due to the fact that curl was using the cookie + not the browser, thus when you click you are un - authenticated. is t...

Buy One Get One Free Scripting Strategy in Magento

My objective is to create a buy xyz get xyz free, where x, y, and z are separate products. When purchasing EITHER x, y, or z, the customer can one of x, y, or z products for free. I've tried to create this function within Magento's price rules, but I have not had any success whatsoever. I've read pretty much everything on the internet r...

Setup iPhone app login to PHP web application backend

I'm not an iPhone developer but I'm starting on a project that is based on a PHP back-end server supplying data to iPhone useragents and I'm wondering where to start with sessions/security. With browsers, I can simply pass a cookie (containing a session id) on login. However, I'm wondering if the iPhone is different. Do iPhone apps hav...

jQuery $.post request failing.

I'm sending a $.post request to php with jQuery. The jQuery code looks like this: $('form').submit(function() { username = $('input[name="username"]').val(); alert(username); $.post('/ajax/new_user.php', {username:username}, function(data) { alert(data); }); }); In PHP, I'm just trying to do this for now: <...

Any luck with Drupal 6 and Quickbooks inventory export

Looking at the Quickbooks API I only see options to sync users. I may just need to export the fields I need directly from the database? Just hoping someone had some scripts/templates to work with this already. I am not too worried about sync as long as the client could manually import web transactions at the beginning of the day ...

how to redirect to custom Joomla error code page when error occurs in ajax?

Hi, This questions is bit specific to joomla. I have created the custom error page error.php in /template/MY_TEMPLATE/error.php. This file checks for the error codes and displays different message for each http code I set(I check with $this->error->code == '404'). Normally this works good. Now the question is, how should I handle same ...

Ebay style category chooser with mootools, PHP and MySQL?

Hi all, I am looking to create a similar category chooser to ebay, allowing a next level style selector, but built with mootools, php and selecting the categories from MySQL. Any help or tips on where to look or how to start more than welcome... ...

fetchArray() ommiting the first result.

I got the following code on my php script: $result = $conect->query("SELECT nome, classificacao FROM ".$conecta->prefix('inscritos_resultados')." WHERE classificacao >=1 AND classificacao <=50 ORDER BY classificacao"); $o_grupo = 0; while ($usuarios = $conecta->fetchArray($result)) { if ($o_grupo == 0){ ...

Any way to use Minify with external (CDN-hosted) stylesheets and scripts?

Hi folks! I'm hoping to use http://code.google.com/p/minify/ - Minify - and it looks really good. However I can't seem to fathom a way to get it to accept external stylesheets and JS script files, especially with the Builder. I am hosting files on Amazon S3 but have set up a CNAME record on my domain so they are accessible from cdn.myd...

Access active sessions in PHP

How can I get a list of all active PHP sessions on a server and access them from within one user's instance? The motivating case is displaying a list of all currently active users on the site, where usernames are stored in each user's PHP session. Note: I know that I can create my own state via a database (or even the filesystem), but ...

php + mysql (join?)

Maybe this way it will make more sense. MySQL "table" Code: id1 | id2 1 | 2 1 | 3 2 | 4 2 | 3 3 | 4 3 | 5 WHERE id1 = 1, this id is connected to 2 and 3: 1->2, 1->3 What I want to do is output the IDs of 2 and 3 which are NOT connected to 1, which in this particular case would be 4 and 5. 2->4 (1 is NOT connecte...

Zend Framework: Zend Form Select Generate Verbose HTML Using MultiOptions

I have a form that I am trying to add a simple select element to using the following php: $dateFormat = new Zend_Form_Element_Select('dateFormat'); $dateFormat->setLabel('Date Format:'); $dateFormat->setRequired(true)->addValidator('NotEmpty'); $dateFormat->addMultiOptions(array( 'MM/dd/yyyy' => "US S...

A quick way to see what functions/libraries used by a php project?

With java it is easy as you can just copy the import statements at the top of the code. With php, as you don't need to import the library it is more difficult. Is there a way to generate a list of all the functions being used by my code? I'm just after a quick solution is there is one, its just for documentation purposes :) ...