Jump to content

[SOLVED] Referencing a PHP function file from an HTML doc


Johnain

Recommended Posts

I really have hunted, but I cannot find the syntax for the link. As a conszquence I have put my gunction into the header of the html file and I get an arror on the line in red below, the case statement.

 

<head>

<?php

$order="XXXX";

function fnshowmail($order){

mysql_connect(localhost,$username,$password);

@mysql_select_db($database) or die( "Unable to select database");

            switch ($order) {

    case DATE:

$query="SELECT * FROM visitoremailin" use index created or die("Bad syntax");

break;

default:

$query="SELECT * FROM visitoremailin";

}

$result=mysql_query($query);

$num=mysql_numrows($result);

  mysql_close();

  return $num;

}

?>

 

The function is called in the <body> below by a button tht sets "$order and the vars such as $username and $password are filled in the body before the function is called for the first time.

 

It may be the syntax in the switch staement, but I just cannot see it.

 

The erroe message is ...

 

Parse error: syntax error, unexpected T_USE in /home/johnain/public_html/scripts/dispmailsin.php on line 27

 

Regrds to all

 

John

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.