Tag Archives: function

PHP check postcode is in list

I have a list of postcode areas (left hand part only) as below:

IV1-28,IV30-32,IV36,IV40-49,IV52-56,IV63,KW1-3,KW5-14,PA21-38,PH1-26,PH30-41,PH49-50,LD1-99,SY16-20,SY23-25

My input is a UK Postcode eg. IV21
I need a PHP function to check if the input postcode (eg IV21) is in the list.
This Continue reading

Tagged , , | 1 Comment

Functions: Won't fully include the config file [closed]

Possible Duplicate:
Php syntax error
Could anyone please tell me why my function won’t call $dbh from my config file? It works otherwise.. Been trying with everything since I woke up.

include'../config.php';

$username = $_SESSION['username'];

function get_feed() {
$stmt = 

Continue reading

Tagged , | 1 Comment

Sorting with combobox?

i need some help from you …when we select ‘info’ list in the combobox,automatically the article with type ‘info’ charateristic showed up, and when we select ‘Berita’ list in combobox,automatically the article with type ‘Berita’ charateristic showed up.. here is… Continue reading

Tagged , , , | Leave a comment

php javascipt functions to read modify text file and update form field value to add to mysql db

I have this form that uses php to access a txt file retrieve the first code and then delete the code and after that pass the code in the database(mysql) on submit the form. Depending on some user values of… Continue reading

Tagged , , , , | Leave a comment

What is VB equivalent of the PHP “feof” function?

What is Visual Basic.NET equivalent of the PHP “feof” function? I can’t seem to figure out how to test for end-of-file on a file pointer. The PHP “feof” does what I want but I urgently need it in VB. Anyone?… Continue reading

Tagged , , , , | Leave a comment

Function Php Mysql

hi guys i am trying to make function … i am kind of new in functions … so please help .. here is my code

function student_result($user_name, $sub){

    $data= mysql_query("SELECT SUM(score), SUM(score_from) FROM school_test_report, school_students WHERE
(school_test_report.student_id = school_students.student_id and 

Continue reading

Tagged , , | Leave a comment

calling javascript function in php, after element has been clicked x times

php/html

$i=0

for each ($x as $y => $z){

<a>click me</a>

if (++$i == 5) {break;}
}

javascript

function load_remaining_notifcations(){
    $.post('load_remaining_notifications.php',{},function(data){
        $('#load_remaining_notifcations').html(data);
    });
}

when <a>click me</a>… has been clicked five times, I want to run a javascript function. how Continue reading

Tagged , , , , | Leave a comment

Use JavaScript confirm dialog to make a PHP call in the background

OK, not really sure if this is possible but thought I’d ask anyway
I have a HTML page which contains some information and a link.
The link calls a JavaScript confirm dialog box.
If the user selects OK then I… Continue reading

Tagged , , | Leave a comment

Function only works when URL is called manually?

I’ve been smashing my head against a wall over this for the last 3 hours.
I have a short script I wrote up a while ago for routine maintenance of a PHP/MySQL application. The problem is not with the script… Continue reading

Tagged , , , | Leave a comment

How Can I Improve Function to Use In PHP Script

, i’m trying to prevent SQL Injection
, is my function enough when I’m using MySQL? How can I improve it?
Thanks for your time and patience.

    <?php
    function sanitize($data) {
        if (is_array($data)) {
            foreach($data as $var=>$val) {
                $output[$var] = 

Continue reading

Tagged , , , | Leave a comment
20 pages