I then add a person to the people table the person requires the org_id of the organisation it is linked with.
This requires the user to search for the organisation, note down the org_id and then go an add the person record.
This is pointless.
So I want to do this:
Currently when the user adds the organisation and clicks submit my system loads a blank form, BUT I want it to load a blank form and print the org_id.
Can anyone help with this?
This is the process file which adds the record once the user clicks the submit button in the original form.
Code: Select all
<?php
/* Connecting, selecting database */
$link = mysql_connect("xxxx", "xxx", "xxxx")
or die("Could not connect : " . mysql_error());
mysql_select_db("contact_management_system",$link) or die("Could not select database");
$sql = "INSERT INTO organisations (org_id,person_id, orgname, web_url, notes ) VALUES ('$org_id','$person_id','$orgname','$web_url', '$notes')";
if ($result = mysql_query($sql,$link)) {
header ("location:http://www.soi.city.ac.uk/organisation/pl/CMS/Uorgs.html?Sent=true");
} else {
die ( mysql_error($link));
}
?>Code: Select all
Sent=trueCode: Select all
if ((isset($_GET['Sent'])) and ($_GET['Sent'] == 'true')) { echo '<b><font color="#FF0000">New Organisation Added, Add Another? Remember to Search for the Organisation and note the OID before Adding the Person Linked to the created Organisation</font></b>'; }Any help would be appreciated