473,396 Members | 1,738 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,396 software developers and data experts.

How to use a form to insert or update question..

1
Hello to everyone,
i'm facing the following problem:
I have a form which is used for both insert or update data.. The situation is like that: when the user fills the form, press the submit button and an error (regarding the validation of data) occurs (e.g. he puts letters instead of numbers), the form sends him to a page in order to see what was wrong and a "back" button appears. Now, when he is in an 'update mode' and press 'back' the form is filled in and when he is in 'insert mode' the form is empty and this is because the following peace of code:
Expand|Select|Wrap|Line Numbers
  1. <form method=post
  2.         action="<?=$edit?"edit_book.php":"insert_book.php";?>">
  3.   <table border=0>
  4.   <tr>
  5.     <td>ISBN:</td>
  6.     <td><input type=text name=isbn value="<?=$edit?$book["isbn"]:""; ?>"></td>
  7.   </tr>
The question is how am I gonna syntax the value so the user will be able to preserve the data while he is in 'insertion' and he returns to the form

Thanx in advance, Stam
Oct 6 '07 #1
2 1374
pbmods
5,821 Expert 4TB
Heya, Stam. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]
Oct 6 '07 #2
create variables for the values in the form and then when the user gets "redirected" to the page, just call them from the variables.
Oct 7 '07 #3

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

Similar topics

8
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE,...
1
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
3
by: teddysnips | last post by:
I need a trigger (well, I don't *need* one, but it would be optimal!) but I can't get it to work because it references ntext fields. Is there any alternative? I could write it in laborious code...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
14
by: fjm1967 | last post by:
Hi all, I am nearing the end of programming my select forms and I will be soon need to create my insert and update forms. I have a question as to how this is best handled. I want to use one...
11
by: cooperkuo | last post by:
Dear all, I have a question about ADO in the subform. I know how to use ADO to insert/update/select data into the sigin form, but wehn I try to do it in the form with subform((Datasheet). I don't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.