php

Unknown com_exception error

I'm writing an extension for the Yii framework which I have asked on here about before and someone is reporting the following error: com_exception Description Source: UnknownDescription: Unknown Source File C:\wamp\www\yiisample\protected\extensions\gallery\EGalleryBase.php(364) They are using WAMP 5, PHP Version 5...

Dynamic Routing with an MVC Foundation - i18n and l10n

I've recently been improving my skills with web programming to follow the saner and more maintainable MVC style of coding. However, one thing which I used to do with my "roll your own" framework was flexible dynamic routing based around mod_rewrite. This appears to be a sore issue with things like cakephp, zend, etc.. and its causing me ...

Populating accordion with database results help

Hello, I am building a system in which the user can build thre own navigation menu from a selection of catergories, the way it works is that is they click on 'Blog' they they can get an accordion titled 'Blog' and on expanding this they see all the blog titles, however as the moment, my application creates multiple accordions if there ...

How to retrieve DropDown value when it is posted?

When the Form is submitted, I can retrieve the DropDown text using $_POST['....']. But I want to get the DropDown value not the display member. How to get it using POST? ...

What's the difference between openssl_pkcs12_export() and openssl_x509_export() PHP functions?

This is probably a stupid question, but as far as I can tell there's not much difference aside the additional parameters in pkcs12 version. ...

Write one value to two text files simultaneously

Im using the following php to send the contents of an HTML <form> to a text file: $filename = "polls"."/".time() .'.txt'; if (isset($_POST["submitwrite"])) { $handle = fopen($filename,"w+"); if ($handle) { fwrite($handle, $_POST["username"]."¬".$_POST["pollname"]."¬".$_POST["ans1"]."¬".$_POST["ans2"]."¬"...

create more object is inconsistent ?

hi, My question may be stupid, but i want to clear my doubt. I am php, mysql developer. While coding one of table requires objects from class A for each row. Say it will create no of objects based on of row. Is this concept is inconsistent ? Class A { function __construct($userid) { } } class B { function action_add($userid) { ...

spl_autoload fails when script ran from command line

I know this has to do with the path not being quite right but it has me baffled. I can run my script with no problems at all from the browser but when I do to the exact same spot from a shell, spl_autoload complains and dies: Fatal error: spl_autoload(): Class db could not be loaded in... I am using the absolute path from the ro...

how to automatic crop to the right place of image with php

how can i crop the image with php with its exact to the face of user in image....here is my code.... function resizeImage($image,$width,$height,$scale) { list($imagewidth, $imageheight, $imageType) = getimagesize($image); $imageType = image_type_to_mime_type($imageType); $newImageWidth = ceil($width * $scale); $newImageH...

How to use a key and secret for verification?

On most API's such as facebook and bebo to use there API you must get a Key and secret, I am just wondering what is some good methods of doing a system like this. I will be using PHP/MysQL. How can I basicly verify a user key and secret are ok when there app sends there API request? I was thinking of storing them in mysql, which I wil...

How come sometimes images wont show when using the full path ?

I have this php code: $images=array(); $root = $_SERVER['DOCUMENT_ROOT'].'SV'; for ($i=1; $i<=$total_pics; $i++){ $images[]=$root.'/ad_images/'.$category.'/thumbs/'.$id_stripped.'_'.$i.'.jpg'; } And here I display the image: <?php for ($n=1; $n<count($images); $n++): ?><img src="<?php echo $images[$n];?>"><?php en...

Twitter API - Update Profile

Im looking at the Twitter API: http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0update_profile I want to update my profile via PHP. Specifically my location: San Francisco, CA Im not looking for anything fancy, just a way of calling the XML, checking its contents, then writing in a new value if appropriate. Can anyo...

How to un-nest nested lists in php

I have a nested unordered list like this (simplified version / the depth is variable) : <ul> <li> <a href="#">Root</a> <ul> <li> <a href="#">Page A</a> <ul> <li> <a href="#" title="Page A1">Page 1 2</a> </li> ...

How to make the browser display image with same name and not the cached one ?

I have solved this with PHP by adding the 'time()' to the img src tag. But how is it done with Javascript, same way? Here is my code: th_div_html+= "<img src='"+path_th_img+"' class='shadow2' style='margin:7px;' onclick='imageShow("+z+");'>"; I'm better with PHP than javascript so I need your help on this one. How can I add somet...

PHP Function Help

Here is the function im trying to us, its held in a file called function.php public function updateProfile($name = null, $email = null, $url = null, $location = null, $description = null) { // validate parameters if($name === null && $email === null && $url === null && $location === null && $descriptio...

PHP verify PayPal Donation

How can I verify paypal donation? In user panel I have donate button. And once someone actually donates I want to do something to him. But I do not how to check if user actually donated or just clicked donate button. ...

How do I show all combinations?

I searched, can't find anything: How do I do this? I enter $x = 'tlagre'; I want it to return every single letter combination, down to four. i.e. - "tlagr" "gratl" "lat" "rat" I've found some that can do this but none will do every number of letters (they all just do the exact same # of letters as given in $x ...

How to authenticate your server to my server when a user loads your page in PHP?

user signs up for a key and secret from my site, then they can send/receive from my REST server. Where I need help is when a user interacts with the REST, how can I determine if they are authenticated using THEIR key and secret? Basicly this will be for a social network site app area. I have seen that many social networks have an ap...

Find out for how long the script was running for in seconds?

I have a script which runs in a 'while' cycle. I need to determine for how long the script was running for and if it is over 10 seconds terminate it. The code I wrote returns weird decimal values (one second it might be '5.342...' and other it might be '903.322...'). Can someone tell me how can I achieve that? $timer = microtime(false);...

How do I format numbers to have only two decimal places?

I want that real numbers would be for example 12.92, but not 12.9241. Is it possible to do like that? ...