php

How to close unclosed HTMl Tags?

Whenever we are fetching some user inputed content with some editing from the database or similar sources, we might retrieve the portion which only contains the opening tag but no closing. This can hamper the website's current layout. Is there a clientside or serverside way of fixing this? ...

Implementing Tagging System with PHP and mySQL. Caching help!!!

With reference to this post: http://stackoverflow.com/questions/2122546/how-to-implement-tag-counting I have implemented the suggested 3 table tagging system completely. To count the number of Articles per tag, i am using another column named tagArticleCount in the tag definition table. (other columns are tagId, tagText, tagUrl, tagArti...

Unable to replace & with & in XML uses Preg_replace in PHP

Hi, Need help here. Am not able to replace the '&' with '&' uses Preg_replace in PHP. But, if I do it manually (edited) on the xml file, it works out fine. Here are the sample: $XMLCharactersPreg = "/[&<>\"\'()^*@+]/"; $XMLPregReplace = "&amp;"; $d_Description = "50% offer & 20% further reduction for member"; if (preg_match($XMLChara...

Check variable if explode-able in PHP

Not sure if there is a way to check a variable if it is explode-able or not... I have a database of city names some are one word cities and some are multiple word cities EX: Chicago, Los Angeles I keep getting an error when use "implode" when a city name is one word, so I tried using "count" and using an if statement... not having any...

GPRS remote printer

We have a custom remote printer designed with GPRS module. We now need to communicate with the device over the web. We have to send messages and receive messages from the remote printer, can i do this using Java or PHP. How do i communicate through GPRS? Will socket communication work? ...

Facebook Like Status Message Box in Drupal

I am building a Drupal website and want to have a facebook like box which create a content namely quotation in my facebook. How can I do this in drupal.. Below the box I want to display other quotations... ...

PHP foreach help

Hello I have an array that looks like this, Array ( [cfi_title] => Mr [cfi_firstname] => Firstname [cfi_surname] => Lastname [cfi_email] => [email protected] [cfi_subscribe_promotional] => [cfi_tnc] => [friendsName] => Array ( [0] => Firstname 1 [1] => Firstname 2 ...

Fatal error: Cannot use string offset as an array

Array ( [0] => Array ( [auth_id] => 1 [auth_section] => Client Data Base [auth_parent_id] => 0 [auth_admin] => 1 [sub] => Array ( [0] => Array ( [auth_id] => 2 ...

magento show subcategory

HI, Now i get all categorys and subcategory. How get only subcategory? <?php foreach ($this->getStoreCategories() as $_category): ?> <?php $_menu .= $this->drawItem($_category) ?> <?php endforeach ?> ...

Doctrine generate-migrations-diff and migrate

Hi guys, I have tried to execute the cli command ./doctrine generate-migrations-diff and a version file has been created correctly in the right folder. The message is: generate-migrations-diff - Generated migration classes successfully from difference Then I try to execute another cli command ./doctrine migrate and a message appears t...

Adding metadata to PDF via PHP

I need to augment a PDF with a custom metadata field on download in PHP (5.3). I have been looking at the pdftk library, but I can't get my head around how I would get PHP to interface with it on our (Ubuntu) web server. The deprecated PDFInfo library seems like a dead end. Is there a simpler/easier/better solution? Thanks ...

Can I use file_get_contents() to compare two files?

I want to synchronize two directories. And I use file_get_contents($source) === file_get_contents($dest) to compare two files. Is there any problem to do this? ...

Trailing slashes: yes or no?

Hello. I'm working on a new project, using Apache's mod_rewrite and PHP to get pretty URLs. Here's what my URLs look like: http://example.tld/foo/bar/1/etc Notice that there's no trailing slash (that's the way I write it in the href attributes of <a>s). However, I'm also allowing http://example.tld/foo/bar/1/etc/ (trailing slash). I...

PHP script cannot be read in PLESK

Dear All, Any help would be appreciated since I really can't figure out what happen. I made some PHP scripts that are working normal locally, but when I upload into PLESK suddenly the code inside the tag is not being read and the same goes to the HTML code below it (only the html code that is above the php tag is being read). Thanks ...

(PHP) Converting an array of arrays from one format into another

Hi, I currently have an array, created from a database, an example of which looks like the following: Array( [0] => Array ( objectid => 2, name => title, value => apple ), [1] => Array ( objectid => 2, name => colour, value => red ), [2] => Array ( objectid =...

Jquery, adding input element

hi everyone, i have successfully added input element into div, which looks like this : $(document).ready(function() { $('#jumlah').change(function() { var jum = $('#jumlah').val(); for(i=1;i<=jum; i++){ $('#jawaban').append('<label>Jawaban Soal ' + i + ' : </label><input type="text" name="jawab'+i+'" id="jawab[]" size="2" maxl...

How to unset the session in PHP Using Javascript?

How to unset the session in PHP Using Javascript? ...

problem in display of hindi words in multilingual site

I am developing one php site in 8 languages . For that i have implemented following method 1. I have set Collasion of the database to utf-general-ci . 2. For the hindi font I have installed SHusha font on my localhost. 3. I have created .eot file of shusha.ttf 4. embed the .eot file in ccs. 5. Also created .pfr file and inclued in the p...

PHP MySQL Insert Help

Hey I am trying to make a page that inserts some strings into a MySQL table but it just dosn't seem to be working for me. Here is the code I am using at the moment. <?php mysql_connect($address, $username, $password); @mysql_select_db($database) or die("Unable to select database"); $query = "insert INTO user (movieid, moviename)('" . $i...

Exporting data to an accounting system for billing and invoicing - is there any generic standard practice?

Hi guys, I've built a web application which basically logs work that has been done upon projects plus maintain resources used etc. What I need now is to set it up so that projects can be billed. Billed such that - each task that has been undertaken in a project is regarded as a billable service. Instead of building my own invoicing syst...