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

  • Home
  • SEARCH
  • 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 544307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:38:26+00:00 2026-05-13T10:38:26+00:00

hello im trying to set custom errors. i got a form. actions to post.php

  • 0

hello im trying to set custom errors. i got a form. actions to post.php i dont want form to go post.php for errors i need to set errors in same page. i tried

$sql = "
    INSERT INTO yazilar (baslik, spot, spot_kisa, spot_resim, spot_resim_isim, icerik, kategori, tiklanma, eklemetarihi)
    VALUES
    ('$_POST[baslik]','$_POST[spot]','$_POST[spot_kisa]','$_POST[spot_resim]','$_POST[spot_resim_isim]','$_POST[icerik]','$_POST[kategori]','$_POST[tiklanma]','$_POST[tarih]')
";
$sonuc = mysql_query($sql);

<?
    if ($sonuc) {
        echo ("<p class='msg done'>Yeni icerik basarili bir sekilde eklendi.</p>");
    } 
    if(! $sonuc) {
        echo ("<p class='msg warning'>Ekleme basarisiz oldu.</p>");  
    }
?>

this always shows Yeni icerik basarili bir sekilde eklendi.

this.

help me plx

  • 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-05-13T10:38:27+00:00Added an answer on May 13, 2026 at 10:38 am

    If you’re trying to have your errors show up in the submitting form just move your post.php code into your form page and condition it like this:

    <?php
    if(isset($_POST['baslik'])) {
      $sql = "
        INSERT INTO yazilar (baslik, spot, spot_kisa, spot_resim, spot_resim_isim, icerik, kategori, tiklanma, eklemetarihi)
        VALUES
        ('$_POST[baslik]','$_POST[spot]','$_POST[spot_kisa]','$_POST[spot_resim]','$_POST[spot_resim_isim]','$_POST[icerik]','$_POST[kategori]','$_POST[tiklanma]','$_POST[tarih]')
    ";
      $sonuc = mysql_query($sql);
    
      if ($sonuc) {
        echo ("<p class='msg done'>Yeni icerik basarili bir sekilde eklendi.</p>");
        exit;
      } 
      else {
        $error = "<p class='msg warning'>Ekleme basarisiz oldu.</p>";  
      }
    }
    ?>
    
    // form code here
    <?php if(isset($error)) { echo $error; } ?>
    // around where you'd like the error to display
    

    Now if the action is a success the success message will display with nothing else, otherwise the form will be redisplayed with the error message where you positioned it. Also, please see soulmerge’s comments on SQL injection, it’s a serious security risk that can be easily avoided.

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

Sidebar

Ask A Question

Stats

  • Questions 302k
  • Answers 302k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try fs.SetLength(0); before Save call May 13, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer Yes, this should not be a problem. Just include the… May 13, 2026 at 8:28 pm
  • Editorial Team
    Editorial Team added an answer Property Access strategies are described in the reference documentation under… May 13, 2026 at 8:28 pm

Related Questions

I'm trying to Databind to my custom dictionary class. In formLoad, I can bind
OK... I'm a VB.NET WinForms guy trying to understand WPF and all of its
I've just begun learning some x86 assembly on win32, and I've used masm with
So, let's say I have this code (VB.Net): Sub Main() dim xxx as string
Is there a good way in C# to mimic the following python syntax: mydict

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.