LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2010, 07:57 AM   #1
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Rep: Reputation: 17
Cool why the html <form> doesn't disappear after using it


hi LQs, I'll try to explain the situation simply.
I have a HTML <form> with two (input type text), and a submit button, after I enter the two values and click submit button, the x.php appear successfully but the HTML <form> still remain in the x.php page, can you tell me how to hide the form from the x.php page
 
Old 04-15-2010, 08:00 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Check of submit button. The code to print form should be conditional.

If your submit is defined do not show the form
 
Old 04-15-2010, 08:06 AM   #3
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Cool

I don't think it is conditional, I just take the values and execute a Mysql query, the data fetched successfully from the database and the form I used to fetch data doesn't disappear, should it??, or I forgot to do something??
 
Old 04-15-2010, 08:20 AM   #4
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Yes, It should be conditional in case you want to hide if after posting the form.
 
Old 04-15-2010, 08:27 AM   #5
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
appreciate your help, i think the condition should be in from.html right??
but what is the condition should be??
Code:
.
.
.
.
.
.
.
 
Old 04-15-2010, 08:44 AM   #6
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Please post the relevant section of the code.
 
Old 04-15-2010, 09:33 AM   #7
a7mlinux
Member
 
Registered: Apr 2009
Distribution: RHEL 5, Fedora 10
Posts: 116

Original Poster
Rep: Reputation: 17
Question

here is the form code (simplified I just pasted the main tags):
search form.html
Code:
<script language="javascript">
function redirect(){
window.location ="show data.php"
return
}
</script>
<form method="POST" action="show data.php">
<div id="wb_Text1" style="position:absolute;left:322px;top:39px;width:114px;height:14px;z-index:0;" align="left">
<font style="font-size:11px" color="#000000" face="Arial">search by name </font></div>
<input type="text" name="name">
</input>
<div id="wb_Text2" style="position:absolute;left:323px;top:90px;width:94px;height:14px;z-index:2;" align="left">
<font style="font-size:11px" color="#000000" face="Arial">search by #</font></div>
<input type="text" name="docNo"></input>
<input type="submit" id="Button1" name="Button1" value="OK" onClick="redirect()" >
</form>
and the show data.php:
Code:
$docNo = $_POST['docNo'];
$name = $_POST['name'];
$result = mysql_query("SELECT * FROM employee WHERE docNo = '$docNo' OR name = '$name'");
include('search form.html');
it works, but the search form.html appear in show data.php

Last edited by a7mlinux; 04-15-2010 at 09:37 AM.
 
Old 04-16-2010, 01:16 AM   #8
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Is there any specific reason to include search_form.html in show_data.php ?
If not try commenting it out. this will stop showing the form on show_data.php.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple HTML form SimonT Programming 5 04-14-2007 12:57 PM
html question: form henrikanttonen Programming 4 08-13-2004 07:28 AM
Contact form on HTML Gerardoj Linux - General 1 03-26-2004 02:08 AM
an html form question matt_w_lambert Programming 3 10-30-2003 11:41 PM
problem with html form meluser Linux - Software 4 03-15-2003 12:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration