Hi,
I want the php code for this required,
I have created a website and a database, DB have a customer table and a field called “cus_id”,
when someone visit to my website and they can request a quotation form that,
but i have in the request quotation page, there are 2 sections, for existing customers (already in my DB, they have cus_ID) and new customers,
when existing customer want to request a quotation, there is a input box says “Enter your customer ID here” and a button “enter”. when they input their cus_id, and enter the button,
It should cross check cus_id with the db, if the cus_id is available, page called “quotationrequest.php” should be opened.(this page is the request a quote form) if the cus_id not available in the db, display an error message.
and the new customer have to file out a small form (my code is attached here) if the fields are filled and the enter button is clicked, the data should be insert to my db.table called “newcustomer” and the “quotationrequest.php” page should be opened.
[code]<?php
if (isset($_POST[‘submitted’])) {
include(’…/library/config.php’);
include(’…/library/opendb.php’);
$type=$_POST[‘type’];
$name=$_POST[‘cuname’];
$no=$_POST[‘contno’];
$email=$_POST[‘email’];
$sqlinsert = “INSERT INTO newcustomer (type,name,contactno,email) VALUES (’$type’,’$name’,’$no’,’$email’)”;
if (!mysql_query($sqlinsert)){
die (‘error inserting new record’);
}// end of nested if statment
$newrecord = "1 record added to the database";
}//end of the main if statemnt
?>
Company
Individual Please make a selection. |
||
Name |
A value is required.Invalid format. |
|
Contact No |
A value is required. Invalid format. |
|
A value is required. Invalid format. |
||