Guys,

I need some assistence for a very simple problem.

When a certain value has been reached in my script I want it to load up a page and pass a variable thourgh. Using a reference book, I used the following line :

include("Prototype_quest_Underlying_Factors.html?$insert_value");

but this does not seem work.

Any ideas ?

Many Thanks

Fuzz

    'yourpage.html&varname=$yourvar'

    gives the value of $yourvar to $varname

      Play around with the fopen function.

      You may need to fread a couple of bytes from the file, but I don't think you do.

        Hi!

        I'm not an expert in PHP and other server-side scripting languages although I'm familiar with some of them...
        I just noticed that your passing value(s) to a HTML file. From what I know, HTML files don't process scripters' customed variables. maybe you should try creating or converting that other file to PHP or to some server-side script for the values to be processed, then pass values like this:

        myfile.php?myvirstvar=45&mysecvar=50
        <file>?<var name>=<value>&<var name>=<value>

        🙂

          --
          'yourpage.html&varname=$yourvar'

          gives the value of $yourvar to $varname

          would be like 'yourpage.htmp?varname=$yourvar&varname2=$yourvar2'

          arguments start with ? and are separated by &

            it's possible to configure the webserver to parse .html files as .php files..

              Guys thanks for help.

              I think I did not worded the question correctly.

              What I want the program to do is pass a variable from a php program into a html file, then into another php program for processing into a database.

              i.e.

              PROGRAM 1

              Insert data into table1,
              Get ID 1 (incremented value) from table1,
              Call and pass ID 1 into HTML file,
              from HTML file, on submit, call PROGRAM 2.

              PROGRAM 2

              Insert data into table 2 with ID 1 as the ID in the table2.

              This is done so that the records in both Table 1 and Table 2 will be in a ono to one database relationship.

              I'll have a look at the fopen function but if you have anyone ideas it will come in handy.

              Sorry if it does not make any sense but I cannot think of any other way to explain it.

              Many Thanks

              Fuzz

                You can use the standard http meta tag to redirect to any other file, passing variables or not. Either use it within your php code, or outside.

                Within:
                <?php

                misc php code
                echo(\"<META HTTP-EQUIV=\\"Refresh\\" CONTENT=\\"0; URL=somefile.php?variables=value\\">\");

                ?>

                Outside
                <?php

                misc php code

                ?>

                <META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=somefile.php?variables=value\">

                Change the number immidiately after CONTENT to reflect the number of seconds you want to wait before the redirect.

                Anyone know a cleaner/better way to do this? Especially wondering if its bad practice to do this within the php code as it wont then reach ?>, is that bad/makes no diff?

                Tom

                  Write a Reply...