473,769 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi-page form that preloads

41 New Member
Hello

First sorry if there is to much code in this example.

I am new to working with multi page forms.

I have a search form that gets preloaded info from the database.
There are 3 scripts (a html page, a preload script and a process script).
There is a search button and a submit button.

The user can alter this information.
If the user alters the preloaded infomation and then does a search
I want the altered information to be displayed along with the search results.

Note: the same search page reloads with the search results.

1) Should I use the hidden input script to hold the altered information?
2) Where should I place the hidden input script, on the form or the preload
script?

Note:I tried putting the hidden input script in preload.php
so I can use an if to determine if their is hidden info to pass
or pass the info from the database. But I could could not get that to work

It would be great if you could please show your suggestion.


Hidden input
[php]
if($_POST['fname']) $fname = $_POST['fname'];
echo ("input type = 'hidden' name='fname' value ='" .$fname ."'>\n");
[/php]


Preload script
[php]
<?php
/** preload.php**/

$spec_q ="select fname, lname, service_date
from customer
where customer_num = $customer";
$result = mysqli_query ($mysqli, $spec_q);
while($row = mysqli_fetch_ar ray($result))
{

list($fname, $lname, $service_date) = $row;
list($ser_year_ c, $a_month_c, $c_day_c)= split("-",$service_date );
}
?>
[/php]

Html page
[php]
<?php
/** search_form.php **/

include("preloa d.php");//preload first and last name and service date
?>

<html>
<form action="search_ edprocess.php" method="post">

<table>
<tr>

<!---------------------customer name--------------------->
<td colspan="2" align="left"><f ont face = "arial" font size = "3px"><b>

<input type="text" name="first_nam e" size="15" maxlength="20" value ="<?php echo $lname; ?>"/>
<input type="text" name="last_name " size="15" maxlength="20" value ="<?php echo $fname; ?>"/>

echo "$lname, $first"; //patient last name and org_patient_id

</b></font></td>

<!-------------------date of service--------------------->
<td colspan="2">

<input type="text" name="service_y r" size="4" maxlength="5" value ="<?php echo $service_yr; ?>"/>

<!-------------------service date month dropdown---------------------->
<select name="service_m onth">
<?php
$month_name = get_a_month_nam e($a_month_n);
$month_code = get_a_month_cod e($a_month_c);
for($n = 1; $n<= 13; $n++)
{
$month=$month_n ame[$n];
$mcode=$month_c ode[$n];
echo "<option value = '$mcode'";
if ($mcode == " ")
{
echo "selected";
}
echo ">$month \n";
}
?>
</select>

<!-------------------service date day dropdown---------------------->
<select name="service_d ay">
<?php
$day_name = get_c_day_name( $c_day_n);
$day_code = get_c_day_code( $c_day_c);
for ($n = 1; $n<= 32; $n++)
{
$day = $day_name[$n];
$dcode = $day_code[$n];
echo "<option value = '$dcode'";
if ($dcode == " ")
{
echo "selected";
}
echo ">$day \n";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<!---------------------search box ------------------->
Search for:
<input type="text" name="find" />
</td>
<td ><input type="hidden" name="searching " value="yes" />
<input type="submit" name="f_button" value="Search" />
</td>
</tr>
</table>
</html>
[/php]


Process script
[php]
<?php

/**search_edproc ess.php**/

$first_name = strip_tags(trim ($_POST['first_name']));
$last_name = strip_tags(trim ($_POST['last_name']));

//year of service
$service_yr = strip_tags(trim ($_POST['service_yr']));
$service_yr = preg_replace("/[^a-zA-Z0-9\s,.]+/","",$service_y r);

$find = preg_replace("/[^a-zA-Z0-9\s,.]+/", " ", $find);

//month of service
$service_month = trim($_POST['service_month']);

//day of service
$service_day = trim($_POST['service_day']);

//year, month and day of service
$service_date = $service_yr."-".$service_mont h."-".$service_ day;

/**** insert goes here****/
if(($_POST['f_button'])= "Submit")

/***find and submit bottons managed by switch**/
switch ($_POST['f_button'])
{

}

?>
[/php]
Dec 17 '06 #1
0 1948

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

Similar topics

37
4896
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo
4
4674
by: Frank Jona | last post by:
Intellisense with C# and a multi-file assembly is not working. With VB.NET it is working. Is there a fix availible? We're using VisualStudio 2003 Regards Frank
12
3879
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
6
8181
by: cody | last post by:
What are multi file assemblies good for? What are the advantages of using multiple assemblies (A.DLL+B.DLL) vs. a single multi file assembly (A.DLL+A.NETMODULE)?
4
17874
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the problem is the charset? How I can avoid this warning? But the worst thing isn't the warning, but that the program doesn't work! The program execute all other operations well, but it don't print the converted letters: for example, in the string...
17
10709
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when talking with another team -- codepage -- at the same time. I am more confused when I saw sometimes we need codepage parameter for wide character conversion, and sometimes we do not need for conversion. Here are two examples,
0
2328
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing Systems (MuCoCoS'08) Barcelona, Spain, March 4 - 7, 2008; in conjunction with CISIS'08. <http://www.par.univie.ac.at/~pllana/mucocos08> *********************************************************************** Context
1
9317
by: mknoll217 | last post by:
I am recieving this error from my code: The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part identifier "PAR.UniqueID" could not be bound. The multi-part identifier "PAR.PAR_Status" could not be bound. The multi-part identifier "Salary.New_Salary" could not be bound. The multi-part identifier "Salary.UniqueID" could not be bound. The multi-part...
2
4658
by: Aussie Rules | last post by:
Hi, I have a site that Iwant to either display my text in english or french, based on the users prefernces ? I am new to webforms, but I know in winforms, this is pretty easy with a resource file. What is the best way to acheive this with webforms ?
14
3413
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
As far as I know, the C Standard has no mention of multi-threaded programming; it has no mention of how to achieve multi-threaded programming, nor does it mention whether the language or its libraries are suitable for multi-threaded programming. For people who are fond of portable C programming, what's the best way to go about multi-threaded programming? I've been reading up on POSIX threads a little, they seem pretty ubiquitous....
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.