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 9017263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:13:30+00:00 2026-06-16T04:13:30+00:00

everyone.. trying to submit a form.. and form and php code is in the

  • 0

everyone..

trying to submit a form.. and form and php code is in the same file index.php

if(isset($_POST['post_form'])) {
    echo "ISSET";

    $post_sender=$id;
    $post_reciever=$id2;
    $post_cont=$_POST['news_text'];
    $post_cont=htmlentities($post_cont);
    $post_cont=mysql_real_escape_string($post_cont);

    $post_sql=mysql_query("INSERT INTO wall_posts (from, to, content, date) VALUES ('$post_sender','$post_reciever','$post_cont',now())") or die(mysql_error());

    }else{
        echo "NOT SET";
    }

html form

<form  method='POST' action='index.php' enctype='multipart/form-data' id='news_form' name='post_form' >
<textarea id='news_text' name='news_text' >type here..........</textarea>

<input type='submit' id='wall_post_btn' name='wall_post_btn' value='submit'>

</form>

where is my mistake..???

there is no mistake in the code..the file itself is corrupted..just made a test in a new PHP file…works just fine…thanks guys..

  • 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-16T04:13:32+00:00Added an answer on June 16, 2026 at 4:13 am

    The problem is You are checking the name of the form present in the $_POST, which is never present…

    What You should test is the name of the submit button, e.g.:

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

    Next You could use one line for sanitizing the input:

    $post_cont= mysql_real_escape_string(htmlentities($_POST['news_text']));
    

    And last one: start using PDO with prepared statements or at least mysqli_* functions as mysql_* ones are deprecated now…

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

Sidebar

Related Questions

Hi everyone I am trying to submit a form without the page reloading, a
Hello everyone I been trying get php uploader working but having a lot of
I am trying to bulk disable all the submit buttons present in my form.
Hey everyone i am trying to write this code and I am having problems
Hello Everyone Iam trying to bulk insert data from .dat file(unloaded from sybase) in
Hi everyone i'm trying to parse xml files using java using code below.. try{
Hey everyone I am trying to .submit some values with ajax response and i
Hi everyone I'm trying to incorporate jQuery AJAX on my multi-step form so that
Hi everyone Im trying to post some data to a php script using AppMancer
hello everyone im trying to create this tweak that copies a file from one

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.