PDA

View Full Version : Pass variables to script through VBA?


fuse3k
10-15-2004, 02:39 AM
Well -- first and foremost you should know that I'm a PHP noob. I picked up a book from a recommendation from a friend and I'm about half way into it...my question is basic. I wrote a small script to use within the CMPS and did so by following Acido's (http://www.vbadvanced.com/forum/showthread.php?t=1082) (very helpful) 'MOD', per se.

What I'd like to do is pass a value using the 'GET' or '$_GET['$var']' variables to the script I've created for my site. Let me give you an example:

I've added a page in VBA and, with Acido's steps, integrated my script into it. Now if the identifier for the VBA page is "site", should I not be able to pass the value of "step" using this URL: "whatever.com/index.php?page=site&step=2"?

Perhaps I'm looking at this the wrong way, or perhaps I've gone beyond the scope of what I've already learned through the book and other tutorials. When it all boils down I want to be able to pass a variable to the script, from the script, using a link. I've been able to this externally but not within VBA.

Any ideas or suggestions? I'm open to anything at this point. Thanks in advance.

-Brian N.

Brian
10-15-2004, 09:57 AM
Your problem is most likely that the variable isn't added to the global set in the print_portal_output() function in your fourm/includes/vba_cmps_include_bottom.php file. Try adding it there and that should fix the problem.

Our Sponsors
 

fuse3k
10-15-2004, 11:02 AM
Is this what you're referring too?


// ######################### Function to Print The Page Out ##########################
function print_portal_output(&$cmpsoutput, $nonindex = false)
{
global $step, $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;



I added the $step variable there, still doesnt work though. :(

fuse3k
10-17-2004, 05:33 PM
Anyone have any ideas?

Our Sponsors
 

Brian
10-17-2004, 09:13 PM
Maybe add $_GET there and use $_GET[variable] in the template?

fuse3k
10-18-2004, 10:32 AM
Wow, that worked. That's strange condsidering "Register Globals" is ON in php.ini. Nonetheless, thank you Brian. You have no idea how much help you've provided me. I can't thank you enough...for everything.