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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:50:42+00:00 2026-06-15T20:50:42+00:00

In an attempt to learn PDO I am using the sakila database to set

  • 0

In an attempt to learn PDO I am using the sakila database to set up prepared inserts, selects, updates etc along with using a PDO connection in a class. I am using php and WAMP

What I am doing: I am trying to submit a form using the class and a method as the action. I also need to reference the class/method in the Ajax URL. Getting data from the class method to display is easy. I do not know how to use it with forms.

I have read/watched tons of tutorials but all reference the data coming into the class, but never how it got there from the form.

I know that to use a class in a page you must do it like this

$class=New Class();
$class->method();

How do you translate that to a form action and a URL in ajax?

<form action="CLASS/METHOD" method="POST" id="addmail">

$.ajax({
type: "POST",
    url: "CLASS/METHOD", 
    data: data,

Ive no problem with jquery, it is submitting the correct form inputs in an alert after serialization. I am just lost on this one action that I cant find the answer to any wheres.

Thank you for your consideration, I hope I presented this clearly

EDIT if this cannot be done with a class, could you just reference a function as in

action "<?php insert();?>" 
  • 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-15T20:50:43+00:00Added an answer on June 15, 2026 at 8:50 pm

    So as opposed in my comments, I’d go this way:

    In Your index.php watch for URL like mentioned in comment above and if present (e.g. /user/create/) just instantiate new User and call it’s method create(). Nothing more trivial I could suggest. Better if You place that in some routes.php script where You can handle more of these actions…

    PS: now I’m not sure why suggest this in answer when You decided to forget about classes and go with procedural PHP…

    My opinion: Go with OO PHP, procedural PHP is relic.

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

Sidebar

Related Questions

I'm trying to write a Date class in an attempt to learn C++. I'm
I'm just starting to learn F# using VS2010 and below is my first attempt
I'm making an attempt to learn C++ over again, using Sams Teach Yourself C++
In an attempt to learn JS OOP I am viewing the source code of
in my attempt to learn a bit faster the use of spring and hibernate
In an attempt to learn to use PInvoke in C#, I'm a little unsure
In an attempt to learn C#, I am trying to develop Picasa Like Application
I attempt to use webservice return POCO class generated from entity data model as
In attempt to learn Hadoop, I am practicing unsolved programming questions from the book
I am trying to learn to make a basic game using pygame. I want

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.