php - global variables in a loaded page -
i have index page uses script load page div
$('#transportplanning').click(function() { mainpage = $('#floatmain') mainpage.load('create_diary.php') }); the page loads ok div, want share php variables 1 page another, thought newly loaded page able reference main index variables not case , have tried global still not working
any help please ?
to share variable between 2 different php scripts, create super global :
use
session_start(); // store session info $_session['key']=value; in index.php , read in crate_diary.php :
session_start(); $key=$_session['key']; and ($key) variable specific code in create_diary.php.
using session or cookies prevent unethical utilize of sensitive data. can utilize cookies instead of session. dont forget unset session after you've done it. specially when dealing cookies because session automatically destroyed when user closes browser isn't true cookie.
php jquery
No comments:
Post a Comment