473,396 Members | 1,785 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.

Novice - Help with a page.

Ben
The page below isn't picking up details or location.

What have I missed?
Thanks in advance,

Ben
____________________________________________
<?PHP

include ("bdc_functions.php");
include ("user_functions.php");

session_register("srFIRSTNAME");
session_register("srSURNAME");
session_register("srTELEPHONE");
session_register("srEMAILADDR");
session_register("srLOCATION");
session_register("srDETAILS");
session_register("srPAGE_NUM");

include ("bdc_intranet_connect.php");

bdc_small_header("Health Safety and Maintenance Logging");

function log_a_call_form( $SELF, $PAGE_NUM ) {

?>

<title></title>
<H2>Health Safety and Maintenance Logging System</H2>

<?PHP

if ($PAGE_NUM == 1) {
global $srFIRSTNAME;
global $srSURNAME;
global $srTELEPHONE;
global $srEMAILADDR;

?>
<table width="95%" border="0" align="center">
<tr>
<td height="48"><h5>Please complete this form to log any issues
relating to health, safety and maintenance around the Bromsgrove
District Council offices.</h5>
</td>
</tr>
</table>

<H5>Contact Details.</H5>
<table width="95%" border="0" align="center">
<tr>
<td height="48"></td><P>This form will be filled in with details
obtained from your intranet log on details.<br>Please change these
details if they are incorrect.</P>
</td>
</tr>
</table>

<DIV>
<FORM ACTION=<?PHP echo $SELF ?> METHOD=POST NAME=PAGE_1>
<TABLE width="496">
<TR>
<TD width="113" ALIGN=RIGHT>First name</TD>
<TD width="10" ALIGN=RIGHT>&nbsp;</TD>
<TD width="357"><INPUT TYPE=TEXT NAME=FIRSTNAME VALUE="<?PHP
echo $srFIRSTNAME?>" SIZE=20 MAXLENGTH=20></TD>
</TR>
<TR>
<TD ALIGN=RIGHT>Surname</TD>
<TD ALIGN=RIGHT>&nbsp;</TD>
<TD><INPUT TYPE=TEXT NAME=SURNAME VALUE="<?PHP echo
$srSURNAME?>" SIZE=20 MAXLENGTH=20></TD>
</TR>
<TR>
<TD ALIGN=RIGHT>Telephone</TD>
<TD ALIGN=RIGHT>&nbsp;</TD>
<TD><INPUT TYPE=TEXT NAME=TELEPHONE VALUE="<?PHP echo
$srTELEPHONE?>" SIZE=15 MAXLENGTH=15></TD>
</TR>
<TR>
<TD ALIGN=RIGHT>Email Address</TD>
<TD ALIGN=RIGHT>&nbsp;</TD>
<TD><INPUT TYPE=TEXT NAME=EMAILADDR VALUE="<?PHP echo
$srEMAILADDR?>" SIZE=50 MAXLENGTH=50></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE=SUBMIT NAME=NEXT_1 VALUE=Next>
</FORM>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.PAGE_1.FIRSTNAME.focus()
-->
</SCRIPT>

</DIV>

<H4 ALIGN=RIGHT>Page <?PHP echo $PAGE_NUM ?> of 3</H4>
<?PHP
}
?>

<?PHP

if ($PAGE_NUM == 2) {

global $srLOCATION;
global $srDETAILS;

?>
<H5>Information about the issue</H5>
<DIV>
<FORM ACTION=<?PHP echo $SELF ?> METHOD=POST NAME=PAGE_2>
<TABLE width="600" height="271">
<TR valign="middle">
<TD height="31" ALIGN=right valign="middle"> Please enter the
location <BR>of the issue?</TD>
<TD ALIGN=center>&nbsp;</TD>
<TD width="277" align="left"><TEXTAREA NAME=LOCATION ROWS=5
COLS=40><?PHP echo $srLOCATION?></TEXTAREA>
</TD>
</TR>
<TR valign="middle">
<TD height="117" ALIGN=right VALIGN=middle> Please enter
details <br>about the issue</TD>
<TD ALIGN=center>&nbsp;</TD>
<TD align="left"><TEXTAREA NAME=DETAILS ROWS=5 COLS=40><?PHP
echo $srDETAILS?></TEXTAREA></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE=SUBMIT NAME=BACK_2 VALUE=Back>
<INPUT TYPE=SUBMIT NAME=NEXT_2 VALUE=Next>
</FORM>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.PAGE_2.focus()
-->
</SCRIPT>
</DIV>

<H4 ALIGN=RIGHT>Questionnaire Page <?PHP echo $PAGE_NUM ?> of 3</H4>
<?PHP
}
?>

<?PHP

if ($PAGE_NUM == 3) {

global $srFIRSTNAME;
global $srSURNAME;
global $srTELEPHONE;
global $srEMAILADDR;
global $srLOCATION;
global $srDETAILS;
$DATE = date('jS F Y');
print "<H4>Confirmation</H4>";
print "<H5>Click 'Back' to change anything, or press 'Submit' to
process the form</H5>";
print "<TD COLSPAN=3><HR></TD>";
print "<DIV>";
print "<TABLE>";
print "<TR>";
print "<TD ALIGN=RIGHT>Contact Name: </TD>";
print "<TD WIDTH=5></TD>";
print "<TD>" . trim($srFIRSTNAME) . " " . trim($srSURNAME) .
"</TD>";
print "</TR>";
print "<TR>";
print "<TD ALIGN=RIGHT>Telephone: </TD>";
print "<TD WIDTH=3></TD>";
print "<TD>$srTELEPHONE</TD>";
print "</TR>";
print "<TR>";
print "<TD ALIGN=RIGHT>E-Mail Address: </TD>";
print "<TD WIDTH=3></TD>";
print "<TD>$srEMAILADDR</TD>";
print "</TR>";
print "<TR>";
print "<TD COLSPAN=3><HR></TD>";
print "</TR>";
print "<TR>";
print "<TD ALIGN=RIGHT>Date Logged:</TD>";
print "<TD WIDTH=3></TD>";
print "<TD>$DATE</TD>";
print "</TR>";
print "<TR>";
print "<TD COLSPAN=3><HR></TD>";
print "</TR>";
print "<TR>";
print "<TD VALIGN=TOP ALIGN=RIGHT>Issue Location:</TD>";
print "<TD WIDTH=3></TD>";
print "<TD><PRE>$srLOCATION</PRE></TD>";
print "</TR>";
print "<TR>";
print "<TD VALIGN=TOP ALIGN=RIGHT>Issue Details:</TD>";
print "<TD WIDTH=3></TD>";
print "<TD><PRE>$srDETAILS</PRE></TD>";
print "</TR>";
print "</TABLE>";
print "</DIV>";
print "<BR>";
print "<DIV>";
print "<FORM ACTION=$SELF METHOD=POST NAME=PAGE_3>";
print "<INPUT TYPE=SUBMIT NAME=BACK_3 VALUE=Back>";
print "<INPUT TYPE=SUBMIT NAME=SAVE VALUE=Submit>";
print "</FORM>";
print "</DIV>";

}

?>

<?PHP
}
?>

<?PHP

$PAGE_NUM=0;
$dbh = db_connect();

if ($NEXT_1) {

$srFIRSTNAME=$FIRSTNAME;
$srSURNAME =$SURNAME;
$srTELEPHONE=$TELEPHONE;
$srEMAILADDR=$EMAILADDR;

if (Empty($FIRSTNAME)) {
print "<H2 CLASS=ERROR>You have not entered your
firstname</H2>";
$PAGE_NUM=1;
}
elseif (Empty($SURNAME)) {
print "<H2 CLASS=ERROR>You have not entered your
surname</H2>";
$PAGE_NUM=1;
}
elseif (Empty($TELEPHONE)) {
print "<H2 CLASS=ERROR>You have not entered your telephone
number</H2>";
$PAGE_NUM=1;
}
elseif (Empty($EMAILADDR)) {
print "<H2 CLASS=ERROR>You have not entered your email
address</H2>";
$PAGE_NUM=1;
}
else {
$PAGE_NUM=2;
}
}
if ($NEXT_2) {
$srLOCATION =$LOCATION;
$srDETAILS =$DETAILS;

if (Empty($LOCATION)) {
print "<H2 CLASS=ERROR>Please enter a location</H2>\n";
$PAGE_NUM=2;
}
elseif (Empty($DETAILS)) {
print "<H2 CLASS=ERROR>Please enter general information about
your call</H2>\n";
$PAGE_NUM=2;
}
else {
$PAGE_NUM=3;
}
)

if ($SAVE) {
$sql_str = "INSERT INTO hsm_details ( ";
$sql_str .= " logged_by ,";
$sql_str .= " telephone ,";
$sql_str .= " emailaddr ,";
$sql_str .= " location ,";
$sql_str .= " details ,";
$sql_str .= " logged_at )";
$sql_str .= "VALUES ( ";
$sql_str .= " '$srFIRSTNAME' '$srSURNAME', ";
$sql_str .= " '$srTELEPHONE', ";
$sql_str .= " '$srEMAILADDR', ";
$sql_str .= " '$srLOCATION', ";
$sql_str .= " '$srDETAILS' ,";
$sql_str .= " now() ) ";

print $sql_str;
$result = pg_exec($dbh, $sql_str);

$sql_str = "SELECT currval('hsm_seq') as next_hsm_id";
$result = pg_exec($dbh, $sql_str);
$row = pg_fetch_array($result, 0);

$HSM_REF = " " . trim($row[next_hsm_id]);

$SUBJECT = "Health, Safety and Maintenance Issue Logged";
$BODY = "This email confirms that your issue has been logged and
passed on to Direct Services. Thank you for your time. If you need any
other information or help - please call....";

$full_name = get_full_name($LOGIN_ID);
$email_addr = trim(get_user_email(get_user_name($LOGIN_ID))) .
"@..........gov.uk" ;
$mail_from = "$full_name <" .
get_user_email(get_user_name($LOGIN_ID)) .">";
$message = "A new Health, Safety and Maintenance issue has been
logged. Ref $HSM_REF" ;
mail("b.*****@bromsgrove.gov.uk", "New Health, Safety and
Maintenance Issue Logged", $message, "From: $mail_from" );
mail("$email_addr", $SUBJECT, $BODY);

session_unregister("srFIRSTNAME");
session_unregister("srSURNAME");
session_unregister("srTELEPHONE");
session_unregister("srEMAILADDR");
session_unregister("srLOCATION");
session_unregister("srDETAILS");
session_unregister("srPAGE_NUM");

?>

<H5>Confirmation</H5>
<P>Thank you for loggin an issue.<BR>
<BR>
<P>Your logged issue has been submitted and passed on to Direct
Services.<BR>
<BR>
<DIV>
<FORM>
<INPUT TYPE=BUTTON VALUE="Close" NAME=CLOSE
onclick="window.close()">
</FORM>
</DIV>

<?PHP
$PAGE_NUM=99;
}

if ($BACK_3) { $PAGE_NUM=2; }
if ($BACK_2) { $PAGE_NUM=1; }

if ($PAGE_NUM==0) {
$sql_str = "SELECT forename, surname, telephone, email ";
$sql_str .= "FROM Users ";
$sql_str .= "WHERE id = $LOGIN_ID";

$result = pg_exec( $dbh, $sql_str );

$my_row = pg_fetch_array( $result, 0 );

$srFIRSTNAME=trim($my_row[forename]);
$srSURNAME =trim($my_row[surname]);
$srTELEPHONE=trim($my_row[telephone]);
$srEMAILADDR=trim($my_row[email]) . "@........gov.uk";

$PAGE_NUM=1;
}

if ( $PAGE_NUM < 7) {
log_a_call_form($PHP_SELF, $PAGE_NUM);
}
?>
Jul 17 '05 #1
2 2643

"Ben" <be******@zoom.co.uk> wrote in message
news:3e**************************@posting.google.c om...
The page below isn't picking up details or location.

What have I missed?
Thanks in advance,

Ben
____________________________________________
<?PHP

include ("bdc_functions.php");
include ("user_functions.php");


<snipped>

Your question is unclear... how do you mean "not picking up details or
location"... What variables do you expect to be picked up and making the
assumption that you are forms processing, have you tried dumping your form
to a phpinfo() output and then checking for whatever info that you are
missing?
Jul 17 '05 #2
"Ben" <be******@zoom.co.uk> wrote in message
news:3e**************************@posting.google.c om...
The page below isn't picking up details or location.

What have I missed?


Perhaps you should narrow the problem down to a series of lines, or a subset
of your code and repost the snippet. Nobody wants to read through a 100
lines of code to work out exactly where the problem lies when you've got
such a large script that is multiple pages and that would take somebody a
long time to test.

Paulus
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Christopher Richards | last post by:
It is possible to be able to receive email alerts (say, from Google News) and publish them to a web page automatically? I am a novice as far as PHP goes, but I can open and write to a file and...
2
by: Ewa | last post by:
Hello I have inherited a www service after someone, I have problems with PHP parts. As I am complete novice. I will be very greatful for your help - I did not managed to find an answer myself....
5
by: Marian | last post by:
Hi, I am totaly novice in .NET and I am studying a book about this. There was mentioned "assembly". I did not understand, how function does it has . I would like to know the exact run of code...
2
by: OysterCracker | last post by:
Hi - My js knowledge is pretty much cut-'n-paste, and I'd appreciate a little guidance.I have a simple splash webpage that includes an embedded ..wav file of about 60kb. Currently, some dial-up...
21
by: AES/newspost | last post by:
My understanding -- I'm not an expert -- is that on (some? many? all?) standard Internet servers a URL can point to a subdirectory name followed by a backslash, and that links to this URL will...
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
6
by: Sean | last post by:
HI There, I am making the transition from asp to asp .net, I am currenty writing an application that requires a bulk insert from a webform into SQL server, normally I would just create rows of...
4
by: trond | last post by:
Hello all, Before I start I'd like to point out that I am a complete novice when it comes to asp.net - My background is in network and operating systems, and although I have been doing a bit of...
0
by: waggledance | last post by:
I was wondering if anyone here might be able to offer me some advice for someone who can only use Macromedia Dreamweaver MX. I am (clearly!) a web design novice so apologies in advance if this is a...
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: 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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
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,...

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.