Jump to content

Java Script for client side


utthu

Recommended Posts

Basically, I created an application using HTML & Javascript for front end, MYSQL for back end and PHP to link these both. I have one console acting as a server and client. But I need to maintain multiple clients. So, I need the required code and methodology to do the same.

I created an application for VOTING SYSTEM. Now, I need the voters to vote from multiple computer/consoles. How do I achieve this?

 

Right now.. Since I have NOT implemented multiple clients system.. The server and the client is on ONE system. But, I want a suitable JS code such that I can support multiple clients.

 

Um, is my query still ambiguous? I hope, not!

This is how my login module at the server side looks like--

 

<?php

//initilaize the mysql user name and password

//Database Config

$dbHost='localhost'; //Database server

$dbName='db';  // Name of the database

$dbUser='root'; // Database username

$dbPass=''; // Database password

 

 

$source = mysql_connect($dbHost, $dbUser, $dbPass);

 

if (!$source) {

die('Not connected : ' . mysql_error());

}

 

$db_selected = mysql_select_db('db', $source);

 

if (!$db_selected) {

die ('Can\'t use $DB : ' . mysql_error());

}

 

 

//get the information from login form

 

$username = addslashes($_POST['adminname']);

 

$pwd = addslashes($_POST['adminpwd']);

 

 

//execute the query

 

$sql ="SELECT * FROM administrator WHERE vid = '$username' AND pwd = '$pwd'";

 

$result = mysql_query($sql);

 

$flag=0;

if ($row = mysql_fetch_assoc($result)) {

$flag =1;

}

if($flag == 1){

header("Location:http://localhost/project/Loginmodule/adminmenu.html");

}else{

echo "You Are an Unauthorised User";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.