Jump to content

Help - Error in my PHP code


NickyJP

Recommended Posts

I am having problems with displaying a webpage form using PHP and mysql. I have sucessful been able to create login sessions and connect to my database. But I am having problems with creating this webpage, the database is based on a childrens library. The webpage i am trying to create is  for librarian to be able to add new book to the database through the use of a form. But at the moment i am getting this below error message:( when i try to display the webpage)

 

Parse error: syntax error, unexpected T_ELSE in /unix/public_html/finalddb/AddNewBooks.php on line 175 ( i have indicated where line 175 is in my code)

 

i have looked through my code and i can't find where this error is coming from.

 

Below is my code:

 

<?

session_start();

if(!session_is_registered(myusername)){

header("location:index_Staff.php");

}

?>

<html>

<head>

<title>

Children's online library - Add New Books

</title>

</head>

<body>

<h1 align=center> Childrens Online Library</h1>

<h2> Add New Books</h2>

<?php

 

//checkif the form has been submitted:

if(isset($_POST['submitted'])) {

 

require_once

('checklogin_staff.php');//Connect to the database.

 

$errors = array(); //initialise an  error array.

 

//Minimal form validation:

if (is_numeric($_POST['BtId']) &&

is_numeric($_POST['value']) &&

is_numeric($_POST['BcId']) &&

is_numeric($_POST['PubId']) &&

is_numeric($_POST['AuthorId']) )

 

// check for a Book Id

if (empty($_POST['BtId'])) {

$errors[] = 'Please enter a value into Book Id.';

} else {

$bkid = trim($_POST['BtId']);

}

//check for a Book Name

if (empty($_POST['BtName'])) {

$errors[] = 'Please enter a value into Book Name.';

} else {

$bn = trim($_POST['BtName']);

}

//check for a Value

if (empty($_POST['Value'])) {

$errors[] = 'Please enter a value into Value.';

} else {

$v = trim($_POST['Value']);

}

//check for a BookCopy Id

if (empty($_POST['BcId'])) {

$errors[] = 'Please enter a value into Book Copy Id.';

} else {

$bcid = trim($_POST['BcId']);

}

//check for date acquried

if (empty($_POST['DateAcquired'])) {

$errors[] = 'Please enter a value into Date Acquired.';

} else {

$da = trim($_POST['DateAcquired']);

}

//check for publisher Id

if (empty($_POST['PubId'])) {

$errors[] = 'Please enter a value into Publisher Id.';

} else {

$pubid = trim($_POST['PubId']);

}

// check for Publisher Name

if (empty($_POST['PubName'])) {

$errors[] = 'Please enter a value into Publisher Name.';

} else {

$pub = trim($_POST['PubName']);

}

// Check Author Id

if (empty($_POST['AuthorId'])) {

$errors[] = 'Please enter a value into Author Id.';

} else {

$authid = trim($_POST['AuthorId']);

}

//check Author Name

if (empty($_POST['AuthorName'])) {

$errors[] = 'Please enter a value into Author Name.';

} else {

$auth = trim($_POST['AuthorName']);

}

// give publisher address a variable

$pubadd = trim($_POST['PubAddress']);

 

if (empty($erros)) {//If everything's ok.

 

// enter the details of the new book into the database...

 

//query

$q = "INSERT INTO BookTitle, BookCopy, Publisher, Author

(BtId, BtName, Value, BcId, DateAcquired, PubId, PubName, PubAddress, AuthorId, AuthorName)

VALUES ('$bkid', '$bn', '$v', '$bcid', '$da' , '$pubid , '$pub', '$authid', '$auth', '$pubadd')";

 

$r = @mysqli_query ($dbc,$q); //run query

if ($r) { //If it ran ok.

 

// Print message below:

 

echo '<h4> Confirmation that the new book has been added to the library Database.</h4>

 

<table align="center" cellspacing="3" cellpadding="3"

width="75%">

<tr>

<td align="center">

<b>Book Id:</b>

</td>

<td align="center">

<b>Book Name:</b>

</td>

<td align="center">

<b>Value:</b> 

</td>

<td align="center">

<b>Book Copy Id: </b>

</td>

<td align="center">

<b>Date Acquired:</b>

</td>

<td align="center">

<b>Publisher Id</b>

</td>

<td align="center">

<b>Publisher Name:</b>

</td>

<td align="center">

<b>Publisher Address:</b>

</td>

<td align="center">

<b>Author Id:</b>

</td>

<td align="center">

<b>Author Name:</b>

</td>

</tr>

';

 

} else {

echo '<h3>System Error<h3>

<p class="error"> The Book could not be added to the database due to a system error. We apologise for any inconvenience.</p>';

 

 

//Fetch and print all the records:

while ($row = mysqli_fetch_array($r,

MYSQLI_ASSOC)) {

echo '<tr><td align="center">' .

$row['BorId'] . '</td>

<td align="center">' .

$row['BtName'] . '</td>

<td align="center">' .

$row['Value'] . '</td>

<td align="center">' .

$row['BcId'] . '</td>

<td align="center">' .

$row['DateAcquired'] . '</td>

<td align="center">' .

$row['PubName'] . '</td>

<td align="center">' .

$row['PubAddress'] . '</td>

<td align="center">' .

$row['AuthorId'] . '</td>

<td align="center">' .

$row['AuthorName'] . '</td>

</tr>

';

}

echo '</table>'; //close the table.

 

mysqli_free_result ($r); //Free up the resources.

 

} else {    // *line 175*

//If it did not run OK.

 

// Public message:

 

echo '<h3>System Error<h3>

<p class="error"> The current data could not be retrieved. We apologise for any inconvenience.</p>';

 

//Debugging message:

echo '<p>' .mysqli_error($dbc) .

'<br /><br />Query: '. $q .

'</p>';

} // end of if($r) IF.

 

mysqli_close($dbc); // the database is closed

 

// quit the script:

 

exit();

 

} else { // Report the errors.

 

echo '<h1>Error!</h1>

<p class="error">The following error(s) occured:<br />';

for each ($errors as $msg)

{//Print each error.

echo " - $msg<br />\n";

}

echo '</p><p>Please try again.</p><p><br /></p>';

} // end of if (empty($errors)) IF.

 

}// End of the main Submit conditional.

?>

<form action="AddNewBooks.php"

method="post">

<fieldset>

<h4>

Please enter the information of the new book below :

</h4>

 

<p>

<b>Book ID</b>

<input type="text"

name="BtId"

Size="5"

maxlength="5"

value="<?php if

(isset($_POST['BtId'])) echo

$_POST['BtId']; ?>" /></p>

 

<p>

<b>Book Name:</b>

<input type="text"

name="BtName"

size="30"

maxlength="30"

value="<?php if

(isset($_POST['BtName'])) echo

$_POST['BtName']; ?>" /></p>

 

 

<p>

<b>Value:</b>

<input type="decimal"

name="Value"

size="6"

maxlength="6"

value="<?php if

(isset($_POST['Value'])) echo

$_POST['Value']; ?>" /></p>

 

 

<p>

<b>Book Copy:</b>

<input type="text"

name="BcId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['BcId'])) echo

$_POST['BcId']; ?>" /></p>

 

<p>

<b>Date Acquired:</b>

<input type="date"

name="DateAcquired"

 

value="<?php if

(isset($_POST['DateAcquired'])) echo

$_POST['DateAcquired']; ?>" /></p>

 

<p>

<b>Publisher ID:</b>

<input type="text"

name="PubId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['PubId'])) echo

$_POST['PubId']; ?>" /></p>

 

<p>

<b>Publisher Name:</b>

<input type="text"

name="PubName"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['PubName'])) echo

$_POST['PubName']; ?>" /></p>

 

 

<p>

<b>Publisher Address:</b>

<input type="text"

name="PubAddress"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['PubAddress'])) echo

$_POST['PubAddress']; ?>" /></p>

 

 

<p>

<b>Author ID:</b>

<input type="text"

name="AuthorId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['AuthorId'])) echo

$_POST['AuthorId']; ?>" /></p>

 

<p>

<b>Author Name:</b>

<input type="text"

name="AuthorName"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['AuthorName'])) echo

$_POST['AuthorName']; ?>" /></p>

 

 

<p>

<input type="Submit"

name="Submit"

value="Add New Book" />

</p>

 

<p>

<input type="reset"

name="reset"

value="Reset" />

</p>

 

<input type="hidden"

name="Submitted"

value="TRUE" />

</fieldset>

</form>

 

<?php

 

include ('includes/footer.html');

 

?>

</body>

</html>

 

Any help would be much apprepricated. (apologies for the long code)

 

Nicky

Link to comment
https://forums.phpfreaks.com/topic/147576-help-error-in-my-php-code/
Share on other sites

Sorry, i will do that next time.

 

Thanks for your help, that seemed to resolved that error, but another has appeared involving the way i have blocked the code. Please see error message below:

 

Parse error: syntax error, unexpected '{', expecting '(' in /unix/public_html/finalddb/AddNewBooks.php on line 143

 

Please see below code:

[<?

session_start();

if(!session_is_registered(myusername)){

header("location:index_Staff.php");

}

?>

<html>

<head>

<title>

Children's online library - Add New Books

</title>

</head>

<body>

<h1 align=center> Childrens Online Library</h1>

<h2> Add New Books</h2>

<?php

 

//checkif the form has been submitted:

if(isset($_POST['submitted'])) {

 

require_once

('checklogin_staff.php');//Connect to the database.

 

$errors = array(); //initialise an  error array.

 

//Minimal form validation:

if (is_numeric($_POST['BtId']) &&

is_numeric($_POST['value']) &&

is_numeric($_POST['BcId']) &&

is_numeric($_POST['PubId']) &&

is_numeric($_POST['AuthorId']) )

 

// check for a Book Id

if (empty($_POST['BtId'])) {

$errors[] = 'Please enter a value into Book Id.';

} else {

$bkid = trim($_POST['BtId']);

}

//check for a Book Name

if (empty($_POST['BtName'])) {

$errors[] = 'Please enter a value into Book Name.';

} else {

$bn = trim($_POST['BtName']);

}

//check for a Value

if (empty($_POST['Value'])) {

$errors[] = 'Please enter a value into Value.';

} else {

$v = trim($_POST['Value']);

}

//check for a BookCopy Id

if (empty($_POST['BcId'])) {

$errors[] = 'Please enter a value into Book Copy Id.';

} else {

$bcid = trim($_POST['BcId']);

}

//check for date acquried

if (empty($_POST['DateAcquired'])) {

$errors[] = 'Please enter a value into Date Acquired.';

} else {

$da = trim($_POST['DateAcquired']);

}

//check for publisher Id

if (empty($_POST['PubId'])) {

$errors[] = 'Please enter a value into Publisher Id.';

} else {

$pubid = trim($_POST['PubId']);

}

// check for Publisher Name

if (empty($_POST['PubName'])) {

$errors[] = 'Please enter a value into Publisher Name.';

} else {

$pub = trim($_POST['PubName']);

}

// Check Author Id

if (empty($_POST['AuthorId'])) {

$errors[] = 'Please enter a value into Author Id.';

} else {

$authid = trim($_POST['AuthorId']);

}

//check Author Name

if (empty($_POST['AuthorName'])) {

$errors[] = 'Please enter a value into Author Name.';

} else {

$auth = trim($_POST['AuthorName']);

}

// give publisher address a variable

$pubadd = trim($_POST['PubAddress']);

 

if (empty($erros)) {//If everything's ok.

 

// enter the details of the new book into the database...

 

//query

$q = "INSERT INTO BookTitle, BookCopy, Publisher, Author

(BtId, BtName, Value, BcId, DateAcquired, PubId, PubName, PubAddress, AuthorId, AuthorName)

VALUES ('$bkid', '$bn', '$v', '$bcid', '$da' , '$pubid , '$pub', '$authid', '$auth', '$pubadd')";

 

$r = @mysqli_query ($dbc,$q); //run query

if ($r) { //If it ran ok.

 

// Print message below:

 

echo '<h4> Confirmation that the new book has been added to the library Database.</h4>

 

<table align="center" cellspacing="3" cellpadding="3"

width="75%">

<tr>

<td align="center">

<b>Book Id:</b>

</td>

<td align="center">

<b>Book Name:</b>

</td>

<td align="center">

<b>Value:</b> 

</td>

<td align="center">

<b>Book Copy Id: </b>

</td>

<td align="center">

<b>Date Acquired:</b>

</td>

<td align="center">

<b>Publisher Id</b>

</td>

<td align="center">

<b>Publisher Name:</b>

</td>

<td align="center">

<b>Publisher Address:</b>

</td>

<td align="center">

<b>Author Id:</b>

</td>

<td align="center">

<b>Author Name:</b>

</td>

</tr>

';

}

 

else if{ // *line 143*

 

echo '<h3>System Error<h3>

<p class="error"> The Book could not be added to the database due to a system error. We apologise for any inconvenience.</p>';

 

 

//Fetch and print all the records:

while ($row = mysqli_fetch_array($r,

MYSQLI_ASSOC)) {

echo '<tr><td align="center">' .

$row['BorId'] . '</td>

<td align="center">' .

$row['BtName'] . '</td>

<td align="center">' .

$row['Value'] . '</td>

<td align="center">' .

$row['BcId'] . '</td>

<td align="center">' .

$row['DateAcquired'] . '</td>

<td align="center">' .

$row['PubName'] . '</td>

<td align="center">' .

$row['PubAddress'] . '</td>

<td align="center">' .

$row['AuthorId'] . '</td>

<td align="center">' .

$row['AuthorName'] . '</td>

</tr>

';

}

echo '</table>'; //close the table.

 

mysqli_free_result ($r); //Free up the resources.

 

}else {

//If it did not run OK.

 

// Public message:

 

echo '<h3>System Error<h3>

<p class="error"> The current data could not be retrieved. We apologise for any inconvenience.</p>';

 

//Debugging message:

echo '<p>' .mysqli_error($dbc) .

'<br /><br />Query: '. $q .

'</p>';

} // end of if($r) IF.

 

mysqli_close($dbc); // the database is closed

 

// quit the script:

 

exit();

 

} else { // Report the errors.

 

echo '<h1>Error!</h1>

<p class="error">The following error(s) occured:<br />';

for each ($errors as $msg)

{//Print each error.

echo " - $msg<br />\n";

}

echo '</p><p>Please try again.</p><p><br /></p>';

} // end of if (empty($errors)) IF.

 

}// End of the main Submit conditional.

?>

<form action="AddNewBooks.php"

method="post">

<fieldset>

<h4>

Please enter the information of the new book below :

</h4>

 

<p>

<b>Book ID</b>

<input type="text"

name="BtId"

Size="5"

maxlength="5"

value="<?php if

(isset($_POST['BtId'])) echo

$_POST['BtId']; ?>" /></p>

 

<p>

<b>Book Name:</b>

<input type="text"

name="BtName"

size="30"

maxlength="30"

value="<?php if

(isset($_POST['BtName'])) echo

$_POST['BtName']; ?>" /></p>

 

 

<p>

<b>Value:</b>

<input type="decimal"

name="Value"

size="6"

maxlength="6"

value="<?php if

(isset($_POST['Value'])) echo

$_POST['Value']; ?>" /></p>

 

 

<p>

<b>Book Copy:</b>

<input type="text"

name="BcId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['BcId'])) echo

$_POST['BcId']; ?>" /></p>

 

<p>

<b>Date Acquired:</b>

<input type="date"

name="DateAcquired"

 

value="<?php if

(isset($_POST['DateAcquired'])) echo

$_POST['DateAcquired']; ?>" /></p>

 

<p>

<b>Publisher ID:</b>

<input type="text"

name="PubId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['PubId'])) echo

$_POST['PubId']; ?>" /></p>

 

<p>

<b>Publisher Name:</b>

<input type="text"

name="PubName"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['PubName'])) echo

$_POST['PubName']; ?>" /></p>

 

 

<p>

<b>Publisher Address:</b>

<input type="text"

name="PubAddress"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['PubAddress'])) echo

$_POST['PubAddress']; ?>" /></p>

 

 

<p>

<b>Author ID:</b>

<input type="text"

name="AuthorId"

size="5"

maxlength="5"

value="<?php if

(isset($_POST['AuthorId'])) echo

$_POST['AuthorId']; ?>" /></p>

 

<p>

<b>Author Name:</b>

<input type="text"

name="AuthorName"

size="20"

maxlength="20"

value="<?php if

(isset($_POST['AuthorName'])) echo

$_POST['AuthorName']; ?>" /></p>

 

 

<p>

<input type="Submit"

name="Submit"

value="Add New Book" />

</p>

 

<p>

<input type="reset"

name="reset"

value="Reset" />

</p>

 

<input type="hidden"

name="Submitted"

value="TRUE" />

</fieldset>

</form>

 

<?php

 

include ('includes/footer.html');

 

?>

</body>

</html>]

 

Any help would be much apprepricated.

 

Nicky

he meant this:

[code]php/html source code goes here[ /code]

 

without  the blank before /code of course.

 

I've used a code beatuifier real quick, that's why it looks a little different right now, also the line numbers have changed slightly.

 

ok...

line 140:

<?php if(WHAT){?>

line 189: foreach, not for each

 

<?php
  session_start();
  if (!session_is_registered(myusername)) {
      header("location:index_Staff.php");
  }
?>
<html>
<head>
<title>
Children's online library - Add New Books
</title>
</head>
<body>
<h1 align=center> Childrens Online Library</h1>
<h2> Add New Books</h2>
<?php
  //checkif the form has been submitted:
  if (isset($_POST['submitted'])) {
      require_once //Connect to the database.('checklogin_staff.php');
      
      //initialise an  error array.
      $errors = array();
      
      //Minimal form validation:
      if (is_numeric($_POST['BtId']) && is_numeric($_POST['value']) && is_numeric($_POST['BcId']) && is_numeric($_POST['PubId']) && is_numeric($_POST['AuthorId']))
          // check for a Book Id
          if (empty($_POST['BtId'])) {
              $errors[] = 'Please enter a value into Book Id.';
          } else {
              $bkid = trim($_POST['BtId']);
          }
      //check for a Book Name
      if (empty($_POST['BtName'])) {
          $errors[] = 'Please enter a value into Book Name.';
      } else {
          $bn = trim($_POST['BtName']);
      }
      //check for a Value
      if (empty($_POST['Value'])) {
          $errors[] = 'Please enter a value into Value.';
      } else {
          $v = trim($_POST['Value']);
      }
      //check for a BookCopy Id
      if (empty($_POST['BcId'])) {
          $errors[] = 'Please enter a value into Book Copy Id.';
      } else {
          $bcid = trim($_POST['BcId']);
      }
      //check for date acquried
      if (empty($_POST['DateAcquired'])) {
          $errors[] = 'Please enter a value into Date Acquired.';
      } else {
          $da = trim($_POST['DateAcquired']);
      }
      //check for publisher Id
      if (empty($_POST['PubId'])) {
          $errors[] = 'Please enter a value into Publisher Id.';
      } else {
          $pubid = trim($_POST['PubId']);
      }
      // check for Publisher Name
      if (empty($_POST['PubName'])) {
          $errors[] = 'Please enter a value into Publisher Name.';
      } else {
          $pub = trim($_POST['PubName']);
      }
      // Check Author Id
      if (empty($_POST['AuthorId'])) {
          $errors[] = 'Please enter a value into Author Id.';
      } else {
          $authid = trim($_POST['AuthorId']);
      }
      //check Author Name
      if (empty($_POST['AuthorName'])) {
          $errors[] = 'Please enter a value into Author Name.';
      } else {
          $auth = trim($_POST['AuthorName']);
      }
      // give publisher address a variable
      $pubadd = trim($_POST['PubAddress']);
      
      if (empty($erros)) {
          //If everything's ok.
          
          // enter the details of the new book into the database...
          
          //query
          $q = "INSERT INTO BookTitle, BookCopy, Publisher, Author
(BtId, BtName, Value, BcId, DateAcquired, PubId, PubName, PubAddress, AuthorId, AuthorName)
VALUES ('$bkid', '$bn', '$v', '$bcid', '$da' , '$pubid , '$pub', '$authid', '$auth', '$pubadd')";
          
          //run query
          $r = @mysqli_query($dbc, $q);
          if ($r) {
              //If it ran ok.
              
              // Print message below:
              
              echo '<h4> Confirmation that the new book has been added to the library Database.</h4>

<table align="center" cellspacing="3" cellpadding="3"
width="75%">
<tr>
<td align="center">
<b>Book Id:</b>
</td>
<td align="center">
<b>Book Name:</b>
</td>
<td align="center">
<b>Value:</b>   
</td>
<td align="center">
<b>Book Copy Id: </b>
</td>
<td align="center">
<b>Date Acquired:</b>
</td>
<td align="center">
<b>Publisher Id</b>
</td>
<td align="center">
<b>Publisher Name:</b>
</td>
<td align="center">
<b>Publisher Address:</b>
</td>
<td align="center">
<b>Author Id:</b>
</td>
<td align="center">
<b>Author Name:</b>
</td>
</tr>
';
          }
          
          else
              if{ // *line 143*
              
              echo '<h3>System Error<h3>
<p class="error"> The Book could not be added to the database due to a system error. We apologise for any inconvenience.</p>';
          
          
          //Fetch and print all the records:
          while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
              echo '<tr><td align="center">' . $row['BorId'] . '</td>
<td align="center">' . $row['BtName'] . '</td>
<td align="center">' . $row['Value'] . '</td>
<td align="center">' . $row['BcId'] . '</td>
<td align="center">' . $row['DateAcquired'] . '</td>
<td align="center">' . $row['PubName'] . '</td>
<td align="center">' . $row['PubAddress'] . '</td>
<td align="center">' . $row['AuthorId'] . '</td>
<td align="center">' . $row['AuthorName'] . '</td>
</tr>
';
          }
          //close the table.
          echo '</table>';
          
          //Free up the resources.
          mysqli_free_result($r);
      } else {
          //If it did not run OK.
          
          // Public message:
          
          echo '<h3>System Error<h3>
<p class="error"> The current data could not be retrieved. We apologise for any inconvenience.</p>';
          
          //Debugging message:
          echo '<p>' . mysqli_error($dbc) . '<br /><br />Query: ' . $q . '</p>';
      }
      // end of if($r) IF.
      
      // the database is closed
      mysqli_close($dbc);
      
      // quit the script:
      
      exit();
  } else {
      // Report the errors.
      
      echo '<h1>Error!</h1>
<p class="error">The following error(s) occured:<br />';
      for each($errors as $msg)
      {
          //Print each error.
          echo " - $msg<br />\n";
      }
      echo '</p><p>Please try again.</p><p><br /></p>';
  }
  // end of if (empty($errors)) IF.
  
  }// End of the main Submit conditional.
?>
<form action="AddNewBooks.php"
method="post">
<fieldset>
<h4>
Please enter the information of the new book below :
</h4>

<p>
<b>Book ID</b>
<input type="text"
name="BtId"
Size="5"
maxlength="5"
value="<?php
  if (isset($_POST['BtId']))
      echo $_POST['BtId'];
?>" /></p>

<p>
<b>Book Name:</b>
<input type="text"
name="BtName"
size="30"
maxlength="30"
value="<?php
  if (isset($_POST['BtName']))
      echo $_POST['BtName'];
?>" /></p>


<p>
<b>Value:</b>
<input type="decimal"
name="Value"
size="6"
maxlength="6"
value="<?php
  if (isset($_POST['Value']))
      echo $_POST['Value'];
?>" /></p>


<p>
<b>Book Copy:</b>
<input type="text"
name="BcId"
size="5"
maxlength="5"
value="<?php
  if (isset($_POST['BcId']))
      echo $_POST['BcId'];
?>" /></p>

<p>
<b>Date Acquired:</b>
<input type="date"
name="DateAcquired"

value="<?php
  if (isset($_POST['DateAcquired']))
      echo $_POST['DateAcquired'];
?>" /></p>

<p>
<b>Publisher ID:</b>
<input type="text"
name="PubId"
size="5"
maxlength="5"
value="<?php
  if (isset($_POST['PubId']))
      echo $_POST['PubId'];
?>" /></p>

<p>
<b>Publisher Name:</b>
<input type="text"
name="PubName"
size="20"
maxlength="20"
value="<?php
  if (isset($_POST['PubName']))
      echo $_POST['PubName'];
?>" /></p>


<p>
<b>Publisher Address:</b>
<input type="text"
name="PubAddress"
size="20"
maxlength="20"
value="<?php
  if (isset($_POST['PubAddress']))
      echo $_POST['PubAddress'];
?>" /></p>


<p>
<b>Author ID:</b>
<input type="text"
name="AuthorId"
size="5"
maxlength="5"
value="<?php
  if (isset($_POST['AuthorId']))
      echo $_POST['AuthorId'];
?>" /></p>

<p>
<b>Author Name:</b>
<input type="text"
name="AuthorName"
size="20"
maxlength="20"
value="<?php
  if (isset($_POST['AuthorName']))
      echo $_POST['AuthorName'];
?>" /></p>


<p>
<input type="Submit"
name="Submit"
value="Add New Book" />
</p>

<p>
<input type="reset"
name="reset"
value="Reset" />
</p>

<input type="hidden"
name="Submitted"
value="TRUE" />
</fieldset>
</form>

<?php
  include('includes/footer.html');
?>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.