Using get in jQuery to load an html form with PHP variables

mybin

New Member
I have an \[code\]index.php\[/code\] that includes \[code\]config.php\[/code\]. Now I'm using \[code\]$.get()\[/code\] when I click a button to load a form:\[code\]$.get('form.php', function (form) { $(form).insertAfter();});\[/code\]This form requires \[code\]config.php\[/code\] for some input values; however, when the form has loaded, I receive the php error:\[code\]Notice: Undefined variable: config in form.php on line 27\[/code\]Line 27 of \[code\]form.php\[/code\]: \[code\]if ($config['spam_protect']) {\[/code\]I realize the config.php has already been instantiated when the page initially loads, thus I suspect this to be the problem I'm having. I've tried including \[code\]config.php\[/code\] within the \[code\]form.php\[/code\] file to no avail. Tips or tricks anyone?Thanks!
 
Back
Top