Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP value in div from php, reloading form
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


new2world
value in div from php, reloading form
0 Answer(s)      a year and 4 months ago
Posted in : PHP


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);
    }

}*/
?>

Advertisement
View Answers

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
Retrieve value of radio button from database to form
Retrieve value of radio button from database to form  var gn=document.getElementsByName("empg"); //empg is name of radio input type. for(var i=0;i
Fetch the data from mysql and display it on php form
Fetch the data from mysql and display it on php form  when i press on login button, after succesful login the related data of that person should be display in other textbox
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
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
Drag from DIV overflow - Ajax
Drag from DIV overflow  Hello All, I have Two html DIVs to use. What i want to do is click and drag item from First DIV and drop in Second DIV... from First Div, this item which i drag did not go beyound from Frist Div. How
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
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
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
PHP Array get key from value
In php array one can get the key from value by the use of array_search function Array_search function searches the key for the given values in the array. Example of PHP Array Get Key from Value <?php $product=array
displaying data for a single column from Mysql database in the list box in php form
displaying data for a single column from Mysql database in the list box in php form  I have a form in php.want to display data from a single column...('include/functions.php'); $Select = "SELECT * FROM category_master"; $Q = mysql
PHP Form
PHP Form In this tutorial you will learn how to pass any data from a html page to a php file, and how to use all those data. To do this we need at least two files one is html file and a php file. Here's the given example: userForm.html
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
Reloading issue in jsp
Reloading issue in jsp  I wrote one jsp page with one submit button. If we click on button it will execute business logic, but I want to stop reloading page if user refreshed the link. how we do
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
PHP JavaScript form Validation - PHP
PHP JavaScript form Validation  Just looking for a general PHP JavaScript form Validation. How can I write external JavaScript Validation? Please suggest!  Hi Friend, 1) form Enter Name Enter Address
php array sort by value
php array sort by value  an example to sort the array by value
php loging form connecitivity with mysql
php loging form connecitivity with mysql  my loging form is not connect
Custom Form Validation - PHP
Custom Form Validation  Which is the best way or where should I implement the custom validation rules such as ? using number, capital letters and symbols to secure the password
php array loop key value
php array loop key value  How to use Array key value loop in PHP
assign value problums in php
assign value problums in php  I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s the problem
Get form value in same page - JSP-Servlet
Get form value in same page  Hello friends, Can we get a form field value in the same to be processed in java coding...-registration-form-using-jsp.shtml Thanks
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
how to post data in mysql php form
how to post data in mysql php form  how to post data in mysql php form
PHP HTML Form
PHP & HTML Form: In the current tutorial we will study about PHP and HTML form, we will see how to send HTML . We will combine one html file and PHP...; <BODY> <form method="get" action="<?php $_SERVER
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
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
 

 

 

DMCA.com