php

When I work with PHP classes nothing happens...

Below is some code I've been trying, and I've messed about with it to include die()'s and echo()'s here and there but nothing happens, if I try running someone else's class code with instances of the objects it works fine, but I can't see what's wrong with my code. class Form { private $form_method; public function __construc...

mysql Char vs varchar

I know the differnce between CHAR and VARCHAR, CHAR - Fixed length VARCHAR - Variable length (size + 1 byte) But I wanted to know what was the purpse of the having the option for a varchar length e.g. VARCHAR(50), VARCHAR(100), VARCHAR(255) This seems pointless to me because the actual space used depends on the value stored i...

PHP limit text string NOT including html tags?

Here's what's NOT working for me: <?php $string = 'I have a dog and his name is <a href="http://www.jackismydog.com"&gt;Jack&lt;/a&gt; and I love him very much because he\'s my favorite dog in the whole wide world and nothing could make me not love him, I think.'; $limited = substr($string, 0, 100).'...'; echo $string; ?> I want to...

convert php to ruby

I changed the Ruby snippet and now it works, I had forgotten to add the md5 part int he previous post, sorry. Afterwards I retested the PHP snippet as well, and both outputs are the same now. Here is what I have so far: PHP: "Inx ".base64_encode('Jon').' '.base64_encode(pack( 'H*' , md5($message."werty"))) Ruby: md5 = Digest::MD5.d...

multilanguage website - Zend:How should be form element names, table column manes, free text etc.. translated ?

Hi, How should be form element names, table column manes, free text etc.. translated in multilanguage website on Zend Farmework. The body of websites already translated and stored in database but the rest not. Example for parts that not translated:Name, Phone: <form> <label>Name: </label> <input type="text"> <label>Phone: </label> <in...

Measuring a string in PHP?

ASP has a MeasureString function that returns the width, in pixels, of a string given a certain font/size. Is this possible in PHP? ...

Taxonomy images in Drupal, Is there a way to manually add a thumbnail image?

We have the taxonomy image module installed, uploaded some taxonomy images a made a happy dance. Thumbnails where needed so we used the taxonomy_image_display() which does a fairly good job (although constrained to 150 x 150px). What we need now is a way to manually add a taxonomy image thumbnail for those special cases where the designe...

PHP, MySQL & JQuery Question?

I have this script that displays all the users images which i will display below. My question: Is there a way I can display the first 10 images in the MySQL database and have the script hide the rest of the users images until the user clicks the link <a href="#">View All</a> and have the rest of the images slide down when the user click...

How to use jQuery to set value on screen rather than use alert?

I am using the code that I will post below. I generates the password and works fine. Only problem is that it shows me the regenerated password in the alert box. I want to echo it on the screen. how can I do that. Thanks Using jQuery fancybox and php $.ajax({ type: 'POST', url: '/processPassword.php', data: 'newPass...

PHP - cut a string after X characters

What's the fastest way to trim a string to a specific number of characters, and append '...' if needed? ...

Lightbox in Wordpress

Hi, I want to have lightbox gallery in my Wordpress site.. How do i do that, because with simple examples it doedn't work. Thanks ...

Retrieveing the Query that Created a Doctrine_Collection

I have a Doctrine_Collection object that was created with code that looks something like. $collection = Doctrine_Query::create() ->from('FooBazBar') ->where('widget_id = ?',$some_var) ->execute(); Short of writing it down somewhere, is it possible to to retrieve the where clause that was used to create the collection? That is, I want...

jQuery ajax redirect

Guys i have a little problem when i submit my form the page gets redirected to the result, instead of staying on the same page. On the server-side i have a PHP that spits an simple status codes like this: echo '<span>Success/Error</span>'; exit; and this is my request: jQuery.ajax({ type: "POST", url: "ajax.php", data: dataStr...

Eclipse PHP Zend: running old script even though it has been modified and saved?

i am running eclipse php with zendserver and debugging with zend debugger. that all worked. however, i just reinstalled windows 7 due to a computer crash and dragged over my eclipse folder from my old windows to my new (current) installation of windows. when i edited my old file, index.php, i saved it then ran in debug mode, but it look...

cakephp form data , sessions and reusing a view between 2 methods in same controller

Newbie php question I have a textbox where a user searches for something and a bunch of results are returned (search() method in the controller) when i click on a link, i want some more information to be displayed (searchMore() method in controller). Questions 1) How can I go back to the the same search.ctp page instead of creating a ...

Multiple Queries = joined to create a single child-parent query result

hi, I'm not sure if this is an sql question or a combined sql/php question, so if i'm in the wrong question area, I apologize in advance. I'm use to mssql and not sure how to exactly do this within mysql however... i have a number of tables, all with left joins to create individual sql queries query 1: SELECT a.itemID , b.t...

Manually refresh project files on local server? (Netbeans)

I have a Netbeans PHP project set to run on a local server. I added some files in the filesystem; Netbeans detects and shows the changes in it's project view, but does not propagate the changes to the local server (based in a different folder). Hence project files on the local server are missing or out of date. Can Netbeans manually ref...

Is there a SQL technique for ordering by matching multiple criteria?

I have several tables that get JOINed together to form a table with columns designID garmentID colorID sizeID imageID I have a function that looks like this [variables in square brackets are optional]: getProductImages($designID, [$garmentID], [$colorID], [$sizeID]); I want it to return all imageIDs that match $designID in the foll...

Javascript not loading for php generated form

I am using phpBMS, and have made a form, similar to the sample provided. Using the provided input fields, I have made a basic dropdown list containing two items, and a checkbox. I want the checkbox to be selected automatically when one of the options from the dropdown box is selected. Jens F, provided me with a solution to how I shoul...

PHP include html page charset problem

Hello, after querying a mysql db using the code below i have generated an html file: $myFile = "page.htm"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $row['text']); fclose($fh); On the msql db the text is encoded using utf8_general_ci. But i need to include it in a php web page as shown below: <?includ...