Jump to content

Capture Form Info as well as Table ID


SalientAnimal

Recommended Posts

Hi Guys,

 

I am rather new to PHP scripting and using it to capture information to a MySQL database. I have created a web based system that asks users to login and then capture certain informtion. However I have having trouble getting all the informaion to write to the databases as required.

 

1. I would like all my pages to be part of a session login i.e. a user needs to be logged in to access a page. But I am unsure of how to link this to the userinfo table I created.

2. When submitting a form I would like the id field from the userinfo table to be populated into the form table in this example to the customer_services_tracker table.

 

Please see below my code for the two php files

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Please see my code below:

 

<?php
        session_start();
        if(!isset($_SESSION['user'])){
                // the user is not logged in so let them login
?>


<!-- <form method='POST' action='auth.php'>
Username: 
<input type='text' name='username' maxLength='16' length='16'><br/>
Password: 
<input type='password' name='password' length='16'><br/>
<input type='submit' value='Login'>
</form><p><a href='user_creation.php'>Signup
</a></p> -->




<html>
<head>
<title> - CUSTOMER SERVICES LOGIN</title>

<script type="text/javascript">
var count = 0;
var delay = 250;
var text = " - CUSTOMER SERVICES LOGIN              ";
function scroll () {
  document.title = text.substring(count, text.length) + text.substring (0, count)
  if (count < text.length) {
    count ++;
  } else {
    count = 1;
  }
  setTimeout ("scroll()", delay);
}
scroll();
</script>

<link rel="shortcut icon" href="favicon.ico">
</head>
<link rel="stylesheet" type="text/css" href="css/layout_cslogin.css"/>
<body>

<center>
<div id="bgTopDiv"> 
<table width="100%" border="0" background="images/background.png">
  <tr>
    <td width="166"><img src="images/logo.gif" width="165" height="84" alt="Virgin Mobile Logo">
    </td>
    <td colspan="3"><h1> CUSTOMER SERVICES</h1>    </td>
    </tr>
  <tr>
    <td height="197" colspan="2"> </td>
    <td width="15%"> </td>
    <td width="43%"> </td>
  </tr>
  <tr>
    <td colspan="2"> </td>
    <td>
      <p>Username:</p>
    </td>



    <td><input name="username" type="text" id="username" class="textfield"></td>
  </tr>
  <tr>
    <td colspan="2"> </td>
    <td>
      <p>Password:</p>
    </td>



    <td><input name="password" type="password" id="password" class="textfield"></td>
  </tr>
  <tr>
    <td height="46" colspan="2"> </td>
    <td> </td>
    <td><input type="submit" name="Submit" value="→ Login"></td>
  </tr>
  <tr>
    <td height="36" colspan="2"> </td>
    <td> </td>
    <td><a href="user_creation.php">Register New User</a></td>
  </tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</center>

</html>

<?php
        } else {
                // strange, user already logged in, take them to the home page
                header("Location: index.php");
        }
?>

 

<?php
        session_start();
        include "mysql.php";
        $_POST['username'] = addslashes($_POST['username']); // protects against SQL injection
        $_POST['password'] = addslashes($_POST['password']); // same ^^
        $password = ($_POST['password']); // encrypt the password
        $userrow = mysql_query("SELECT * FROM `userinfo` "
. "WHERE `username` = '" . $_POST['username'] . "'"
. " AND `password` = '" . $password . "';",$mysql);
        if(mysql_num_rows($userrow) != "1"){
                // no rows found, wrong password or username
                echo "<font color='red' face='Tahoma' size='2'><b>Please verify the username and/or password entered!</b></font>";
                include "login.php";
        } else {
                // 1 row found exactly, we have the user!
                $_SESSION['user'] = $_POST['username'];
                header("Location: home.php");
        }
?>

 

<!--<php
    $colors = $_POST['colors'];
    $self = $_SERVER['PHP_SELF'];
    $dbh = mysql_connect('dbhost', 'dbuser', 'dbpass') or
die(mysql_error());
    mysql_select_db('dbname') or die(mysql_error());
?>
-->



<title> © TECHNICAL SUPPORT</title>
<script type="text/javascript">
var count = 0;
var delay = 250;
var text = " 2010  MOBILE - TECHNICAL SUPPORT                                 ";
function scroll () {
  document.title = text.substring(count, text.length) + text.substring (0, count)
  if (count < text.length) {
    count ++;
  } else {
    count = 1;
  }
  setTimeout ("scroll(1)", delay);
}
scroll();
</script>
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">

<script language="javascript" src="js/technical_support_list.js"></script>
<script src="js/mmenu.js" type="text/javascript"></script>
<script src="js/menuItems.js" type="text/javascript"></script>



<style type="text/css">
<!--
#form1 table tr td {
color: #FFF;
}
#form1 table tr td {
font-family: "Segoe Print", Tahoma, "Segoe UI";
font-size: 13px;
}
#form1 p {
color: #FFF;
font-size: 36px;
font-weight: bold;
text-align: center;
font-family: "Segoe Print", Tahoma, "Segoe UI";
}
-->
</style>
</head>
<link rel="stylesheet" type="text/css" href="css/layout_technical_support.css"/>
<body>
<form id="form1" name="form1" method="post" action="technicalsupportupdate.php" onSubmit="return ValidateForm(); true">
<table width="100%" border="0">
  <tr>
    <td width="20%"><img src="images/mobilelogo.gif" alt=" Mobile Logo"align="left" /></td>
    <td width="80%"><p align="justify"> MOBILE CALL TRACKER  TECHNICAL SUPPORT</p></td>
  </tr>
  <tr>
    <td height="449"> </td>
    <td><table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Customer Name :</strong></td>
        <td><input type="text" name="customer_name" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>E-Mail Address :</strong></td>
        <td><input type="text" name="customer_email_address" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Case Number :</strong></td>
        <td><input type="text" name="case_number" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>MSISDN :</strong></td>
        <td><input type="text" name="msisdn" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Call Reason :</strong></td>
        <td width="65%" align="left" valign="middle"><select name="call_reason" id="call_reason">
          <option value="">Select the Call Reason</option>
          <option value="ATM Recharges">ATM Recharges</option>
          <option value="Barrings - International Calls/Roaming">Barrings - International Calls/Roaming</option>
          <option value="Barrings (GPRS, Outgoing Calls, Outgoing SMS)">Barrings (GPRS, Outgoing Calls, Outgoing SMS)</option>
          <option value="Barrings New Activation (Rica)">Barrings New Activation (Rica)</option>
          <option value="IN Lock">IN Lock</option>
          <option value="Manual GPRS Settings">Manual GPRS Settings</option>
          <option value="Manual MMS Settings ">Manual MMS Settings </option>
          <option value="MNP">MNP</option>
          <option value="Modem Dial-Up Settings">Modem Dial-Up Settings</option>
          <option value="Network (Cannot Connect to Network)">Network (Cannot Connect to Network)</option>
          <option value="Network No Reception (Signal Fault) ">Network No Reception (Signal Fault) </option>
          <option value="Phone Email Setup ">Phone Email Setup </option>
          <option value="SMS ">SMS </option>
          <option value="Voicemail Setup ">Voicemail Setup </option>
        </select></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Province :</strong></td>
        <td width="65%" align="left" valign="middle"><select name="province" id="province">
          <option value="">Select the Province</option>
          <option value="Eastern Cape">Eastern Cape</option>
          <option value="Gauteng">Gauteng</option>
          <option value="Kwa-Zulu Natal">Kwa-Zulu Natal</option>
          <option value="Limpopo">Limpopo</option>
          <option value="Mpumalanga">Mpumalanga</option>
          <option value="North West">North West</option>
          <option value="Northern Cape">Northern Cape</option>
          <option value="Polokwane">Polokwane</option>
          <option value="Western Cape">Western Cape</option>
          <option value="Other">Other</option>
        </select></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Comments :</strong></td>
        <td><textarea rows ="5" cols="30" name="comments">
	</textarea></td>
      </tr>
      <tr>
        <td>
          <p>
          <input type="reset" value="Reset Form">
          </p></td>
          <td>
          <p>
          <input type="Submit" value="Submit">
          </p></td>
      </tr>
      <tr>

      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>

Link to comment
Share on other sites

Ok hope this is what you are looking for. Here is the code to 6 Pages namely my index page which really has no other function that to reroute the user to the Logn screen if they are not logged in or to the home screen if they are logged in. The second page is the login screen, and the third is the  Authoisation script. Once authorised the suer is taken to the home Home Screen, from the home screen the user will select a depart for which they will log a query, I have only included one as all the other pages are the same. And then the script that writes the data to the database.

 

<!-- INDEX FILE WHICH THEN AUTOMATICALLY ROUTES TO THE LOGIN/HOME PAGE -->

<?php
session_start(); // start the session
if(!isset($_SESSION['user'])){
    // check if the user is logged in
    // the user is not logged in
    header("Location: login.php"); // take him/her to the login page
} else {
    
header("Location: home.php"); // else take im/her home

}
?>



<?php
        session_start();
        if(!isset($_SESSION['user'])){
                // the user is not logged in so let them login
?>



<!-- LOGIN FILE WHICH LOGS THE USER INTO THE SITE -->

<html>
<head>
<title>© 2010  - CUSTOMER SERVICES LOGIN</title>

<script type="text/javascript">
var count = 0;
var delay = 250;
var text = "© 2010  - CUSTOMER SERVICES LOGIN";
function scroll () {
  document.title = text.substring(count, text.length) + text.substring (0, count)
  if (count < text.length) {
    count ++;
  } else {
    count = 1;
  }
  setTimeout ("scroll()", delay);
}
scroll();
</script>

<link rel="shortcut icon" href="favicon.ico">
</head>
<link rel="stylesheet" type="text/css" href="layout_cslogin.css"/>
<body>

<center>
<div id="bgTopDiv"> 
<table width="100%" border="0">
<form name="form" method="post" action="auth.php">
  <tr>
    <td width="166"><img src="images/logo.gif" width="165" height="84" alt=" Logo">
    </td>
    <td colspan="3"><h1> CUSTOMER SERVICES</h1>    </td>
    </tr>
  <tr>
    <td height="197" colspan="2"> </td>
    <td width="15%"> </td>
    <td width="43%"> </td>
  </tr>
  <tr>
    <td colspan="2"> </td>
    <td>
      <p>Username:</p>
    </td>



    <td><input name="username" type="text" id="username" class="textfield"></td>
  </tr>
  <tr>
    <td colspan="2"> </td>
    <td>
      <p>Password:</p>
    </td>



    <td><input name="password" type="password" id="password" class="textfield"></td>
  </tr>
  <tr>
    <td height="46" colspan="2"> </td>
    <td> </td>
    <td><input type="submit" name="Submit" value="→ Login"></td>
  </tr>
  <tr>
    <td height="36" colspan="2"> </td>
    <td> </td>
    <td><a href="user_creation.php">Register New User</a></td>
  </tr>
  <tr>
    <td height="176" colspan="2"> </td>
    <td> </td>
    <td> </td>
  </tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
</center>
</div>
</html>

<?php
        } else {
                // strange, user already logged in, take them to the home page
                header("Location: index.php");
        }
?>

<!-- AUTH PAGE WHICH AUTHORISES THE USERS LOGIN DETAILS -->

<?php
        session_start();
        include "mysql.php";
        $_POST['username'] = addslashes($_POST['username']); // protects against SQL injection
        $_POST['password'] = addslashes($_POST['password']); // same ^^
        $password = ($_POST['password']); // encrypt the password
        $userrow = mysql_query("SELECT * FROM `userinfo` "
. "WHERE `username` = '" . $_POST['username'] . "'"
. " AND `password` = '" . $password . "';",$mysql);
        if(mysql_num_rows($userrow) != "1"){
                // no rows found, wrong password or username
                echo "<font color='red' face='Tahoma' size='2'><b>Please verify the username and/or password entered!</b></font>";
                include "login.php";
        } else {
                // 1 row found exactly, we have the user!
                $_SESSION['user'] = $_POST['username'];
                header("Location: home.php");
        }
?>



<!-- USER IS ROUTED TO INDEX PAGE ONCE THEY ARE LOGGED IN -->

<html>
<head>
<title>CUSTOMER SERVICES OPERATIONS - HOME MENU</title>
    <LINK REL="SHORTCUT ICON" HREF="favicon.ico">
    <script type="text/javascript">
var count = 0;
var delay = 250;
var text = "©  CS OPERATIONS - HOME MENU                               ";
function scroll () {
  document.title = text.substring(count, text.length) + text.substring (0, count)
  if (count < text.length) {
    count ++;
  } else {
    count = 1;
  }
  setTimeout ("scroll(1)", delay);
}
scroll();
</script>
    <script src="js/mmenu.js" type="text/javascript"></script>
<script src="js/menuItems.js" type="text/javascript"></script>
</head>

<link rel="stylesheet" type="text/css" href="css/layout_home.css"/>
<table width="200" border="0">
<tr>
    <td></td>
<table >
</tr>
</table>
<br>
    <body></body>


</body>
</html>

<!-- USER NAVIGATES TO REQUIRED PAGE - ASSUME PAGE BELOW IS SELECTED TO LOG REQUEST -->
<!-- WHEN SUBMITTING THE PAGE BELOW I WANT IT TO RECORD THE USRE ID FROM THE USERINFO TABLE INTO THE TECHNICAL_SUPPORT_TRACKER TABLE SO AS TO TRACK WHICH USER HAS SUBMITTED WHICH REQUEST -->

<title> © 2010  - TECHNICAL SUPPORT</title>
<script type="text/javascript">
var count = 0;
var delay = 250;
var text = " 2010  - TECHNICAL SUPPORT                                 ";
function scroll () {
  document.title = text.substring(count, text.length) + text.substring (0, count)
  if (count < text.length) {
    count ++;
  } else {
    count = 1;
  }
  setTimeout ("scroll(1)", delay);
}
scroll();
</script>
<LINK REL="SHORTCUT ICON" HREF="favicon.ico">

<script language="javascript" src="js/technical_support_list.js"></script>
<script src="js/mmenu.js" type="text/javascript"></script>
<script src="js/menuItems.js" type="text/javascript"></script>
<script type="text/javascript" language="JavaScript">
var FormName = "form1";

var RequiredFields = "customer_name, customer_email_address, case_number, msisdn, call_reason";

function ValidateRequiredFields()
{
var FieldList = RequiredFields.split(",")
var BadList = new Array();
for(var i = 0; i < FieldList.length; i++) {
var s = eval('document.' + FormName + '.' + FieldList[i] + '.value');
s = StripSpacesFromEnds(s);
if(s.length < 1) { BadList.push(FieldList[i]); }
}
if(BadList.length < 1) { return true; }
var ess = new String();
if(BadList.length > 1) { ess = 's'; }
var message = new String('\n\nYou have not completed the following field' + ess + ' :\n');
for(var i = 0; i < BadList.length; i++) { message += '\n' + BadList[i]; }
alert(message);
return false;
}

function StripSpacesFromEnds(s)
{
while((s.indexOf(' ',0) == 0) && (s.length> 1)) {
s = s.substring(1,s.length);
}
while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length> 1)) {
s = s.substring(0,(s.length - 1));
}
if((s.indexOf(' ',0) == 0) && (s.length == 1)) { s = ''; }
return s;
}
// -->
</script>



<style type="text/css">

-->
</style>
</head>
<link rel="stylesheet" type="text/css" href="css/layout_technical_support.css"/>
<body>
<form id="form1" name="form1" method="post" action="technicalsupportupdate.php" onsubmit="return ValidateRequiredFields();">
<table width="100%" border="0">
  <tr>
    <td width="20%"><img src="images/logo.gif" alt=" Logo"align="left" /></td>
    <td width="80%"><p align="justify"> CALL TRACKER  TECHNICAL SUPPORT</p></td>
  </tr>
  <tr>
    <td height="449"> </td>
    <td><table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Customer Name :</strong></td>
        <td><input type="text" name="customer_name" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>E-Mail Address :</strong></td>
        <td><input type="text" name="customer_email_address" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Case Number :</strong></td>
        <td><input type="text" name="case_number" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>MSISDN :</strong></td>
        <td><input type="text" name="msisdn" align="left" valign="middle"></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Call Reason :</strong></td>
        <td width="65%" align="left" valign="middle"><select name="call_reason" id="call_reason">
          <option value="">Select the Call Reason</option>
          <option value="ATM Recharges">ATM Recharges</option>
          <option value="Barrings - International Calls/Roaming">Barrings - International Calls/Roaming</option>
          <option value="Barrings (GPRS, Outgoing Calls, Outgoing SMS)">Barrings (GPRS, Outgoing Calls, Outgoing SMS)</option>
          <option value="Barrings New Activation (Rica)">Barrings New Activation (Rica)</option>
          <option value="IN Lock">IN Lock</option>
          <option value="Manual GPRS Settings">Manual GPRS Settings</option>
          <option value="Manual MMS Settings ">Manual MMS Settings </option>
          <option value="MNP">MNP</option>
          <option value="Modem Dial-Up Settings">Modem Dial-Up Settings</option>
          <option value="Network (Cannot Connect to Network)">Network (Cannot Connect to Network)</option>
          <option value="Network No Reception (Signal Fault) ">Network No Reception (Signal Fault) </option>
          <option value="Phone Email Setup ">Phone Email Setup </option>
          <option value="SMS ">SMS </option>
          <option value="Voicemail Setup ">Voicemail Setup </option>
        </select></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Province :</strong></td>
        <td width="65%" align="left" valign="middle"><select name="province" id="province">
          <option value="">Select the Province</option>
          <option value="Eastern Cape">Eastern Cape</option>
          <option value="Gauteng">Gauteng</option>
          <option value="Kwa-Zulu Natal">Kwa-Zulu Natal</option>
          <option value="Limpopo">Limpopo</option>
          <option value="Mpumalanga">Mpumalanga</option>
          <option value="North West">North West</option>
          <option value="Northern Cape">Northern Cape</option>
          <option value="Polokwane">Polokwane</option>
          <option value="Western Cape">Western Cape</option>
          <option value="Other">Other</option>
        </select></td>
      </tr>
      <tr>
        <td width="35%" align="right" valign="middle"><strong>Comments :</strong></td>
        <td><textarea rows ="5" cols="30" name="comments">
	</textarea></td>
      </tr>
      <tr>
        <td>
          <p>
          <input type="reset" value="Reset Form">
          </p></td>
          <td>
          <p>
          <input type="Submit" value="Submit">
          </p></td>
      </tr>
      <tr>

      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>

<!-- SCRIPT THAT WRITES THE CAPTURED DATA TO THE DATABASE -->

<?php
$con = mysql_connect("localhost"
,"root"
,"password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("csops", $con);

$sql="INSERT INTO technical_support_tracker 
(customer_name
,customer_email_address
,case_number
,msisdn
,call_reason
,province
,comments
)

VALUES
('$_POST[customer_name]'
,'$_POST[customer_email_address]'
,'$_POST[case_number]'
,'$_POST[msisdn]'
,'$_POST[call_reason]'
,'$_POST[province]'
,'$_POST[comments]')";


if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "<b><font color='red' face='segoe' size='2'>1 record added</b></font>";
include "technical_support_tracker.php";

mysql_close($con)

?> 

Link to comment
Share on other sites

Sorry, it doesn't -- I can see that you're new here.  Why not follow the link in my sig as well as reading the ToS.

 

Basically, we don't want to have to wade through all of your code to find the offending line.

Link to comment
Share on other sites

Ok I think I might know what you are looking for from me. the problem is I do not know the code that I need to perform the function I want to be performed. I'm going to ry explain again what I am looking for by breaking it up into pieces and then I will include a small part of the code where I would think the function will occur.

 

1. I have a Database which I will refer to as DB for the example

2. In my DB I have two tables, namely USERINFO and FORM1

3. The user logs into the site a session is set and the user is authenticated with the two pieces of code below:

 

<?php
        session_start();
        if(!isset($_SESSION['user'])){
                // the user is not logged in so let them login
?>

 

<?php
        session_start();
        include "mysql.php";
        $_POST['username'] = addslashes($_POST['username']); // protects against SQL injection
        $_POST['password'] = addslashes($_POST['password']); // same ^^
        $password = ($_POST['password']); // encrypt the password
        $userrow = mysql_query("SELECT * FROM `userinfo` "
	. "WHERE `username` = '" . $_POST['username'] . "'"
	. " AND `password` = '" . $password . "';",$mysql);
        if(mysql_num_rows($userrow) != "1"){


                // no rows found, wrong password or username
                echo "<font color='red' face='Tahoma' size='2'><b>Please verify the username and/or password entered!</b></font>";
                include "login.php";
        } else {
                // 1 row found exactly, we have the user!
                $_SESSION['user'] = $_POST['username'];
                header("Location: home.php");
        }
?>

 

4. Oce the user is logged in the will complete the form and submit the information. When submitting the form information I would like the update code that updates the FORM1 table to also gather information from the USERINFO table, i.e the auto incremeted ID which serves as a unique identifier. This info along with the info submitted via the form needs to be populated into FORM1 table. Below is my current code for the form, but it is not populating the ID from the USERINFO table

 


$sql="INSERT INTO FORM1
(id
,customer_name
,customer_email_address
,case_number
,msisdn
,call_reason
,province
,comments
)

VALUES
([b]NOT SURE HOW TO GATHER THIS PART FROM MY USERINFO TABLE[/b]
'$_POST[customer_name]'
,'$_POST[customer_email_address]'
,'$_POST[case_number]'
,'$_POST[msisdn]'
,'$_POST[call_reason]'
,'$_POST[province]'
,'$_POST[comments]')";


if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "<b><font color='red' face='segoe' size='2'>1 record added</b></font>";
include "technical_support_tracker.php";

mysql_close($con)

?> 

 

I have search everywhere for a solution to this, but have had no luck, please can you try and assist me here as this is quite urgent. Thanks for you patience with me on this. I am still very new to PHP and everything I have done here I have taught myself using google.

 

I almost forgot tis part, hre is my table structure of the two tables as well as the server info:

 

-- phpMyAdmin SQL Dump -- version 3.3.2-- http://www.phpmyadmin.net

Generation Time: Jun 14, 2010 at 07:58 AM -- Server version: 5.1.46

--

PHP Version: 5.3.2

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

 

Table structure for table `USERINFO`

 

CREATE TABLE IF NOT EXISTS `userinfo` (`id` mediumint(50) NOT NULL AUTO_INCREMENT

,  `username` varchar(60) NOT NULL

,  `password` varchar(60) NOT NULL

,  `name` text NOT NULL

, `surname` text NOT NULL

,  `email_address` varchar(100) NOT NULL

,  `department` varchar(100) NOT NULL

,  PRIMARY KEY (`id`)

,  UNIQUE KEY `id` (`id`,`username`,`email_address`)

,  UNIQUE KEY `e-mail` (`email_address`)

,  UNIQUE KEY `username` (`username`)

 

 

Table structure for table `FORM1`

 

CREATE TABLE IF NOT EXISTS `FORM1`

(  `id` varchar(50) NOT NULL

,  `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

,  `customer_name` varchar(100) NOT NULL

,  `customer_email_address` varchar(100) NOT NULL

,  `case_number` int(50) NOT NULL

,  `msisdn` int(10) NOT NULL

,  `call_reason` varchar(50) NOT NULL

,  `province` varchar(50) DEFAULT NULL

,  `comments` varchar(2500) DEFAULT NULL)

 

 

Link to comment
Share on other sites

TLDR -- still.  And I'll glaze over some of the more obvious design flaws for the moment.

 

But basically, if you're authenticating with a session ID, you've got a handle to a DB record, which has a UID -- so you can just look it up in PHP, if you don't already have it, and UPDATE accordingly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.