LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-23-2006, 12:29 PM   #1
bappreacher
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Rep: Reputation: 0
Mutlipe text/button form, one submit button


I am here because I have a Linux (Fedora Core 4) on a Apache server, with Php and My SQL on it. I am making a form to retrieve data and input data on the database. We are using Access for the interface. So i want to use HTML and php code to amke the form. I can give any and all the code that i have now if that would help you to help me.

Here is the code that I have wrote in html:

<html>
<HEAD><TITLE>Database</TITLE></HEAD>
<BODY>
<CENTER><H1><font color=white>MAIN FORM</font></H1>
<body bgcolor=navy>



<center><img src="desa.jpg"></center>

<table border=0 cols=1 width=90% align=center>
<tr><td><img src="flag1.gif" align=left></td>
<td><img src="flag1.gif" align=right></td>
</tr>

<tr>
<td colspan=7>&nbsp;</td></tr>
<td colspan=7>&nbsp;</td></tr>

</table>

<table border=0 cols=1 width=90% align=center>

<tr>
<form name"trail2" method="post" action="fname.php">
<td width=30><b><font color=#00FF00 size=+1>First Name:</B></font></td>
<td><input Name="FirstName" type="text">
<input type="submit" name="bsubmit" value="FIND">

</td></form>



<form name"trail3" method="post" action="lname.php">
<td width=30><b><font color=00FF00 size=+1>LastName:</b></font></td>
<td><input Name="LastName" type="text">
<input type="submit" value="FIND"></td></form></tr>
<tr><td colspan=7>&nbsp;</td></tr>


<tr>
<form name"trail6" method="post" action="user.php">
<td width=30><b><font color=White size=+1>USER:</b></font></td>
<td><input Name="user" type="text">
<input type="submit" value="FIND"></td></form>


<form name"trail5" method="post" action="tele.php">
<td width=30><b><font color=White size=+1>Telephone:</b></font></td>
<td><input Name="TelephoneNumber" type="text">
<input type="submit" value="FIND"></td></form></tr>


<tr><td colspan=7>&nbsp;</td></tr>

<tr>

<form name"trial1" method="post" action="model.php">
<td width=50><b><font color=#DC143C size=+1>MODEL:</B></td>
<td><input Name="model" type="text">
<input type="submit" value="FIND"></form>
<form name"trail7" method="post" action="findmanual.php">
<input type="submit" value="manual"></td></form>


<tr><td>&nbsp;</td></tr>


<tr><td>&nbsp;</td></tr>

<tr>
<td>&nbsp;</td>


<tr>
<td>&nbsp;</td>


</td></tr>
</body>
</table>
</html>


I want to be able to put data in each one of these textareas and then add a submit button to insert it into the "MY SQL" database. The O.S. is Linux (Fedora core 4) and it has php with Apache server and My SQL. The find buttons are to be able to pull data from the database, like customer calls and the info from them. Thank you for your help and info.


 
Old 06-23-2006, 01:27 PM   #2
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
Hi,
I cant seem to find the problem. If you put names to the INPUT SUBMIT tags, then in PHP you can diferentiate which button was pressed and act accordinly ($_POST["buttonName"] will be set).
But appart from that I dont see any "problem" (or doubt).

Hope you get it to work
Cheers!
 
Old 06-23-2006, 02:16 PM   #3
bappreacher
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by demon_vox
Hi,
I cant seem to find the problem. If you put names to the INPUT SUBMIT tags, then in PHP you can diferentiate which button was pressed and act accordinly ($_POST["buttonName"] will be set).
But appart from that I dont see any "problem" (or doubt).

Hope you get it to work
Cheers!
Well it works so far, but i am wanting to keep the forms that i have now and add a main submit button to take the info out of the text areas and submit that to the database. I tried to paste the picture on here but this site would not allow me to do it.

 
Old 06-23-2006, 04:27 PM   #4
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
Hi,
if you want to add a main submit button that sends ALL the textareas at once, you should put all your inputs inside the same FORM. Then when your PHP file process this form can add them to your database.
 
Old 06-26-2006, 11:31 AM   #5
bappreacher
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I am confused. I have added a submit button at the end and it goes to a certain php program but it is not taking the text out of the text area. I do not know how to do that. Also how do I do what you stated here about putting he inputs in the same form?
 
Old 06-26-2006, 11:47 AM   #6
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
Hi,
you probably have yo modify your PHP code in order to act diferently. What does your code do now a days? I dont know what you have, but you must modify some in order to change the behavior. But since I have no clue of what you have, it is a really long shot for me to guess.

Cheers
 
Old 06-26-2006, 01:33 PM   #7
bappreacher
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by demon_vox
Hi,
you probably have yo modify your PHP code in order to act diferently. What does your code do now a days? I dont know what you have, but you must modify some in order to change the behavior. But since I have no clue of what you have, it is a really long shot for me to guess.

Cheers
Well here is what i added. In fact here is all the code:

<html>
<HEAD><TITLE>Database</TITLE></HEAD>
<BODY>
<CENTER><H1><font color=white>MAIN FORM</font></H1>
<body background=sportscar.jpg>



<center><img src=desa.jpg usemap=#desai border=5></center>

<table border=0 cols=1 width=90% align=center>
<tr><td><img src="flag1.gif" align=left></td>
<td><img src="flag1.gif" align=right></td>
</tr>

<tr>
<td colspan=7>&nbsp;</td></tr>
<td colspan=7>&nbsp;</td></tr>

</table>


<table border=0 cols=1 width=90% align=center>

<tr>
<form name"trail2" method="post" action="fname.php">
<td width=30><b><font color=#00FF00 size=+1>First Name:</B></font></td>
<td><input Name="FirstName" type="text">
<input type="submit" name="bsubmit" value="FIND">

</td></form>



<form name"trail3" method="post" action="lname.php">
<td width=30><b><font color=00FF00 size=+1>LastName:</b></font></td>
<td><input Name="LastName" type="text">
<input type="submit" value="FIND"></td></form></tr>
<tr><td colspan=7>&nbsp;</td></tr>


<tr>
<form name"trail6" method="post" action="user.php">
<td width=30><b><font color=White size=+1>USER:</b></font></td>
<td><input Name="user" type="text">
<input type="submit" value="FIND"></td></form>


<form name"trail5" method="post" action="tele.php">
<td width=30><b><font color=White size=+1>Telephone:</b></font></td>
<td><input Name="TelephoneNumber" type="text">
<input type="submit" value="FIND"></td></form></tr>


<tr><td colspan=7>&nbsp;</td></tr>

<tr>

<form name"trial1" method="post" action="model.php">
<td width=50><b><font color=#DC143C size=+1>MODEL:</B></td>
<td><input Name="model" type="text">
<input type="submit" value="FIND"></form>
<form name"trail7" method="post" action="findmanual.php">
<input type="submit" value="manual"></td></form>


<tr><td>&nbsp;</td></tr>


<tr><td>&nbsp;</td></tr>

<tr>
<td>&nbsp;</td>


<tr>
<form method ="post" action ="findmanual.php">
<td><input type=submit value=submit the form></td>
</form>

<map name="desai">
<area shape="rect" coords="0,3,331,60" href="http://www.desatech.com/">

</tr>
</body>
</table>
</html>


Now as for the php, I do have some progams on the server. Such as a findmanual.php, this one helps us to pull up owner's manuals. The other help us to get data from teh database. Like fisrt name of customer, last name, phone, model and other things. If you need the code for those i will be more then glad to help you.


Now how do i make the text be submitted for the text areas in the code I just gave you? I am sorry if this is alot of trouble.
 
Old 06-26-2006, 04:15 PM   #8
demon_vox
Member
 
Registered: May 2006
Location: Argentina
Distribution: SuSE 10
Posts: 173

Rep: Reputation: 30
Hi,
for what I can deduce you are using one php script to process each of the FORMs. If you want to submit all the textbox at once, you will have to put them all in the same FORM and have only one PHP to process them all. You'll probably have to merge all your individuals .php into just one.

Is this the problem?
 
Old 06-27-2006, 08:07 AM   #9
bappreacher
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by demon_vox
Hi,
for what I can deduce you are using one php script to process each of the FORMs. If you want to submit all the textbox at once, you will have to put them all in the same FORM and have only one PHP to process them all. You'll probably have to merge all your individuals .php into just one.

Is this the problem?
Well you are correct. For each form there is another php. However we have to do that becuase each one of the php and form do a separte thing. Such as the First name is the one php that is the one that retrieves the first name of the customer search. You see we use our database for different things. Such as retrieving customer info like first name, last name phone number, and model/ serial number. Plus we like to see what tech took the call.

I do see what you mean if we could make a php to retrieve what button is clicked then we could take that info and submit it to the data base and also retrieve that info also. I am so glad I came to this site. I will give it a try and maybe you can give me some insight on how it should be.

Thank you ever so much.


I am a
 
  


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
make thumb button/third button double-click taboom Linux - Hardware 0 03-20-2006 02:39 PM
Vector 5.1 SOHO. Start button/K button, Sound card suseforge VectorLinux 0 01-30-2006 12:14 PM
Can we change the submit button look using css pranith Programming 2 07-08-2005 03:54 AM
how 2 disable max button in form 00it45 Programming 1 02-24-2004 07:07 AM
how 2 disable max button in form.. 00it45 Programming 0 02-19-2004 01:21 AM


All times are GMT -5. The time now is 12:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration