Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Customerinfo.php
- <?php
- require './databaseconnect.php';
- session_start();
- $_SESSION['CustomerName'] = str_replace("'", "", $_REQUEST['CustomerName']);
- $_SESSION['CustomerCompany'] = str_replace("'", "", $_REQUEST['CustomerCompany']);
- $_SESSION['CustomerEmail'] = str_replace("'", "", $_REQUEST['CustomerEmail']);
- $_SESSION['CustomerIssue'] = str_replace("'", "", $_REQUEST['CustomerIssue']);
- $create_customer = "INSERT INTO customers (CustomerName, CustomerCompany, CustomerEmail, CustomerIssue)" .
- "VALUES ('{$_SESSION['CustomerName']}', '{$_SESSION['CustomerCompany']}', '{$_SESSION['CustomerEmail']}', '{$_SESSION['CustomerIssue']}');";
- mysql_query($create_customer)
- or die(mysql_error());
- $sql ="SELECT * FROM customers WHERE CustomerName = '{$_SESSION['CustomerName']}' and CustomerCompany = '{$_SESSION['CustomerCompany']}' and CustomerEmail = '{$_SESSION['CustomerEmail']}' and CustomerIssue = '{$_SESSION['CustomerIssue']}'";
- $result = mysql_query($sql);
- $row = mysql_fetch_array($result);
- $_SESSION['SessionID'] = $row[0];
- $customerissue = '<div class="clienttext"><p class="clientname"><img src="./Images/chatleft.png"/> '.$_SESSION['CustomerName'].':</p>
- <p>'.str_replace("'", "", $_SESSION['CustomerIssue']).'</p></div>';
- $startconvo = "INSERT INTO conversion (SessionID, ConvText)"."VALUES ('{$_SESSION['SessionID']}', '{$customerissue}')";
- mysql_query($startconvo)
- or die(mysql_error());
- ?>
- db.php
- <?php
- $host = 'localhost';
- $dbname = 'bxurqygq_ToDo';
- $user = 'bxurqygq_Matthew';
- $pass = 'COD4-f081';
- try{
- $DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
- }
- catch(PDOException $e){
- echo $e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement