Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help needed with details page
Old 07-12-2005, 02:14 PM Help needed with details page
Average Talker

Posts: 20
Trades: 0
I finished my data entry forms and results forms (the one's that included math) - thanks for everybody's help! : )

Now I'm working on a details page that shows the results of one of the records selected in the previous page. The ID is passed by URL.

Ok, the reason I'm writing to the forum is because my code isn't working. Here's the error I'm currently getting:

Parse error: syntax error, unexpected '<' in d:\survey_detail.php on line 2

Here's the current code:

PHP Code:

<?
<html>
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Survey Results</title>
<
link href="stylesheet.css" rel="stylesheet" type="text/css" />
</
head>

<
body bgcolor="#FFFFFF" text="#999999" link="#336699" vlink="#666666">
<
table width="705" border="0" align="center" cellpadding="0" cellspacing="0">
  <
tr>
    <
td><a href="http://www.alaska.edu/uacp/"><img src="i/uacp.gif" alt="uacp" name="uacp" width="291" height="116" border="0" id="uacp" /></a><img src="i/line.gif" alt="" name="line" width="353" height="116" border="0" id="line" /><a href="survey.cfm"><img src="i/home.gif" alt="home page" name="home" width="61" height="116" border="0" id="home" /></a></td>
  </
tr>
  <
tr>
    <
td>&nbsp;</td>
  </
tr>
  <
tr>
    <
td>

if (
is_numeric($_GET['ID'])) {

    
$db_name "UACP";

    
$table_name "survey";

    
$connection = @mysql_connect("host""user""password") OR die('Could not connect to MySQL: ' mysql_error());

    
$db = @mysql_select_db($db_name$connection) or die(mysql_error());

    
$query "SELECT ID,client,uacpstaff,DATE_FORMAT(surveydate,'%b %d,%Y') AS surveydate,
    DATE_FORMAT(servicedate,'%c/%e/%y') AS servicedate,servicedesc,knowledge,knowledgec,response,responsec,
    courtesy,courtesyc,comm,commc,ownership,ownershipc,service,servicec,improve,comments,contact
    FROM 
$table_name WHERE ID = {$_GET['ID']}";

    
$result mysql_query($query);

    
$row mysql_fetch_array($result,MYSQL_ASSOC);

    
$avg = ({row['knowledge']} + {row['response']} + {row['courtesy']} + {row['comm']} + {row['ownership']} +
    {
row['service']})/6;

    
mysql_close();

    echo 
"

    <table border="
1" cellpadding="5" cellspacing="0">
    <tr valign="
top">
    <td>Client</td>
    <td colspan="
2"><p>{$row['client']}</p></td>
    </tr>

    <tr valign="
top">
    <td>UACP Staff</td>
    <td colspan="
2"><p>{$row['uacpstaff']}</p></td>
    </tr>

    <tr valign="
top">
    <td>Contact</td>
    <td colspan="
2">
    if 
{$row['contact']} = 'yes' {
        print 'Please contact us regarding this survey.';
    }
    else {
        print 'Do not contact us regarding this survey.';
    }
    </td>
    </tr>

    <tr valign="
top">
    <td>Survey Date</td>
    <td colspan="
2">{$row['surveydate']}</td>
    </tr>

    <tr valign="
top">
    <td>Survey Avg</td>
    <td colspan="
2">print $avg;</td>
    </tr>

    <tr valign="
top">
    <td>Service Date</td>
    <td colspan="
2">{$row['servicedate']}</td>
    </tr>

    <tr valign="
top">
    <td>Service Description</td>
    <td colspan="
2">{$row['servicedesc']}</td>
    </tr>

    <tr valign="
top">
    <td>Knowledge/Ability</td>
    <td nowrap="
nowrap">
    if (
{$row['knowledge']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['knowledge']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['knowledge']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['knowledge']} = 4) {
        print "
Good";
    }
    elseif (
{$row['knowledge']} = 5) {
        print "
Excellent";
    }
    else (
{$row['knowledge']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['knowledgec']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Response Speed</td>
    <td nowrap="
nowrap">
    if (
{$row['response']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['response']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['response']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['response']} = 4) {
        print "
Good";
    }
    elseif (
{$row['response']} = 5) {
        print "
Excellent";
    }
    else (
{$row['response']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['responsec']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Courtesy</td>
    <td nowrap="
nowrap">
    if (
{$row['courtesy']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['courtesy']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['courtesy']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['courtesy']} = 4) {
        print "
Good";
    }
    elseif (
{$row['courtesy']} = 5) {
        print "
Excellent";
    }
    else (
{$row['courtesy']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['courtesyc']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Communication</td>
    <td nowrap="
nowrap">
    if (
{$row['comm']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['comm']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['comm']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['comm']} = 4) {
        print "
Good";
    }
    elseif (
{$row['comm']} = 5) {
        print "
Excellent";
    }
    else (
{$row['comm']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['commc']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Sense of Ownership</td>
    <td nowrap="
nowrap">
    if (
{$row['ownership']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['ownership']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['ownership']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['ownership']} = 4) {
        print "
Good";
    }
    elseif (
{$row['ownership']} = 5) {
        print "
Excellent";
    }
    else (
{$row['ownership']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['ownershipc']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Service</td>
    <td nowrap="
nowrap">
    if (
{$row['service']} = 1) {
        print "
Poor";
    }
    elseif (
{$row['service']} = 2) {
        print "
Fair";
    }
    elseif (
{$row['service']} = 3) {
        print "
Satisfactory";
    }
    elseif (
{$row['service']} = 4) {
        print "
Good";
    }
    elseif (
{$row['service']} = 5) {
        print "
Excellent";
    }
    else (
{$row['service']} = N/A) {
        print "
Not Applicable";
    }
    </td>
    <td>
    print 
{$row['servicec']}&nbsp;
    </td>
    </tr>

    <tr valign="
top">
    <td>Immediate Improvement</td>
    <td colspan="
2">
    print 
{$row['improve']}
    </td>
    </tr>

    <tr valign="
top">
    <td>Other Comments</td>
    <td colspan="
2">
    
{$row['comments']}
    </td>
    </tr>

    </table>
    "
    
}
    </
td>
</
tr>

<
tr><td>&nbsp;</td></tr>
 <
tr>
 <
td><p align="left"><a href="survey_results.php">Back to List</a> ::
          <
a href=\"survey_delete.php?ID={$row['ID']}\">Delete
          this Record</a> </p></td>
          </tr>
</table>
<p>&nbsp;</p>

</body>
</html>
?>
Thanks for any help anyone is able to provide!

S./
ffsja is offline
Reply With Quote
View Public Profile Visit ffsja's homepage!
 
 
Register now for full access!
Old 07-12-2005, 04:27 PM Invalid nesting was the problem
Average Talker

Posts: 20
Trades: 0
I got it. The problem was invalid nesting of html and php code.

S./
ffsja is offline
Reply With Quote
View Public Profile Visit ffsja's homepage!
 
Reply     « Reply to Help needed with details page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38419 seconds with 12 queries