User Defined Functions

Typical User Defined Functions


function log_data($user, &$data) {

    if($mysqli->ping()) {

        $mysqli->query("INSERT INTO userdata VALUES ('".uniqid()."', '".$mysqli->real_escape_string($user)."', '".$mysqli->real_escape_string($data)."')");

    } else {

        echo 'MySQL server has gone away. Kindly create the connection again';





<?php log_data($_SERVER['PHP_AUTH_USER'], $data); ?>

Default values

    function head( $title="Default HTML Title" ) {
        <!Doctype html>
                <title> <?php echo $title; ?> </TITLE>

// Calling the head() Function without any paramter.


// Calling the head() function with parameter
// Remove below comment 

//    head("This is my Another HTML title");

                <p> This is Body Content </p>


Loading ...

Related Results :

  1. User Defined Functions
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of
  • Any registered user can create related posts based on search term tags.

About the Author