simple website development
this question is specifically for jimmy from maryland but anyone can answer it. Its about the Web Development?

how do i connbect my Website to a database? the website i have made is a simple html website with a webpage for customer reply form which i have to connect to a database in my server. I have no idea how this is done please help

Here’s the simple php code to connect to the database. I’ve assumed that you’ve already created the database on your hosting server and you know the hostname, username & password for this particular database.

session_start();

$_SESSION['hostname'] = "s90mysql1.secureserver.net" ;
$_SESSION['username'] = $_POST['username'] ;
$_SESSION['password'] = $_POST['password'] ;

function dbconnect($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password'])
{
$_SESSION['conn'] = @mysql_connect($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password']);

if(!$_SESSION['conn'])
{
echo "Connection Failed - Invalid Username/Password!";
header("Location: mylogin.php");
}

if ($_SESSION['conn'])
{
echo "Connection successful";
header("Location: myschedule.htm");
}
}
dbconnect($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password']);

?>

In the above code the fields ‘username’ & ‘password’ come from the form which has been submitted and this php file should be refered to the form submit action. Host name of the database is predefined in the code. After connection is successful, you can redirect the user through the header function.

Hope this helps.

Simple XSLT Tutorial – XSLT in 5 minutes


Information Dashboard Design: The Effective Visual Communication of Data


Information Dashboard Design: The Effective Visual Communication of Data


$18.94


Dashboards have become popular in recent years as uniquely powerful tools for communicating important information at a glance. Although dashboards are potentially powerful, this potential is rarely realized. The greatest display technology in the world won’t solve this if you fail to use effective visual design. And if a dashboard fails to tell you precisely what you need to know in an instant, yo…

Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer)


Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer)


$20.71


This book is for anyone who wants to learn how to build rich and interactive web sites that run on the Microsoft platform. With the knowledge you gain from this book, you create a great foundation to build any type of web site, ranging from simple hobby-related web sites to sites you may be creating for commercial purposes.Anyone new to web programming should be able to follow along because no pri…

The LEGO Technic Idea Book: Simple Machines


The LEGO Technic Idea Book: Simple Machines


$10.99


The LEGO® Technic Idea Book: Simple Machines is a collection of hundreds of working examples of simple yet fascinating Technic models that you can build based on their pictures alone. Each project uses color-coded pieces and is photographed from multiple angles, making it easy to see how the models are assembled without the need for step-by-step instructions. Every model illus…

WebEasy 8 Professional [Old Version]


WebEasy 8 Professional [Old Version]


$37.99


Avanquest WebEasy 8 Professional Software guides you step-by-step with built-in templates and e-commerce tools – no programming or HTML knowledge are needed. Everything you need to create an impactful website is included in every Avanquest WebEasy 8 Professional Softwarepackage. In just one-click WebEasy publishes your website in minutes for the world to see….