December 12th, 2012, 05:21 AM
in order to pass variables through pages without using includes?
i would use sessions.
for a session on any page:
$_SESSION['var1'] = 'num1';
$_SESSION['var2'] = 'num2';
and as long as you start the session, they will stay there. start with session_start();
December 12th, 2012, 10:14 AM
I'm sorry, but I feel perhaps I'm not making my questions clear enough, or wording them the best. Overall, I feel everything may be set just fine at first, but upon submission of your form, since you are redefining $_SESSION['affiliate'], I feel everything is working fine, and you are just defining it with a blank/false/null value. Since it does get redefined in the manner desired, simply echo your sql statement being ran after form submission, and check that out.
EDIT: And you can ignore trying to echo the $_SESSION['affiliate'] for now and try to echo just $affiliate, or $af, since those will hold the same values.
EDIT2: Also, remove session_start(); from ALL of your files except your index.php since you are running the rest as includes. When using an item as an include, don't think of it exactly as its own file, but a set of code that is actually in your index.php. It's meerly in another file to allow referencing by multiple other files, such as funtions which are only to be created once, but used across the whole site.
Last edited by Triple_Nothing; December 12th, 2012 at 10:28 AM.
December 12th, 2012, 10:40 AM
Aight. Since your site appears to be only 1 page, lets try this. Add the code to the end as defined, and see how things turn after the submit.
AFTER your form submit, how do these items post?
$sql="SELECT AFF_ID,LNAME, FNAME,EMAIL,ORG FROM AFFILIATE WHERE rtrim(EMAIL) LIKE '$s_email'";
$email_search = oci_parse($conn,$sql);
oci_define_by_name($email_search, 'ORG', $org);
oci_define_by_name($email_search, 'EMAIL', $e);
oci_define_by_name($email_search, 'FNAME', $fname);
oci_define_by_name($email_search, 'LNAME', $lname);
oci_define_by_name($email_search, 'AFF_ID', $affiliate);
$_SESSION['affiliate'] = $af;
echo "SQL: " . $sql . "<br />
ORG: " . $org . "<br />
EMAIL: " . $e . "<br />
Name: " . $fname . " " . $lname . "<br />
AFF_ID: " . $affiliate . "<br />";
EDIT: Wow, one more quick question... How can all these variables even be holding values if nothing has been submitted? Are they manually being set somewhere?
Last edited by Triple_Nothing; December 12th, 2012 at 11:03 AM.