1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How Do I Pair Html Forms With The Database

Discussion in 'Databases' started by rjapzdesigns, May 1, 2013.

  1. #1
    Hi brothers and sisters

    I hope this is not too much to ask. But I need help setting up my article cms script to pair up with the database to process sign ups "register", setup user account, and submit/post articles. Im building a tips & advice, shop & save "coupons and deals", homemade, how to's, money making/saving ideas. To solve personal troubles and problems, by people posting articles, commenting/blogging and sharing ideas to help each other.

    I want the visitors to register and submit, receive a confirmation through email to activate account, then login and set up their profile, post and view articles. Like the normal functions of a cms article directory sites, like Goarticles.com.

    I have a processor.php file in the same folder with the php pages, and I also created a database admin account with my host. I then try to sign up as a visitor/guest, I registered, submit form, the confirmation thank you page shows after submitting, but no confirmation message sent to my email. Im not sure how to setup the form to process data, signup and see what I mean, the articles you see are examples that came with the article script when I downloaded. Below is the registration form and processor.php scripts.

    http://myresources.zxq.net/tipsarticlesphp/regauthor.php

    Form opening code
    <form id="form1" name="form1" method="post" action="processer.php" onsubmit="return login_validation(this)">
    <input name="SearchOpt" value="1" type="hidden" />
    <input name="SearchWd" class="text-field" style="width:184px; height:18px;" type="text" />

    Submit and reset button codes
    <input name="submit" src="images/submit.jpg" action="thankyoureg.php" method"post" type="image" />
    <input name="reset" src="images/reset.jpg" action="regauthor.php" type="image" />


    --------------------------------------------------------------------------------
    Processer.php

    <?php
    $username = "123456_myusername";
    $password = "mypassword";
    $hostname = "myresources.zxq.net";
    $db_name="mydatabasename_zxq_1111";

    //connection to the database
    $dbhandle = mysql_connect($hostname, $username, $password)
    or die("Unable to connect to MySQL");
    echo "Connected to MySQL<br>";

    //select a database to work with
    $selected = mysql_select_db("mydatabasename_zxq_1111",$dbhandle)
    or die("Could not select mydatabasename_zxq_1111");

    //execute the SQL query and return records
    $result = mysql_query("SELECT id, model,year FROM cars");

    //fetch tha data from the database
    while ($row = mysql_fetch_array($result)) {
    echo "ID:".$row{'id'}." Name:".$row{'model'}."Year: ". //display the results
    $row{'year'}."<br>";
    }
    //close the connection
    mysql_close($dbhandle);
    ?>

    Thanx​
     
    rjapzdesigns, May 1, 2013 IP