Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2007, 10:04 AM   PM User | #1
Hitman
New to the CF scene

 
Join Date: Dec 2006
Location: i'm from anywhere!
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Hitman is an unknown quantity at this point
help with php edit script

hello guys i want to create a php scripts that would edit and the chapter title and number under the book title category... how can i do it please help thanks

here is my script

PHP Code:
<?php



ini_set 
('display_errors',1);

error_reporting (E_ALL & ~E_NOTICE);



ob_start();



include (
"includes/header.inc");



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



        
$book $_POST['booktitle'];

    
$cookie 0;



        include (
"dbconnection.php");

        

         
$result mysql_query("UPDATE book SET booktitle = '{$_POST['booktitle']}' , bookdesc = '{$_POST['bookdesc']}' WHERE bookid = '{$_POST['bookid']}'");

         

        

         

          if (
$result == 1)   {

                            

                

                       echo 
'<div align="center"><b>The Book as updated.</b><br /><br /><a href="addbooks.php"><font color="blue"><b>Back</b></font></a>';

                       

                       

                       }  else  {



                          echo 
"Could not add the entry because:

                             <b>" 
mysql_error() . "</b>.  The query was $query.</p>";

            

            }

               

           

        
mysql_close();   

    } 

    

?>



<form action="editbook.php" method="post" enctype="multipart/form-data" name="form1">

              <table width="570" height="293" border="0" align="center" cellpadding="0" cellspacing="0">

                <tr>

                  <td width="124" height="30"><div align="right"><strong>Select Book:</strong></div></td>

                  <td width="9">&nbsp;</td>

                  <td width="429"><select name="position1"  id="position1">

                  

<?



               
include("dbconnection.php");





        
$position1 mysql_query("SELECT bookid, booktitle from book order by booktitle");



    while(
$row mysql_fetch_array($position1MYSQL_NUM)) {





            echo 
"<option value=\"$row[0]\">$row[1]</option>\n";

                      }



?>

                  </select></td>

                </tr>

                <tr>

                  <td height="31"><div align="right"><strong>Book Title:</strong></div></td>

                  <td>&nbsp;</td>

                  <td><input name="booktitle" type="text" size="40"></td>

                </tr>

                <tr>

                  <td height="200"><div align="right"><strong>Book Description:</strong></div></td>

                  <td>&nbsp;</td>

                  <td><textarea name="bookdesc" cols="40" rows = "10" colums = "100"></textarea></td>

                </tr>

                <tr>

                  <td height="30">&nbsp;</td>

                  <td>&nbsp;</td>

                  <td><input type="submit" name="submit" value="submit"></td>

                </tr>

              </table>

            </form>

<?



include ("includes/footer.inc");



?>
Hitman is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:52 PM.


Advertisement
Log in to turn off these ads.