Using html,php and mysql

Posted on 2009-02-16
Last Modified: 2013-12-12
when i click on the radio button i want that data to be stored in the database. can any1 help me plz.
Question by:tracy_p
    LVL 9

    Expert Comment

    Hi Tracy,

    Have you got the HTML form for us to see? It'd be easier to know what you mean and adapt the solution to your problem.

    Author Comment

    Thanks a lot for your reply. I found the solution for myself.
    LVL 8

    Expert Comment

    try this
    if (isset($_POST['S1'])) {
    echo  "username = ".$_POST['username']."<br>";
    echo  "password = ".$_POST['pass']."<br>";
    //do your sql insert statment
    <form name="form" action="<?=$_SERVER['php_SELF']?>" method="POST">
    <input name="username" type="text">
    <input name="pass" type="password">
    <input type="radio" name="S1" value="ABC" onClick="this.form.submit();">

    Open in new window


    Accepted Solution

    Question PAQ'd, 500 points refunded, and stored in the solution database.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to dynamically set the form action using jQuery.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now