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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:29:42+00:00 2026-05-26T08:29:42+00:00

Since my project gets bigger and bigger I start to loose overview :) I

  • 0

Since my project gets bigger and bigger I start to loose overview 🙂
I have alot of Ajax requets and for ever request an appropriate file
like: “newbill.php”,”newcustomer.php” and so on..meaning for every singele request a new one?

My Question is: is there any way to somehow get around this?
What I thought of is to pass the name of a function within the POST of the ajax
to call the appropriate function within the php..
but I somehow dont feel comfortable with it neither??

Sample(javascript)

    // Kundendaten updaten
$("a#updateKunde").click(function(evt){

    formSerial2 = $('#baseForm').serialize();
    evt.preventDefault();
       $.ajax({
            type: "POST",
            **url: "ajax/updatecustomer.php"**,
            data: formSerial2,
            success: function(msg){                 
                $(".alert").html(msg)
                           .css("color","#66b451")
                           .hide()
                           .show('slow')
                           .fadeOut(2000)
                           .hide('slow');

            }
        });         
});

PHP-file(updatecostumer.php)

<?php 

    include_once("../_class/queries.php");

        $kn = $_POST['selKunden'];

        $vn = $_POST['ivname'];
        $na = $_POST['iname'];
        $st = $_POST['istrasse'];
        $pl = $_POST['iplz'];
        $or = $_POST['iort']; 
        $em = $_POST['iemail'];

        connect::getQuery("UPDATE  Kunde SET  vname =  '".$vn."', 
                             name =  '".$na."',
                             adresse =  '".$st."',
                             plz =  '".$pl."',
                             ort =  '".$or."',
                             email =  '".$em."' 
                             WHERE  Kunde.ID =".$kn."");                        


        echo(" Kunde Nr: ".$kn." wurde upgedated");

 ?>
  • 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-26T08:29:42+00:00Added an answer on May 26, 2026 at 8:29 am

    so a few comments here..

    First never ever ever take direct input and push to your DB. Always escape entry from your users to avoid SQL Injection:

    $st = mysql_real_escape_string($_POST['istrasse']);
    

    Secondly; you could have an action clause in your post to a file such as ajax.php. Through this you would then be able to handle different actions. I wouldn’t suggest passing a function name, but create a list of actions which lead you to the class you need done. If you have common post parameters for various actions you could then take and reuse code on your ajax page rather than having multiple other pages out there doing the exact same escaping / querying.

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

Sidebar

Related Questions

Ever since I created this Rails 3.2.3 project to use MiniTest, I have been
It depends. a) Sure, but since the entire project gets turned into one .dll,
I ask since a project I work on generates a single, monolithic DLL of
I'm undertaking a project with a learning purpose. Since this project is compelling to
Since converting my project to ARC, it seems the analyzer is a bit in
I'm implementing a simple Graph library for my uni project and since this is
Since I'm more comfortable using Eclipse, I thought I'd try converting my project from
Since yesterday, I've been facing a compiling error for my C project. The project
A project I am working on is using pushState, but since Internet Explorer can't
We started a Web Project in Eclipse 3.2 a ways back and we've since

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.