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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:30:05+00:00 2026-06-06T14:30:05+00:00

I am making a PHP application, testing out Object Orientation with it as I

  • 0

I am making a PHP application, testing out Object Orientation with it as I am trying to learn OO as opposed to procedural programming.

Basically I have a list of courses the user can book using the system, and they appear in the users profile. From the profile I want a “remove” link next to each booked course which when clicked, removes the course.

Will I have to use a html form for this? I have started doing it but it doesnt seem right. I have a function called “delete_course” which does the stuff I want it to do, and all I need to pass over is the ID of the post in the DB. So… my question is… would it be best practice to post over the ID in a form to a page with the function call?

And if this is the best way, is it best to post it to the SAME (current) page the user is on, or post to another page, say, “cancel_course.php”??? What are the benefits?

Thanks

Oh and btw, I am relatively new to PHP but have done plenty of JS so I know ajax is a better option, just trying to learn PHP 🙂

  • 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-06T14:30:06+00:00Added an answer on June 6, 2026 at 2:30 pm

    If you want to POST a variable over HTTP without using JavaScript, you will need a form in your HTML, with a method attribute of ‘post’.

    Each delete button could have a value of the course’s ID in the database which would make it easy for you to identify what course is being deleted in your PHP.

    HTML:

    <form method="post">
        <ul>
            <li>
                <h1>Learn how to sew course</h1>
                <button type="submit" name="deleteCourse" value="1">Delete</button>
            </li>
            <li>
                <h1>Learn how to knit course</h1>
                <button type="submit" name="deleteCourse" value="2">Delete</button>
            </li>
    </form>
    

    PHP:

    if(!empty($_POST["deleteCourse"])) {
        $courseList->deleteById($_POST["deleteCourse"]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am in the process of making a PHP web application. I have a
I'm making a web application using PHP in where I have a form that
This is the first time I'll be making a PHP application that will have
I have just made my first proper little desktop GUI application that basically wraps
I am making a PHP web Application in which i am using MySQL as
We're in the middle of making a new e-commerce related PHP application and we
As in title, I am making a PHP-Based intranet application Call center, I've finished
I have a long running PHP script. I am making the database connection at
I have a web application using PHP and PDO with SQLSRV prepared statements to
I am making a PHP tool that connects to a repository, downloads the list

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.