php

how can i search a lots of .js and .php files for a specific phrase?

Windows has a go at it but only gets a few when i seach a directory. Is there an IDE or similar that allows for searching within the files of an entire directory? for example, if I need to make sure no files require to a redundant class (old_class.php) I'd like to search for 'old_class.php' or alternatively if anyone knows a...

PHP: Three item validation comparison

I have 3 featured product panels on the homepage, and I'm writing a CMS page for it. I'm trying to validate the items. They are selected via three <select> elements, featured1, featured2 and featured3. The default is <option value="0" selected>Select an element</option> I need to validate the $_POST to ensure that the user hasn't selec...

Is there a simple PHP development server?

When writing web apps in Python, it brain dead easy to run a development server. Django and Google App Engine both ship with simple servers. The main feature I'm looking for is no configuration. I want something like the GAE dev server where you just pass the directory of the app as a parameter when the server is started. Is there a r...

why this sql code dont work

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <title>اول اسكربت باذن الله</title> </head> <body> <table width="100%" border="1"> ...

Calling a static method on a class known by name?

Hello! Is there any way to obtain this effect in a PHP version prior to 5.3? class A { public static function x() {print 'ok'; } } $className = 'A'; $className::x(); Thanks! Palantir ...

Url conversion in PHP

i have the following url in a html page- /delete/Release 1 But when i am trying to print it it comes in following manner- /delete/Release%201 Can anyone suggest how to convert this hex value of %20 into a white space in PHP. ...

PEAR mail not sending to some email addresses

I have a PEAR mailing script that is used to send newsletters from a clients website. I've used the same code before to produce another newsletter system and it has worked well and been used to send emails to various addresses, however our latest client hasn't been receiving any of the emails. When the newsletter is sent from the site t...

How to hide URL from users when submitting this form?

I have a form with many many fields... When submitting these fields, I use the POST method which hides the actual variables passed along to the PHP page. However, I can't get rid of the complete link. Changing from GET to POST did make all the form fields invisible in the URL, but this part is still visible: mydomain.com/bin/query# ...

Zend framework controller action helper

I am getting fatal error after adding the action helper class. I am trying to load layout corresponding to called layout. Following is my code snippet: First of all i added a helper class under application/controller/helpers: class Zend_Controller_Action_Helper_Layout extends Zend_Controller_Action_Helper_Abstract { public $pluginLoad...

Displaying Category Articles in Joomla Home page

Hi guys, I am wondering about displaying categories in home page. I have 5 different categories under 1 section. And All categories have as many articles as they have. Now I want to show the category title and its few articles in home page... I am not sure about which module or component to use OR can we do it self? ...

How to resize an image using PHP?

Possible Duplicate: Resize a picture to a fixed size How to resize an image in PHP? ...

Image upload and jCrop and codeigniter

Hi There, I am trying to build a system that allows a user to select an image from their own computer, and crop it using the jCrop tool from jQuery. My question is can I show the image the user has selected from their system without uploading it to a system, I dont really want to do two uploads, unless I can do the first upload silent...

PHP exec() not executing batch files

I tried googling for this issue and found many people with the same problem but no solution. $result = exec("C:\\Ruby191\\bin\\lessc.bat less\\$file", $output); Here result is an empty string and output an empty array. Same thing with: $result = exec("cmd /c C:\\Ruby191\\bin\\lessc.bat less\\$file", $output); I am sure the ...

Zend_Controller_Action_Exception from preDispatch()

How to I redirect to 404 page ("page not found") at preDispatch? Normally within action I can simply write: throw new Zend_Controller_Action_Exception('Page is not found!', 404); And it forwards to the appropriate page. How do I make it work for preDispatch? ...

How can I "flip" an image using PHP?

Possible Duplicate: How to resize an image using PHP? Here's what I've tried: $image = "images/20100609124341Chrysanthemum.jpg"; $degrees = 40; // Content type header('Content-type: image/jpeg'); // Load $source = imagecreatefromjpeg($filename); // Rotate $rotate = imagerotate($source, $degrees, 0); // Output imagejpeg...

How to convert all characters to their html entity equivalent using PHP

I want to convert this [email protected] to &#104;&#101;&#108;&#108;&#111;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109; I have tried: url_encode($string) this provides the same string I entered, returned with the @ symbol converted to %40 also tried: htmlentities($string) this provides the same string righ...

update profile photo(API)

I want to update users profile photo. require_once('facebook.php'); $facebook = new Facebook('..', '..'); $facebook->require_frame(); $user = $facebook->require_login(); //At first I get it $fql = "SELECT pic FROM User WHERE uid=\"$user\""; //this get profile url $fql_result = $facebook->api_client->fql_query($fql); //here // get ph...

mysql_real_escape_string() just makes an empty string?

I am using a jQuery AJAX request to a page called like.php that connects to my database and inserts a row. This is the like.php code: <?php // Some config stuff define(DB_HOST, 'localhost'); define(DB_USER, 'root'); define(DB_PASS, ''); define(DB_NAME, 'quicklike'); $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die('ERROR: ' . m...

how to show square root symbol in image using gd library

I'm using php and gd library to draw a triangle. I'm able to draw triangle and add text to it(using imagettftext). But now i'm stuck with a problem. The two sides of the triangle are 'x' and 'x+2'. So hypotenuse will be sqrt(x^2+(x+2)^2). But i dont know how to show this equation using proper mathematical(i mean using square root symbo...

php error tracking

hi to all experts, i am using php and mysql for my projects with pear package. i want to track bugs in my programs . is there any way to track a bug in pear package or php5. suppose in my program any error or warning is generate then i want to track this error and store into database. any one have idea about it. thanks in advance...