You are invited to Log in or Register a free Frihost Account!

How to update database?


Am planning to give the Mail domain provided by Frihost (Webmail) to all the users registered at my website. Am planning to get them the space by forwading their mails to Gmail thereby saving my precious space.

Now I am only giving the mail logins to the users registered at my website. All I need is a registration page wherein users can register for their mail ids.

I want to create a registration page similar to Yahoo or Gmail (sarcasm). The details entered over at this page have to be updated into my database. How can this be done...?

I want to know any website providing me details about the same. I am also planning to install a Live Chat engine at my website and I want to know whether it is allowed to install Chat software on your website. If so how can it be done. What is the best free chat software available.

Please guide me through to
how this can be done.?
Where can I get all the files required?.
How much space would these consume.?

Thanks and Regards,
Search google. You will get lots of them. Here are few links.

for your registration process, i can teach you how to make one:

first make your table in any database:
visit phpMyAdmin, and click SQL and enter these queries:


CREATE TABLE members (
username VARCHAR(16) NOT NULL,
password VARCHAR(16) NOT NULL,
first_name VARCHAR(30),
last_name VARCHAR(30),
PRIMARY KEY (mem_id),
UNIQUE (username)

Then for the php code,



if (isset($_POST['submit'])) //if submit is pressed

 require_once ('mysql_connect.php'); //connect db

function escape_data ($data) {
  global $dbc;
  if (ini_get('magic_quotes_gpc')) {
   $data = stripslashes($data);
  return mysql_real_escape_string($data, $dbc);
} //to avoid slashes even magic_quotes are on or off

 $message = NULL; // new variable
 if(empty($_POST['username'])) { //validate username
  $un = FALSE;
  $message .= '<p>Please Enter your username</p>';
  } else {
   $un = escape_data($_POST['username']);
 if(empty($_POST['password1'])) { //validate password
  $p = FALSE;
  $message .= '<p>Please Enter a password</p>';
 } else {
  if($_POST['password1'] == $_POST['password2']) {
   $p = escape_data($_POST['password1']);
  } else {
   $p = FALSE;
   $message .= '<p>Your passwords do not match</p>';

 if(empty($_POST['email'])) { //validate email
  $e = FALSE;
  $message .= '<p>Please Enter an email</p>';
 } else {
  $e = escape_data($_POST['email']);

if($un && $p && $e) { //check if everything's OK
//check username existence
 $query = "SELECT username FROM members WHERE username='$u'";
 $result = @mysql_query($query);
 if(mysql_num_rows($result) == 0) {

 $query = "INSERT INTO members (username, password, email) VALUES ('$un', PASSWORD('$p'), $e)";
 $result = @mysql_query($query); //Run query
 if($result) { //if ok
  echo '<p align="center"><b>You have been registered!</b></p>';
 } else { //if didn't run
  $message = '<p>Sorry for the inconvenience, there is a system error.<br>' . mysql_error() . '</p>';
} else {
 $message = '<p>That username is taken, please choose another.</p>';
  mysql_close(); //close connection
 } else {
  $message .= '<p>Please try again.</p>';

if (isset($message)) //if message has a value, print it
 echo '<table width="378" border="0" align="center"><tr><td>';
 echo '<form><fieldset><legend>Errors:</legend>';
 echo '<font color="red"><div align="center">', $message, '</div></font></fieldset></form></td></tr></table>';

for your email validation, you can use javascript to check if it's a valid email address or not. ^^ hope this helps! Very Happy
It's my own script for my members registration, i just edited some to fit some needs.

also, do you know how to connect to a database using php? i you don't then i'll post the code for it for you

sorry for the long post btw, hope the mods aren't mad at me

Thanks for the reply clip.

I hope that code would do me a great deal of help. I will try it out straight away. But I do not know where to put the code and stuff like that. All I do at my site are based on trial and error. Rolling Eyes . So if you could only pardon my ignorance and tell me how to put this code or where to insert this code in any page of my website then it would be helpful. Anyway I would be trying it out of my own also. Hope you help me out with this.

I would also like to ask one more thing, whether this code that you have written is for login page or for registration page.

1) If its for login page then how do I enter the values into the table which it can compare or validate against.

2) If its for registration page then how do I write a program for the login page so that it validates the same.

I hope you know that I am planning to use the webmail provided by Frihost to give to all my members. So all I need would be "registration page" which updates the webmail's "New account" with the mail that my members have registered with, so that they can login to the webmail from my website.

I also do not know how to connect PHP with my database can you tell me how its done too.

Thanks and regards,
I did the tutorial already ^^

Very Happy
Related topics
Trying to move SQL database
Somebody using my database ?
Looking to make an online database using php and mysql
Sports Database
Setting up a Database
Design question on database
Download database.
Extracting Database from PHPmyAdmin
How to update multiple rows in mysql with one query?
Locking database with write access
Special Characters
Change password and forgot password script
Database not update. Where is my wrong code?
App that Back up Drivers. Windows 7
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.