Hi Rich...
After hours of messing around (hacking at this point), I've combed for various session solutions, mashing them where i could, and now have the following code in their perspective files:
My template functions.php contains a new function as follows:
function session_manager(){
if (!session_id()){
session_start();
}
$_SESSION['email'] = $_POST['email'];
}
My WP page /reg-form/ posts to roi_form.php on submit.
roi_form.php has the following code block:
include 'wp-config.php';
add_action('init', 'session_manager');
mysql_query("INSERT INTO wp_roi(<code>name</code>,<code>email</code>,<code>company</code>,<code>phone</code>) VALUES ('$_POST[name]','$_POST[email]','$_POST[company]','$_POST[phone]')")
or die(mysql_error());
mysql_close();
The code block above does post to MySQL.
My roi_form.php calls roi_insert.php on submit which contains the following code block:
include 'wp-config.php';
include 'TEMPLATEPATH . /functions.php';
add_action('init', 'session_manager');
mysql_query("UPDATE wp_roi SET software='$_POST[software]', patients='$_POST[patients]', reimbursement='$_POST[reimbursement]', rejection='$_POST[rejection]' WHERE email='$_POST[email]'")
or die(mysql_error());
mysql_close();
sleep(30);
This does not post to MySQL when used with /roi-reg/ but will post a seperate record if I run it directly.
So, in short, no difference.
I have not gotten to the point where I'm using $wpdb, sanitizing, or exscaping yet as my focus before continuing is to even get this to do a basic function of updating.
I tried using your code block adaptively, but only revieved errors regarding add_action.
I've exhausted my knowledge at this point and am running in circles.
It would be a huge contribution to ALL those people looking for WP session solutions if you could take my code above and just post something that works - as I see it, all those forums and blogs that say it works have yet to actually show s real-world example.
I you can do this, I'll publish a real world example identifying you as the source.
If you need all my complete files including my creat table script, let me know and I'll post a link to a zip file containing everything.
Best Regards,
dennishall