473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

handle multiple related form on one page, urgent

i have a table that contains product details. i have a form with a textbox that takes product name as input. as soon as the submit button is clicked the product name as submitted has to be shown bellow the first form (in same page). everytime i click the submit button the product name as entered has to be shown below along with the previous product names.

i have done it for the first submit. i don't know how to append the product name after second submission and so on.

can you please suggest any way out or any code example.

thanks in advance.

fariba
Jan 29 '07 #1
5 1557
HI,,,

Can u please show the code.And reshape ur q with clearity..

Thanks.
Jan 29 '07 #2
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="testInventory.php" method="post">
<input type="hidden" name="ctr" value="<?=$ctr;?>">
Search Product Info ! ! !<br><br>
Product Name <input type="text" name="pn" id="pn" value="<?=$pn; ?>">
<br><input name="submit" type="submit" id="submit" value="Submit">

</form>
<?php
if(isset($_POST['submit'])){

?>
<form action="testInventory.php" method="post">
<input type="hidden" name="pn" value="<?=$pn; ?>">
<?php
//echo "<br>success: ".$pn."/";

include 'connecttutorial.php';

$s="SELECT DISTINCT p_name FROM inv WHERE p_name LIKE '$pn%' order by p_name";
//echo "<br>s: ".$s;
$result = mysql_query($s);
$num_rows2 = mysql_num_rows($result);
//echo "<br>num_rows2: ".$num_rows2."/";

//$myrow2=mysql_fetch_row($result);
if($num_rows2!=0){
$hint="";
while($FetchSQL=mysql_fetch_array($result))
{?>
<input type="checkbox" name="s_net[]" value="<?=$FetchSQL["p_name"]; ?>" ><? echo $FetchSQL["p_name"]." ";
}
?>
<br><input name="submitn" type="submit" id="submitn" value="Submit">
</form>
<?php
}
else{
echo "<br>no suggestion";
}
}
?>
</body>
</html>
Jan 29 '07 #3
u r searching ur db, not inserting data...
ok so u want that all the data showed in one page...

Remove distinct from select statement then see what are the results...
Jan 29 '07 #4
thanks for the suggestion but it won't make any difference.

what i need is for example:
i will enter pe and click submit. what i will see is: pen pencil (below the form).

next time i will enter sh and click submit. what i will see is: pen pencil sharpner(below the form).

the process will continue unless i get all my desired product names.

i hope you understand what i want. i want to append product name everytime i click submit. you may have noticed that i have included checkbox. it is because, after i am done with all the desired product name i will select checkbox (s) to view the product details of the checked products.

hope to get a quick and helpful reply.

thanks

fariba
Jan 29 '07 #5
The best way for this in my mind is to store ur data which u want to
display in the page to a temp table in the db,then display it from that
table,,,
For example:
Make new table with protemp,make fields which u want to display
,when u search one by one the data will comeout, with the stored one...

May be this will work,, i am not sure
u can try it...

Good Luck..
Jan 29 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Daniel Walzenbach | last post by:
Hi, I have a Website which allows users to input data. After they finished entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
5
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
21
by: Al Christoph | last post by:
I posted this last week end in the MSDN forums. No luck there. Let's see what the experts here have to say:-)))) I have a rather convoluted project. The distributable will come in eight...
6
by: somaskarthic | last post by:
Hi This is somas here. I asked query about detecting the browser close event using javascript. I want to detect the event only when the X button in the top right corner is clicked and not else...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all I have the following code: I am trying to use the value of the image button to evaluate what plan the user has chosen, i.e. it request("submit1")="Basic", then the user chose basic plan...
3
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.