Skip to content

Tag: php

Validate UK short (outward) postcode

I’m using this validator: From this link. But I want to be able to validate postcodes like ME20 and TN10 instead of a full blown ME20 4RN, TN0 4RN. This is the part of the postcode known as the ‘outward code’. Can someone help me out with the regex? Answer you can use my updated regex to sol…

How to read file properties with PHP?

I’m wondering if there is a way I can store data like the author, in a file? Like you right click on a file in Windows, and you set properties of it. Can I read those properties in PHP ? What I really want to do is, I want to upload images to a directory, and when I’m showing the

How to pass variable via AJAX / jQuery?

I would like to know how do I pass a variable to another php-file via AJAX? The variable that has to be passed is called: The problem is that my form in ‘pm_form.php’ has no access to the variable ‘$id’. My script looks like this (this script fires a modal-window and that modal window …

Calling other function in the same controller?

I’ve this controller, and the function read($q) return error Call to undefined function sendRequest() I’m assuming it’s because I’m referencing the function in the wrong manner, but I can’t find any explanations for how to do it. Answer Try: Since PHP is not a pure object-oriente…