php

redirect to paypal payment

Evening all. What I am wanting to do is after a user has clicked on a 'buynow' button for paypal, firstly go to a page that stores the items the have bought in a db and then redirect to the paypal payment. This is what i have: <?php if(isset($_POST['cmd']) && isset($_POST['hosted_button_id']) && isset($_POST['diskSpace']) && isset($_P...

Doctrine-CLI database creation issue.

I have Doctrine setup in my Zend Framework application and I built my schema YAML file. But when I tell Doctrine to build the tables it says it does but it doesn't actually make them. It creates the models, and will create the DB but it will not populate the DB with the tables and throws no errors. Does anyone have a guess or know why th...

how to zip by exec command line through php

Hello, I have a ubuntu server. How can I zip files through executing a command line to zip from my php script I want to zip the file because the file sizes are too big and zipping it through php will cause more load on server. Thank You. ...

Flex and Twittter data visualization

Hi , Is it possible to run the .json file which is has status data from twitter and run it with flex to create a visualization of the data ? ...

<strong> tag using TCPDF

I'm having a hard time generating pdfs with tcpdf. Generally, everything works fine, but, sometimes, when I use the < strong > tag, everything gets messed up. I have 2 examples: http://ontheweb.com.br/pdf/ex2.pdf Can anyone help?? ...

Assigning one of multiple values based on what exists

In Perl, if I want to assign $myVar a value of $var1, $var2, or $var3, based on which one evaluates to true, I would code the following: $myVar = $var1 || $var2 || $var3; I am working on separate projects in both Python and PHP, and I have not figured out how to code this situation as concisely in either language. What is the best wa...

the best way to check if a url is valid ?

hi, i want to use php to detect the string which is called $myoutput & check it if it's a valid link syntax or just a normal text. the function should recognise all links formats including the ones contains GET parameters it is preferred to not call that link to see if it's a valid link syntax by doing CURL or file_get_contents. maybe...

"Cannot use string offset as an array" error

Hi folks, Can't figure what is wrong here. Read what folks are saying here: http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/ and here: http://stackoverflow.com/questions/1873970/cannot-use-string-offset-as-an-array-in-php I have print_r()-ed the actual values in $entries (coming from Go...

Language recommendations for expanding programming skills (For a semi-experienced software developer)

I have little (<1 year professional) experience with Perl Groovy/Java I have limited (<2 year professional) C I have decent experience (>= 6 years professional) with PHP SQL I have hobby experience with C++/DX9 (some simple windows games/demos) Obj-C (a few iphone app's) ASM (http://www.amazon.com/Assembly-Language-Intel-Ba...

Keep a Select Box Selected after Submit

On my website, user's are allowed to filter games by Genre. When a user chooses a genre from the select box and hits submit, the page uses GET to see what the filter was. Now the filter works fine, the problem is that the select box's selection goes to the default one (Which says "All".) I want it so that after a user submits their filt...

hookbox for comet?

i´ve read that one of the implementations of comet in your php application can be hookbox. however, on their page i can´t download the stuff. http://github.com/mcarter/hookbox is the project dead? ...

PHP session permission problem

Hi I'm trying to initialize a session but i get this error: Warning: session_start() [function.session-start]: open(/tmp/sess_7af3ee9ec1350680bedcf63833d160bd, O_RDWR) failed: Permission denied (13) The session.path is set to /tmp with 777 perms. I try to edit the session.path to "0;777;/tmp" but the session files are created with...

How to use arrows to change page in jquery?

With jquery I need to do something like this... A user will follow a link to a users photo gallery on my social network site. A photo will load on the page and comments related to that photo with paging will be under the photo. Basicly this photo and comments will be a seperate page that is loaded in with AJAX, then when a user pres...

How do I eliminate the views/scripts folder?

Let's say I'm tired of having to put my page template folders under views/scripts and want to just put them under views, leaving out the "scripts" part of the path. How can I alter the config of ZendFramework to permit me to do that? ...

Sorting multidimensional array in PHP

Hi guys, I am currently creating a sorting method that consists of values from an mysql query. Here's a brief view of the array: Array ( [0] => Array ( ['id'] = 1; ['countries'] = 'EN,CH,SP'; ) [1] => Array ( ['id'] = 2; ...

Call to undefined method PDO::bindParam()

Can someone tell me why I am getting this error? Call to undefined method PDO::bindParam() Here is what I have, taken right off of PHPs site for stored procedures $stmt = db::getInstance(); $stmt->prepare("CALL delete(?)"); $stmt->bindParam(2122, $return_value, PDO::PARAM_STR, 4000); $stmt->execute(); print "procedure returned $return_...

PHP, Return everything to the left, strrchr() ?

Hello! The following code returns everything to right of the last occurrence of a dash: $string1 = 'some-random-string-123456'; $string2 = strrchr($string1, '-'); echo $string2; output: -123456 is there a function that will return everything to the left of the last dash? so the out put would be: some-random-string Thanks! ...

Is it a good idea to internally invoke the constructor in a static method?

Let's say for example I had a localised date class where the normal usage was to create an object. $d = new Date(mktime(), 'MM-DD-YYYY', array('locale' => 'es')); Now, what if I didn't want to always create a new object explicitly, but instead wanted something more along the lines of... <p>The date is <?php echo Date::formatDate( mk...

better implementaion of a global Zend_Log instance?

Is there a better way to have a globally accessible Zend_Log object? In Bootstrap.php I'm doing: protected function _initLogging() { $logger = new Zend_Log(); $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../app.log'); $logger->addWriter($writer); Zend_Registry::set('log', $logger); } Then throughout the a...

php function to convert Unix timestamp into minutes or hours or days like digg?

Hi, i want a php function to convert a unix time stamp to like this: 15 seconds or 45 minutes or 3 hours and not like this : 2seconds, 5minutes, 9 hours i want only one value like digg ( made popular xx xxxxx ) Thanks ...