Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0
    in order to pass variables through pages without using includes?

    i would use sessions.

    for a session on any page:

    session_start();
    $_SESSION['var1'] = 'num1';
    $_SESSION['var2'] = 'num2';

    and as long as you start the session, they will stay there. start with session_start();
  2. #17
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    724
    Rep Power
    7
    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.
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    724
    Rep Power
    7
    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.

    PHP Code:
    $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); 

    $exec=oci_execute($email_search);  
    oci_fetch($email_search); 
    $rows=oci_num_rows($email_search); 
    $af=$affiliate
    $_SESSION['affiliate'] = $af;

    echo 
    "SQL: " $sql "<br />
    ORG: " 
    $org "<br />
    EMAIL: " 
    $e "<br />
    Name: " 
    $fname " " $lname "<br />
    AFF_ID: " 
    $affiliate "<br />"
    AFTER your form submit, how do these items post?

    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.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo