Now need a way to fill the database with information, along with the ability to edit and delete information.
First off create a new folder in your site directory called "admin" or whatever you want. For this purpose, i am using admin as the admin directory.
The code below will call the pre-defined site.inc.php file, and display a form to add a new post:
Notice the code ends with } else { - That's because we still have to process the form once its been submitted. The line: <form action="<? echo $PHP_SELF; ?>" method="POST"> tells the browser that once the submit button has been pressed we can start to process the form contents using the next lot of code.
Validate
This peice will check for errors and validate the text input fields contained in the form:
There we just checked that the user has submitted the correct information in the forms.
Query
Next part of code will login to the database, then generate and execute the query to insert the information:
The above code snippets all together will present the user with a form, once all the fields have been validated after submission the contents of the form are sent to the relevant parts of the database. the insertion to the date field is defined in the sql query as NOW() this inserts a current timestamp into to database as opposed to writing in the date and time by hand.
Subject: "Fatal error: Cannot redeclare db_lo..."
Date: Nov 02 2007 at 4:35 am
Hi,
can you please help me out of this situtaion..... i have configured everything as said by you..... but im getting a error : [Fatal error: Cannot redeclare db_login() (previously declared in C:\wamp\www\news\site\site.inc.php:14) in C:\wamp\www\news\site\site.inc.php on line 21].
i have made all php file diffrent. and index files have the include function.