I am trying to make an online tool that you can log into, and make simple posts with....and I want to be able to edit these posts, or delete these posts that only you have posted,And I want an item search also for finding the items that you want to buy, that other people have posted, but you can't edit using a login.
And I want to do this all in flash, which I know is possible..
I have aim it is:surname45 if that helps you contact me with help!!
someone else has posted this script I hope I can edit to use (but I only just learned how to make a mysql database and to contact the information with rudimentary php);
// Try to connect to the DB
if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
{
echo 'Failed to connect to: "On This Day Database."';
exit;
}
// Select the appropriate db
mysql_select_db(MYSQL_DB);
// Define date variables
$m=date("F");
$d=date("d");
// Check to see if form was self-submitted
if ($HTTP_POST_VARS['do']=='submit')
{
submit_edit($HTTP_POST_VARS);
}
else
{
// Add the passed data (if any) to fill the form
db_filldata($id);
show_edit_form($entry);
}
function submit_edit($variables)
{
mysql_query("UPDATE on_this_day SET month='{$variables['month']}' WHERE id='{$variables['id']}'");
echo "<font size='4' face='arial'><b>The entry has been updated.</b></font><p>\n";
echo "<a href='view_day.php' alt='View Entries'>View Entries</a>\n";
echo " \n";
echo "<a href='add_day.php' alt='Add Entry'>Add Entry</a>";
}
?>
sinapra replied;
you can include all the possible things like, delete, update into one form and on submit can workout with them. What I did is, when you have such a situation and submitting it to the same form, you can add simple 'Button' instead of 'Submit'. Then, the user clicks on a button which would redirect him to the same page, you can set the conditions as per the button he has clicked, say :
<input type=button name=insert>
<input type=button name=delete>
<input type=button name=update>
Now, on top of the page, you can check for the button which has been clicked,
if(isset($insert)){
conditions with queries you want}
else if(isset($delete)){
.........}
and so on.
I hope that can help you
__________________
Regards
Its Great to work and Be Merry!!!!!!!!
Last edited by epiphany77; Mar 17, 2007 at 16:23.
Reason: small touch up of what I want to get done and to take out faulty links
Bookmarks