So I looked into other threads but didnt find a solution that worked for me. Here is my problem: I have two php pages: http://codepad.org/VhblM76K and http://codepad.org/W9bz8L3E.
The first page is supposed to get information from a form, look for it in a database, store it in a variable $_SESSION['$dataArray']
and send it to the second page.
On the second page I get the information in javascript from php with json_encode, which gives an error:
Uncaught SyntaxError: Unexpected token < result.php:20.
When I look in the source in chrome it says:
var schoolData = <br />
<b>Notice</b>: Undefined index: $dataArray in <b>C:\xampp\htdocs\highschools.bgesult.php</b> on line <b>23</b><br />
null;
How is this an unidentified index, when i can only go to the second page after visiting the first one, where I assing a value to $_SESSION['$dataArray']
.
How can I fix this? I have written session_start()
in both pages and it didnt work for me.
I need the variable schoolData
to show the information on the page.