Hey,
I have now put my forms etc into functions so I can maintain them in a single page .. but where include 'news.php'; showed the form again when a field was missed obviously doesnt work using function with switch ..
How can I acheive the same thing now ?
Thanks
error checking + include 'news.php';
Moderator: General Moderators
-
Hi,
Don't know if this was the question ... pehaps you should reask it more clearly...
djot
-
Hi,
Code: Select all
if form is not submitted OR submitted but filled incorrectly
{
// show form again
}
else if form is submitted and filled correctly
{
// include and output news.php
}djot
-
Last edited by djot on Wed Feb 09, 2005 10:23 pm, edited 2 times in total.
Hey ..
I will explain it with more depth ..
I had my edit news script on seperate pages .. ie the form was on one page while the script to make the updates was on another page ..
news.php - newsparse.php
I have now put then into one page using:
as an example ...
Before when the error checking took place the form was on news.php .. If a field was not filled in I was able to show the form again .. ie:
Now that I am using functions as above, I am not sure how to display the form again when required fields are missed?
Hopefully thats clearer ..
Thanks
I will explain it with more depth ..
I had my edit news script on seperate pages .. ie the form was on one page while the script to make the updates was on another page ..
news.php - newsparse.php
I have now put then into one page using:
Code: Select all
function news() {
bla bla
}
function editnews() {
bla bla
}
switch ($_REQUESTї'cmd']) {
case 'news':
news ();
break;
case 'newsparse':
dbconnect ();
newsparse ();
break;Before when the error checking took place the form was on news.php .. If a field was not filled in I was able to show the form again .. ie:
Code: Select all
if(!$news){
echo ("Error! Fields marked * are required.");
include 'news.php';
return;Hopefully thats clearer ..
Thanks
Last edited by Jim_Bo on Wed Feb 09, 2005 11:18 pm, edited 1 time in total.
Hey,
Thanks fyed .. I managed to get one of them to work with:
is that the correct format?
.. and the insults .. please supply a better description would have been more than adequate on a public forum ..
Thanks fyed .. I managed to get one of them to work with:
Code: Select all
addnews();
return;.. and the insults .. please supply a better description would have been more than adequate on a public forum ..