vibhas bhingarde

Greenhorn
+ Follow
since Feb 22, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vibhas bhingarde

insert.html file

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)">
<meta name="created" content="Sat, 24 Sep 2011 15:42:13 GMT">
<meta name="description" content="">
<meta name="keywords" content="">
<title></title>

<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="myDiv"><h2>CREATE ACCOUNT</h2></div>
<form name="myform" >
First name :<input type="text" name="fname" id="fname"><br /><br />
Last name :<input type="text" name="lname" id="lname"><br /><br />
age :<input type="text" name="age" id="age" /><br /><br />
Hometown :<input type="text" name="hometown" id="hometown" /><br /><br />
Job :<input type="text" name="job" id="job" /><br /><br />
<input type="button" value="Insert" onClick='ajaxfunction()' />

</form>
</body>
</html>


<script type="text/javascript" language="javascript">

var err=false;


var fname=document.getElementById('fname').value;
var age=document.getElementById('age').value;
var hometown=document.getElementById('hometown').value;
var lname=document.getElementById('lname').value;
var job=document.getElementById('job').value;
function ajaxfunction()
{

try
{
var ajaxreq=new XMLHttpRequest();
}
catch(e)
{
alert("your browser broked");

}

ajaxreq.onreadystatechange=function()
{
if(ajaxreq.readystate==4)
{
document.getElementById('myDiv').innerHTML=ajaxreq.responseText;
}
}


var query1="?fname=" + fname + "&lname=" + lname + "&age=" + age + "&hometown=" + hometown + "&job=" + job;
alert(query1);
ajaxreq.open("POST","insert.php" + query1,true);
ajaxreq.send(null);




}




</script>




insert.php


<?php
$dbhost = "localhost";
$dbuser = "scott";
$dbpass = "tiger";
$dbname = "test";

$link=mysql_connect($dbhost, $dbuser, $dbpass);
if(!$link)
{
die("could not connect to mysql');
}
mysql_select_db($dbname,$link) or die("could not open" .mysql_error());


$query="INSERT INTO employees VALUES('$_POST[fname]','$_POST[lname]','$_POST[age]','$_POST[hometown]','$_POST[job]')";

mysql_query($query) or die (mysql_error() );



mysql_close($link);

echo "record inserted";
?>



my recorded is not being inserted ,sometimes it insert a blank & sometimes it doesnot inserts only.
also echo "record inserted" doesnot gets printed even if it insert blank

help me
thanks
i am using jtextarea containing nearly 1000 lines but i want only a particular line
that appears after some interval(not constant interval)
so i want to change the color of text only of that particular line.
that line which is being repeated is stored in a string


sample code :

String end="----------------------////-------------------------------Question " +String.valueOf(o)+ " Ends-----------------------------////-----------------------------------";
questionlistarea.append(end); //want to change color of this string only

i want to change color only of text stored in a string "end".
12 years ago
i want to display all data from database into Jtable
but my some cell consist of more characters of data because of which we have to scroll jtable a lot
so
i thought of displaying all data in jtextarea(by displaying it in nextline by using("\n")where ever necessary ) & then insert jtextarea in each cell of jtable

but i dont know code please post a code which would help me ?
13 years ago
thanks everyone i have done it;
thank you very much john
13 years ago
i tried out with html ,but my problem is value of q[u] is coming from database of datatype string so where ever i wanted a next line in that string i used "+"(or any string character) so that when it gets extracted from database and stored on q[u] "+" can be replaced with any newline character like "\n"


as per your example of html how can i replace "+" with "\n" and store in string s2
13 years ago
ya i tried //n tooo!!!
13 years ago
suppose

String s2=q[u]; //s2="hello my name is john and i stay in usa and i m married"

label.setText(s2.replace("and","\n")) //so that i may get output on new line when "and" is encountered

but thats not so ,it get printed on same line i also tried //n

but when i replace "\n" with any string it works

help me out please



also if i use html to do so how to get value of s2 say :

String htmlLabel = "<html><body> your output is<br>s2<br></body></html>";

because s2 gets its value from q[u] where q[] is array of string which i am retriving from database

13 years ago
i want to change the text of a label or a radiobutton everytime when user presses same button say "button1"
13 years ago
its a gui application ,that is i am making it in java swing
i have no idea how would i do it,
if there is some java lib or jar file consisting of all avaliable classes & interfaces ...is something i am thinking of but i have no clear idea how to implement it when dot operator is encountered in jtextarea
please help me out its my college project
i have attached image of my gui
check it out
13 years ago
i have prepared a application to compile the program written in jtextarea now i want to add some more functionality such as dot,example when a user presses System. all possible classes and interfaces should popup in jtextarea please tell me how to do this in java swing
eg: when user writes
import java. ---------all possible classes must be displayed---------
label1. ---------all possible functions should be displayed-------------
System.out. ---------------alll methods should be displayed-------
13 years ago