php

Restrict characters used in a string

How do I restrict a string to whitelisted characters? // "HOW am I to understand; this is, BAD" $str = restrictTo($str,"0-9a-z,. "); // " am I to understand this is, " Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :( ...

Shopping cart in php and how to integrat PayPal in it?

Hello Friends! I want to develop a shopping cart in php. I also want to integreate online payment facility using paypal. Which allows payment thrugh credit card and decbit card. So Please tell me how to integreate paypal in my own shopping cart to achive secure transaction? Thank You! ...

Cake PHP tutorials

I want to know is there any cake php tutorial for beginners. I searched for it but I didn't get a good one. ...

insert a time-stamp value in my db by php

I'm using oracle express and in my application i would insert a time-stamp value in my table: $marca = date('y-m-d H:i:s'); $query = " INSERT INTO SA_VERSIONE ( ID_ACCETTAZIONE, MARCA_TEMPORALE, TESTO, FIRMA, MEDICO) VALUES ('$id', '$marca', '$testo', '$firma', '$medico')...

Import excel files with image in php/mysql

Hi all! I want to make an import script which allows users to upload their excel file (extension not important) to my php application. The application should reconize a list of items (so far so good). The difficulty in this case is that the excel files contain images...I've read information about phpexcel library but it does not say anyt...

To retrieve value from a text box in a form (view) to controller in cake php

How to o retrieve value from a text box in a form (view) to controller in cake php? ...

PHP XML encoding

I need a function that will convert € or chr(0x20AC) or chr(8364) to € without having a static map. I tried using htmlentities(), but it only seems to work for the symbol itself and it converts to €. ...

How to set file permission for linux host under windows ?

For example, i want a file has permission of 644 automatically when i uploaded it to my linux host, before upload, it is under windows. How could i do this? Btw, i use Filezilla for upload Updated: Before post this question, actually, i ever thought it is impossible too. But, as i has many wordpress sites, i remembered that i never nee...

How to Add Tab to dotProject's Project page?

I'm a newbie in PHP. A friend of mine want me to help him set up a Project Management intranet with dotProject. The first request I receive from my friend is add a new tab on Projects page. Does anyone can give me clue on how to do it, since lack of documentation on dotProject website. ...

Magento order status change events

Hi people, I want to change via web service a remote inventory, I know that via Event Observer Method can triger my code, but I don't know which event is useful to complete my task, like on_order_complete, is there an updated list of events or more documentation? ...

How to set utf8 in the auto-generated PHP code of flash builder 4 ?

HI, PHP problem here (I think): I've just created a Flex (Flash Builder) project with a datagrid linked to a database - the database is all utf8. When I run the project using the auto-generated code in flex4, the non-English part comes like ????? while the English part comes fine. The auto-generated PHP code uses mysqli. I've tried: ...

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

I am getting the following error when i upload the file to my host server. Same thing works fine in my machine running xampp Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home1/mobyhold/public_html/admin-arabiadc/admin/_product.php on line 1 <? include "../include/manager_shared.php"; if(isset($_REQUEST['subm...

Checking if an overridden parent method exists before calling it

How would I go about ensuring that the overridden parent method exists before I call it? I've tried this: public function func() { if (function_exists('parent::func')) { return parent::func(); } } However the function_exists never evaluates to true. ...

Best IDE for debugging and Code Completion in CakePHP

Hi, I am new to CakePHP framework. Does anybody have any experience with a free IDE for Uuntu which can perform code completion and most importantly ability to debug CakePHP code? Any responses would be greatly appreciated. Thanks ...

javascript send one way message to php

How can I use javascript to send a one way message to php? I would like to get the browser information from javascript and just send it to php in the background. I know I can get some of this from php, but I'd rather use javascript. Is there a way to do this without a framework like jquery? ...

Wrong output from date()

I am getting the date from my MySQL database and that date is correct, but when I use the date() function the minute part is stuck at 6 minutes. MySQL is returning 2010-06-15 09:59:18 Then in PHP I use this code ($row[4] is from my while loop): date('M d,Y H:m A',strtotime($row[4])) When I echo this out I get: Jun 15,2010 9:06 AM I...

how to use php to include an image in a word file?

Hi all! Somebody has asked me to make an app in php that will generate a .doc file with an image and a few tables in it. My first approach was: <?php function data_uri($file, $mime) { $contents = file_get_contents($file); $base64 = base64_encode($contents); return ('data:' . $mime . ';base64,' . $base64); } $file = 'new.doc...

zend framework - view not rendering

Hi My zend framework render function returns: Warning: include(C:\wamp\www\cms\application\modules\default\views\scripts) [function.include]: failed to open stream: Permission denied... It's being called in a postDispatch function on the controller, but that doesn't matter as no matter where i put it, it fails. Any ideas? My view an...

How to I post to Facebook user's news stream using the new PHP Graph API SDK?

I have seen example code in javascript for updating a user's newstream but I want to do it automatically from my php webapp when a certain event occurs - In javascript you would use the stream.publish method. I see no examples anywhere for the php graph api library though? ...

php.ini on goDaddy

Hey all, I've got a little problem on a goDaddy server. I have a php script (ajaxCRUD) in which there's an upload field, and I can't get it to accept file over the default limit. I always get this (when I output the $_FILE[$fieldname]) : array(5) { ["name"]=> string(13) "children2.mp3" ["type"]=> string(0) "" ["tmp_name"]=> string(0...