php

PrestaShop Payment Module Problem

I tried to edit paypal module of PrestaShop, but I think I tangled in a philosophical problem on the code. :( As I understand when customer redirected to the paypal website, there is no appropriate order inserted in the orders table yet. As soon as customer come back from paypal site, at the end of modules/paypal/validation.php file, va...

Regex to extract a block of text between matches.

Alright, so here's my problem. I'm trying to write a script in PHP that will parse our workorder system and return a set of tickets but I've run into a bit of a snag trying to parse the ticket list. I've been trying to use regex as much as possible to force myself to learn the syntax and I could sware that this should work but alas, it's...

Does PHP SoapServer class allow to stream large amount of data?

is it possible, using PHP SoapServer class, to stream data back to the client along the computation? i know this is possible using ASP.NET http://msdn.microsoft.com/en-us/library/aa528818.aspx if not, is it possible to implement it? as far as i understand the php soap facilities, they only allow my functions to return a big chunk of d...

Drupal - New groups/fields not showing for custom content types

I've created a couple new Content Types (City, Property) through the content types admin interface, and added some custom fields to those content types (Latitude, Longitude, Image, etc.). Now, when I go to create new content, I don't see any of the fields I've added; all I'm seeing are the default fields. Is there an additional step th...

How to validate expiry date on MySQL query

Here is my current mysql table id | file | expiry_date --------------------------------------- 1 | sample.zip | 2010-02-03 11:07:03 2 | sample2.zip | 2010-07-13 11:07:03 Query: SELECT * FROM download WHERE expiry_date` `how to validate here` I want to validate if expiry_date is expired the file cannot download....

DRIVER={InterSystems ODBC}

We need to access a InterSystems ODBC data source via php. The current default odbc driver is db2. Apache user can access datasource via isql on the command line using /etc/odbc.ini. Does anyone have any recommendations? This is what we have tried: 1) $conn = new PDO("odbc:DI01", "", ""); SQLSTATE[08001] SQLConnect: -1013 [IBM][CLI ...

Place variable in div id

I want to use an incremental div id, so that all my id are unique, therefore I can use jquery effects to modify them independently. I hope my question makes sense. If i need to elaborate please let me know. div id ="name_$id" ...

jQuery & drop down menu hiding divs (or textareas)

Hi, I would like to have a drop down menu with jQuery show and hide the different divs (or textareas) below it. Here's my jQuerycode at the moment: $(document).ready(function(){ $('#edit1').hide(); $('#edit2').hide(); $("#page_selection").change(function(){ $("#" + this.value).show().siblings().hide(); })...

GnuPG on Wampserver

Can you please tell me how do I install and use GnuPG on wampserver ? I seriously want that. I hope this question comes under stackoverflow. If not please close this but please dont downvote me :( ...

How to keep the Parent menu hovered while the mouse in child menu in a Dropdown Menu

I am trying to create a dropdown menu. It working well. I want the top menu when hovered truns into white color. when moving down to the submenus, the top menu should stay in white color. But the top menu turns into its normal original color. How to keep the parent menu hovered while moving mouse in the submenus. The code is here: HT...

PHP MYSQL upload file and store as blob

I am trying to create the functionality to upload a file in PHP and store it in my mysql database as a BLOB. I have run into a few issues that I need some help on. The first issue is how can I do this without using forms? I am currently using the codeigniter framework and I do not want have the form do anything on the action, I would p...

how to send email from php mail function using gmail account?

Hi All, I have to send email from my gmail account using php mail() function. I have read the phpmailer but I don't want to include any external apis. Please suggest. Thanks in advance. ...

Should I ping mysql server before each query?

So I was wondering whether I should or should not ping the mysql server (mysqli_ping) to ensure that the server is always alive before running query? ...

IIS + PHP + MySQL returns 500 - Internal server error

We're building a new server and using IIS 7. PHP pages a served just fine and dandy, but the second we use any code to access a MySQL database, the page hangs for a good minute and serves the following error: Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. ...

Superclass and Subclasses in PHP

Consider the following PHP class code class SuperIdea{ . . . static function getById($id){ new SuperIdea(.......); } . . . . } class SubIdea extends SuperIdea{ } The problem I face here is that when I call SubIdea::getbyId($t); the object returned is of type SuperIdea but I would like it to be of SubIdea.Is there any way to achieve...

Zend PHP Uploaded File Permission on Windows 7

I have Zend Server CE running on Windows 7. By Default I have Apache running as a Service, Log On as Local System Account. My upload Action saves an uploaded file to its Destination OK, however the permission on the file is set to only SYSTEM, Administrators and IIS_IUSERS. Once uploaded, I cannot open it or move it using PHP. I am us...

Redirect form in validation fail

I have a situation that if my form doesn't validate I need it to remove all but the first argument from the url. The reason for this is because the results of my form are displayed below the form in the content area. If the form doesn't validate I need to remove any previous results. I am have tried the following in my form_validate fun...

Tiny PHP "standalone" server (or framework) for local debug without Apache/Nginx/Lighttpd/etc

There's manage.py runserver in Django or ruby script/server in Ruby on Rails — those familiar with one of those frameworks should already get the idea what I'm looking for. They run tiny "standalone" web server, which is perfectly enough to debug the application locally, without any need for other software (Apache/Nginx/Lighttpd/etc). I...

MySQL and PHP: Atomicity and re-entrancy of a PHP code block executing two subsequent queries - how dangerous?

In MySQL I have to check whether select query has returned any records, if not I insert a record. I am afraid though that the whole if-else operation in PHP scripts is NOT as atomic as I would like, i.e. will break in some scenarios, for example if another instance of the script is called where the same record needs to be worked with: i...

mvc approach for cms application

Hello I have been tasked with creating a fairly complex web application in php, it is to be a custom CMS that would be able to replicate the functionality and features provided by well known content management systems like WordPress, Joomla or Drupal. I am to try and integrate as much of the functionality that these well known and powerf...