value in div from php, reloading form
I am having one form with name and username as 2 field. In this i am checking whether the username is available or not, what I want is to dislay the message in the same line as username text box aligned,while showing message it shd show previously filled values also. I have taken two forms login.php in which i am building form and login2.php in which i am showing the value if not registered .but what is happening is I am getting two forms visible on the same page, i want to omit the first one when i go woth other
login.php
<?php
include 'login2.php';
function form($name, $username)
{
?>
<form name="mylogin" method="post">
<table>
<tr><td>Name</td>
<td><input type="text" id="name" name="name" value="<?php echo $name?>" required></td></tr>
<tr><td>Username</td>
<td><input type="text" id="user" name="user" value="<?php echo $username?>" required></td>
<tr><td><input type="submit" name="submit" value="Username Availability Check"></td></tr>
<?php usercheck()?>
</table>
</form>
<?php
}
?>
<?php
form('','')
?>
login2.php
<?php
function connect()
{
mysql_connect('localhost','root','vivaksha');
mysql_select_db('loginprac');
}
function usercheck()
{
if(isset($_POST['submit']))
{
connect();
$name=$_POST['name'];
$user = mysql_real_escape_string($_POST['user']);
$check_for_username = mysql_query("SELECT user from userpage WHERE user = '$user'");
$count = mysql_num_rows($check_for_username);
if($count != 0)
{
form($name,$user);
}
}
}
/*function insert()
{
connect();
if(isset($_POST['submit']))
{
usercheck();
$name=$_POST['name'];
$user=$_POST['user'];
$sql1= "INSERT INTO userpage (name,user) VALUES ('$name','$user')";
mysql_query($sql1);
}
}*/
?>
View Answers
Ads
Related Tutorials/Questions & Answers:
value in div from php, reloading form
value in
div from php,
reloading form I am having one
form with name... woth other
login.php
<?
php
include 'login2.php';
function
form($name..." name="name"
value="<?
php echo $name?>" required></td></tr>
Return Value from One Form
Return
Value from One Form I have two buttons in main
form client and bank.when i click client button new
form will open, in this dedupe button...
value of dedupe
form and use in bank
form..how to do
Advertisements
PHP form
PHP form Hi Sir/Madam,
I am developing an attendance
form using
php, which displays the name and ID of a Employees which are fetched
from Db and I...
form and update them to respective coloumn...
Please any one help mo out please
PHP Form, PHP guest form
PHP email
form
HTML
form
It's not a good idea to leave your private e...;br>
</form><br>
<?
php
//
php-code
from the Part 2<br>... (
value) match their purpose. The action attribute
of
form tag links to itself, so
php form post to mysql
php form post to mysql How to post data into mysql database
from the
PHP post data
form
checkbox value in php
checkbox
value in php In my HTML,
PHP form ..we have a check box that is working fine. But anyhow i am not able to get the
value of it. Can anyone suggest how to get the
value of checkbox in
PHP
Expand / Collapse form div when click on button
Expand / Collapse
form div when click on button Hi,
I have a
form integrated
from Wufoo with iFrame code. If the user misses a field an error... formbox expand once the
form gets higher?
Thanks
<
div class="formbox
HTML to php form
HTML to
php form Hi,
How I can submit the HTML
form data to
PHP Script? Give me example code.
Thanks
Hi,
Please see the following tutorials:
PHP Form
PHP email
form
Thanks
PHP Sticky form problem
PHP Sticky
form problem I have done the full coding of a sticky
form...="text" name="number1" size="20"
value="<?
php if(isset($_POST['number1'])) echo..." name="number2" size="20"
value="<?
php if(isset($_POST['number2'])) echo
PHP Sticky form problem
PHP Sticky
form problem I have done the full coding of a sticky
form...: <input type="text" name="number1" size="20"
value="<?
php if(isset($_POST...;input type="text" name="number2" size="20"
value="<?
php if(isset($_POST
How to change value of div using Ajax in struts.
How to change
value of
div using Ajax in struts.
In this example, we will introduce you to how to change
value of
div tag
using Ajax in struts, without
reloading page.
1-index.jsp
<%@ page
contentType="text/html
php form having 2 submit buttons
php form having 2 submit buttons i have a
php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button the data
from form should go in mysql database and mail should go to appropiate
PHP : Form to Email
PHP :
Form to Email
With the help of this tutorial you can send mails to a user using a
form, as
we have...
value mail will be
sent.
Code:
<?
php
$to=$sub=$msg=$hdr="
Reading Value From console
Reading
Value From console In case of String data Type readLine method of DataInputStream class
read complete line of the given string but the next method of Scanner
class doesn't read the complete line of String. why
Reading Value From console
Reading
Value From console In case of String data Type readLine method of DataInputStream class
read complete line of the given string but the next method of Scanner
class doesn't read the complete line of String. why
export value in csv from jsp
export
value in csv
from jsp Hi! i have creted a html
form using javascript. i hv taken the array values in jsp. nw i want to pass these array values
from jsp to csv file. so please help me how to send
upload value to php server in getmethod in j2me
upload
value to
php server in getmethod in j2me Dear Team,
I... getting that
value i means captured decoded
value i want to that
value in get method to
php server in j2me can you give some tips for me...
Thanks and Regards
returning a value from Threads
returning a
value from Threads Hello I have worker pattern that uses ExecutorService to schedule Thread execution but getting stuck at some point when returning a
value using Future.I have code snippet below:
ExecutorService
PHP SQL Fetch
;
PHP SQL Fetch is used to fetch the records
from Mysql database to
PHP...
The Tutorial illustrate an example
from PHP SQL Fetch. To understand and
grasp...',12);
php_sql_fetch.php:
The code below is used to fetch the records
from
Pass values from form to form
Pass values
from form to
form
Java program to pass values
from one
form to another
form in JSP
There are many occasions when the programmer need to
pass some
value to many