Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8769085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:14:31+00:00 2026-06-13T17:14:31+00:00

I have a problem with mysql inserting. When the button is clicked, mysql insert

  • 0

I have a problem with mysql inserting. When the button is clicked, mysql insert is making a doublepost. I can’t find the problem. Why is it doubleposting?

code here http://pastebin.com/z1xx3fjt

And postNewTopic.php:

<?
session_start();
mysql_connect('.com', 'user', 'pw');
mysql_select_db('db');

function msg($status,$txt){
    return '{"status":'.$status.',"txt":"'.$txt.'"}';
}

if(empty($_POST['t']) or empty($_POST['ttitle'])){
    die(msg(0,"Complete all fields!"));
}



$title = mysql_real_escape_string($_POST['ttitle']);
$desc = mysql_real_escape_string($_POST['tdesc']);
$msg = mysql_real_escape_string($_POST['t']);


mysql_query("INSERT INTO f_topics(`title`, `text`, `desc`) 
                        VALUES('$title', '$msg', '$desc')");

echo msg(1,mysql_error());
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:14:33+00:00Added an answer on June 13, 2026 at 5:14 pm

    Maybe your /favicon.ico is loading and causing your script to run twice.

    This happens when you have rewrite rules that catch missing files and you have no /favicon.ico. First time it happened to me, it was fun!

    EDIT:

    Consider using HTTPfox or some other tool that tracks browser requests/responses and see how many times the page is loaded. That’s the first thing you need to look for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem in inserting the listbox value into mysql database in vb
i have a problem in inserting the listbox value into mysql database in vb
I have some problem with MySQL Workbench in that I sometimes can't set foreign
JSfiddle: http://jsfiddle.net/ybZvv/57/ I have a fiddle here where the user can append row and
Table in MySQL have 1 problem column: creation_date . During inserting a new row
I have a problem inserting a row in a MySQL table when the table
I am using mysql with PHP. I have a problem with inserting the apostrophe
i have a problem while inserting the date format like mm/dd/yyyy in mySQL. It
I have a problem inserting a row using Entity Framework with the MySQL Connector/NET
I am new to mysql. I have a problem in inserting record to table1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.