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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:58:18+00:00 2026-05-20T03:58:18+00:00

I’ve been so out of touch with using PHP outside of content management systems

  • 0

I’ve been so out of touch with using PHP outside of content management systems that I’ve forgot some of the basic syntax etc. What I’m trying to build is a simple form that collects some user data and sends it to a database table called ‘creathive_applications’.

Here is my HTML form:

                <form action="<?php bloginfo('home'); ?>" method="post">
                    <fieldset id="membershipform">                  
                        <ul class="clearfix">
                            <li id="li-status">
                                <span>I am a:</span>
                                <menu>
                                    <li><label for="student"><input disabled="disabled" type="radio" name="status" id="student" checked="checked" value="Graduate" /> Graduate</label></li>
                                    <li><label for="student2"><input disabled="disabled" type="radio" name="status" id="student2" value="Undergraduate" /> Undergraduate</label></li>
                                </menu>
                            </li>
                            <li id="li-firstname">
                                <label for="firstname">First Name</label> <input name="firstname" disabled="disabled" type="text" placeholder="First Name" id="firstname" title="First Name" />
                            </li>
                            <li id="li-lastname">
                                <label for="lastname">Last Name</label> <input name="lastname" disabled="disabled" type="text" placeholder="Last Name" id="lastname" title="Last Name" />
                            </li>
                            <li id="li-email">
                                <label for="email">Email address</label> <input name="email" disabled="disabled" type="text" placeholder="Email address" id="email" title="Email address" />
                            </li>
                            <li id="li-url">
                                <label for="url">URL</label> <input name="url" disabled="disabled" type="text" placeholder="URL of something you've made" id="url" title="URL of something you've made" />
                            </li>
                            <li id="li-buttons">
                                <input name="submit" type="submit" value="Send Application &#9658;" title="Send Application" onclick="alert('Invites available from March 2011');" />
                            </li>
                        </ui>
                    </fieldset>
                </form>

and here is the PHP jazz:

if(isset($_POST['submit']))

{

    $status = $_POST['status'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $email = $_POST['email'];
    $url = $_POST['url'];

    $host = '####';
    $username = '####';
    $pass = '####';

    mysql_connect($host,$username,$pass);
    mysql_select_db($username);

    $query = "INSERT INTO creathive_applications VALUES (NULL,'".$status."','".$firstname."','".$lastname."','".$email."','".$url."')";

    $result = mysql_query($query);

}

Can anyone help me fix this as I can’t remember how to run my SQL statement and send the data to the database :/ Also I’ve added the database username and password as well as host but what about the database name? Where does that go again?

I know this is a rather n00b question, but any help would be much appreciated.

THANKS A LOT

  • 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-20T03:58:18+00:00Added an answer on May 20, 2026 at 3:58 am

    Well, with no error it’s impossible to tell what to fix.
    However, there are some obvious things to do.
    See the comments:

    <?
    //show all possible errors. should be ALWAYS set to that level
    error_reporting(E_ALL); 
    echo "landed at form handler<br>";
    
    // sometimes buttons not being sent or gets misspelled
    if($_SERVER['REQUEST_METHOD'] == 'POST')
    {
        echo "here goes POST processing<br>";
        $host = '####';
        $username = '####';
        $pass = '####';
    
        mysql_connect($host,$username,$pass);
        mysql_select_db($username);
    
        // all strings should be escaped
        // and it should be done after connecting to DB
        $status    = mysql_real_escape_string($_POST['status']);
        $firstname = mysql_real_escape_string($_POST['firstname']);
        $lastname  = mysql_real_escape_string($_POST['lastname']);
        $email     = mysql_real_escape_string($_POST['email']);
        $url       = mysql_real_escape_string($_POST['url']);
    
        $query = "INSERT INTO creathive_applications 
                  VALUES (NULL,'$status','$firstname','$lastname','$email','$url')";
    
        echo $query;
        // always run your queries this way to be notified in case of error
        $result = mysql_query($query) or trigger_error(mysql_error().". Query: ".$query);
        var_dump($result);
    }
    

    in case you still see no error, add this line temporarily to the top of the script

    ini_set('display_errors',1);
    

    and remove it immediately after you get the problem solved.

    EDIT
    added some debug info.
    If you see none of it’s messages, you’re sending your form to the wrong URL.
    If you see some of them, post it here

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.