php

Singular Value Decomposition (SVD) in PHP

Hello! I would like to implement Singular Value Decomposition (SVD) in PHP. I know that there are several external libraries which could do this for me. But I have two questions concerning PHP, though: 1) Do you think it's possible and/or reasonable to code the SVD in PHP? 2) If (1) is yes: Can you help me to code it in PHP? I've alrea...

Alternative of ASP.NET's UserControls in PHP?

I have developed many web applications in ASP.NET in which I have make use of UserControls to manage header footer and any other common part of a web page. Now I am developing an app in PHP, is there anything which I can use as an alternative of UserControls?? How I can implement the similar concept in PHP? Thanks? ...

Problem With Smarty caching !

i used smarty in my projects when i enable caching it’s not working . because i use this structure : index.php — display(index.tpl) index.tpl —- {include file=$page_center} ?module=product — $smarty->assign(”page_center” , “product.tpl”) ; ok ? i’m in product.php so poduct.tpl must load in center of index.tpl . whe...

How would you structure Zend_Auth & Zend_Acl in Zend Framework to obey having a Thin Controller?

There has been a fair bit of talk/debate lately in the Zend Framework community about thin controllers. Apparently there is a tendency of ZF users to view the Model as nothing more than the gateway to the database. The argument is that Models should be "fat" and do more of the work and Controllers shouldn't be chaining methods and doin...

Is it worth using MYSQLI_CLIENT_COMPRESS when the db is on another machine?

I have two machines on amazon ec2, one with a drupal installation and another one with the mysql database. I wonder if it's worth to patch drupal to activate mysql client compression. Are there any caveats? ...

$_FILES array empty in php when uploading .zip, while .jpg works fine

I am running php 5.3, and have bumped into a problem I've not encountered before. I have an upload form (yes, enctype is set to multipart/form-data), that posts stuff to a php page. The php installation has uploads enabled, and upload_max_filesize is set to .5GB. Uploading pictures (I've tried up to 50 at a time) works fine. Uploading...

CakePHP password field is empty

Hi, I am implementing an authentication component, This is my registration page create('User',array('action' => 'login')); echo $form->input('primary_email',array('size'=> 32)); echo $form->input('password',array('label' => 'Password')); echo $form->input('remember_me',array('label' => 'Remember Me','type'=>'checkbox','ch...

Problem With sending Email in , Unknown Characters !

i'm having Problem with sending Email in Persian. It's Ok on gmail, all of the text shows fine. But in the orders like yahoo, cpanel webmail, etc I'm getting unknown characters. What should i do to fix this? Here is my code: <?php function emailHtml($from, $subject, $message, $to) { require_once "Mail.php"; $headers = array ('...

How to prevent access to certain URL requested pages?

How to prevent access to certain URL requested pages? If i have form.html, processFrom.php and getResults.php in my webapp root, even though processFrom.php does not echo any content, how can i prevent the user from accessing this file by typing in the URL? ...

MySQL INTO OUTFILE overide existing file?

I've written a big sql script that creates a CSV file. I want to call a cronjob every night to create a fresh CSV file and have it available on the website. Say for example I'm store my file in '/home/sites/example.com/www/files/backup.csv' and my SQL is SELECT * INTO OUTFILE '/home/sites/example.com/www/files/backup.csv' FIELDS TE...

PHP Soap Client: How call WebService with Derived class as parameter?

I'm using PHP 5, and want to call a webservice that is defined sort of like this: webmethod ( AbstractBase obj ); I'm using a SoapClient (wsdl-based). The web method is expecting a subclass of AbstractBase. Yet, in PHP, calling the soap method gets me this error: Server was unable to read request. ---> There is an err...

how to use dom php parser

Hi I'm new to dom parsing on php: I have an html file that I'm trying to parse. It has a bunch of div's like this: <div id="interestingbox"> <div id="interestingdetails" class="txtnormal"> <div>Content1</div> <div>Content2</div> </div> </div> <div id="interestingbox"> ...... I'm trying to get the contents of ...

PHP: User Login System / Check if User has acess to a page

Hello guys. This is a bit noob question but.. Its happens sometimes to everybody. I never worked with $_SESSION so once i need a login system i've used Dreamweaver to do one for me. I have a page where he asks for user name and password. And if loggin successful its goes to other page. Else it says in the login page. The problem its t...

Secure login

If I'm trying to secure my login method. From an unsecured server the user enters their login credentials into a standard HTML form, which is POSTing to a script on a secure server. This script does all the necessary login functions, and sends the user back to the insecure server. My question boils down to this: Is the login informat...

Trying to figure out a way to have a Google map pop-up from inside Facebook.

Here's the deal: I have an fb app I wrote mostly for my own benefit. (you can play with it at http://apps.facebook.com/bicyclelog/log.php?uid=0 if you like...) Anyway, the problem is this: Facebook lobotomizes Javascript. Google Maps is Javascript based. Therefore, I have to put the map in an iFrame. But FB puts restrictions on iFrames,...

How do I compare two DateTime objects in PHP 5.2.8?

This seems like something that should be pretty straight forward, but I have been stuck page faulting this problem for a while now, so here goes. Having a look on the PHP documentation , the following two methods of the DateTime object would both seem to solve my problem: DateTime::diff : Get the difference and use that to determine w...

Can't install zend debugger

Hi, I'm trying to install zend debugger in my Ubuntu 9.04 machine, I've done it in win. but not in linux, I hope you could help me, this is what I've done: 1)Copied the file ZendDebugger.so to /etc/php5/apache2 (didn't choose this folder for anything in special). 2)Added this lines to php.ini: zend_extension="/etc/php5/apache2/ZendDeb...

What's the easiest way to retrieve the contents of a webpage via PHP?

Hi, I want to write a function to retrieve the contents of a webpage so it works like: $url = "example.com"; $pageContent = RetrievePageContent($url); What would be the easiest way to do this? Thanks in advance for your help! ...

Storing plain text passwords

Hi, I'm working on an AIR application with a web back end. I need to store passwords for other websites (like how some websites do). What is the best way to store those passwords and transfer them between the PHP back end and the AIR application? Thanks, ...

Authentication without a username and a password

Hi, I'm working on an AIR application that connects to facebook. After the user connects to his facebook account he should be able to do stuff to the account linked to the facebook account he's logged into. Typically, you'd have a login() function that accepts a username and a password, authenticates them and sets a cookie. In my case,...