Hi,
I'm trying to create a dynamic form that is accessed from multiple pages. I've created the form and included into one of the main PHP pages using the include() function.
Now, when I run the form, it seems to be ignoring the <form> tag entirely. I want the form to pass the data to another PHP script for validation and dumping into the database. The form will only pass the details back to same page the form is run from.
The form works as it should when I run it's script individually, but not through another page using include().
Any suggestions or help would be great appreciated. Thanks in advance,
Vladimir
10 6197
View your source in your browse and see the HTML is what you expect.
Dan
Hi Dan,
Thanks for the speedy reply.
I've had another play with it and decided to strip it down to it's basic form. I added in an identical form into the index.php script. The HTML is echoing out correctly and appears correct in view source.
The form will still not move to another page.
Vladimir
We're going to have to see the source code, HTML and PHP, if we're going to help you.
Hi Markus,
Thanks for the reply. The code I'm using for the Index.php script is posted below.
Do you also require the output HTML from the view source?
Thanks,
Vladimir - <?php
-
-
//Database connection data
-
include("config/db_config.php");
-
opendb($dbhost, $dbuser, $dbpass, $dbname);
-
-
$pagetitle = "Asset Catalogue Front Page";
-
-
//HTML header information. Assigns variable $pagetitle as the title for the page
-
include("layout/htmlheader.php");
-
-
-
//checks for previously run forms/**/
-
//$delete = $_POST['delete'];
-
//if(isset($delete))
-
// {
-
//script to delete the selected entry from the database
-
// include("data/delete.php");
-
// }
-
-
-
//Table data for the main output
-
echo ("<table border=1>");
-
echo ("<tr name=\"title\">");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Field</td>");
-
echo ("<td>Delete</td>");
-
echo ("</tr>");
-
-
//script to pull data from database, assign to variable and echo into table
-
include("data/select.php");
-
-
echo ("</table>");
-
-
//Form for inputting a new record
-
-
$rows = 1;
-
-
echo ("</br>");
-
echo ("<table border =1>");
-
echo ("<tr>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("<td>");
-
echo ("Field");
-
echo ("</td>");
-
echo ("</tr>");
-
-
-
-
echo ("<form action=\"insert.php\" method=\"POST\" >");
-
echo ("<input type=\"submit\" name=\"submit\">");
-
echo ("</form>");
-
-
-
echo ("</table>");
-
-
//HTML footer information
-
include("layout/htmlfooter.php");
-
-
-
-
?>
Yes please - the HTML source would be useful.
Is the form that is not working, the one located ~line #80?
Also, doing all that echo()ing isn't the best way to achieve that result - have a look at the heredoc syntax.
Mark.
Thanks for telling me about the heredoc syntax. Very useful!
I'll start using that from now on.
Anyhow; It is the form at line 80 that is the problem. I removed all the form fields to test the form.
Also, here is the HTML from view source: - <html>
-
<head>
-
<title>Title</title>
-
</head>
-
<body>
-
<table border=1>
-
<tr name="field">
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
</tr>
-
<tr name="Field">
-
<td>123</td>
-
<td>123</td>
-
<td>123</td>
-
<td>123</td>
-
<td>123</td>
-
<td>123</td>
-
<td>123-2009</td>
-
<td>123</td>
-
<td>2009-08-05 09:07:27</td>
-
<td><form method="POST"><input type="hidden" name="id" value="123"><input type="submit" name="delete" value="Delete"></td>
-
</tr>
-
</table>
-
-
-
<table border =1>
-
<tr>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
<td>Field</td>
-
</tr>
-
<form action="insert.php" method="POST" ><input type="submit" name="submit"></form>
-
-
</table>
-
</body>
-
</html>
Close the form on line 29.
Mark.
Thanks Mark,
Not sure how I missed that. Think it's a case of can't see the forest for the trees.
Thanks a lot.
Vladimir.
@dlite922
Yes, My reply was very general, but it was as simple as pasting the HTML source into this: http://validator.w3.org
BAM! problem found in 2 seconds :)
Dan
Sign in to post your reply or Sign up for a free account.
Similar topics
by: TinyTim |
last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side
code and you're going to return a customized HTML form with several
fields and labels, you have to do an extensive amount of...
|
by: Alexander Malkis |
last post by:
How to recover from failing cin.get(str,n,'\n')?
The user pressed "Enter" on cin.get(...).I would like to let him try
once more but the system doesn't stop on the next cin.get. Code:
...
|
by: Josh Mayfield |
last post by:
Note: There is considerable background detail here, but I do have
three questions, which are clearly marked and appear right before the
sample code.
I have a legitimate need to launch an EXE...
|
by: cjm |
last post by:
I have two problems that I suspect will be bread-and-butter problems for the
more experienced guys on here, but I'm not the greatest with js.
NB: Code snippets at the bottom
The first problem...
|
by: Robby Bankston |
last post by:
I'm working on some code and am running into brick walls. I'm trying
to write out Javascript with Javascript and I've read the clj Meta FAQ
and didn't see the answer, read many similar posts (with...
|
by: frogman042 |
last post by:
My daughter is playing around trying to learn JavaScript and she wrote
a small program that prints out a message in increasing and decreasing
font size and color changes. She is using document...
|
by: rdemyan via AccessMonster.com |
last post by:
My application is split into a front end and back end. Each user has their
own copy of the front end.
There are a few forms I only want to be open for one user at a time. So I've
implemented the...
|
by: happyse27 |
last post by:
Hi All,
I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
|
by: thatcollegeguy |
last post by:
Below are my 3php and 2js files.
I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
| |