Invalid call to script error

Help
2005-04-06
2013-05-28
  • Nobody/Anonymous

    I've been trying to get this interesting looking piece of software to run on our webserver, but I've encountered a problem in the final stages of the installation process. Everything seems to go fine right up to the point I try to add something to the database.

    If I try to add a user, after filling out the form and pushing the "add user button" I get the following error: "Invalid call to script 'user_validation.php' ". Same thing happens if I try to add a record, then I get a "Invalid call to script 'modify.php' " error.

    I've been trying to find the cause of this error for ages but I seem unable to locate it. The database itself seems to work fine, as I can see all of the records already in there. Any clue as to what I'm missing?

    Thanks you so much in advance,
    Sebastian

     
    • Matthias Steffens

      Hi Sebastian,

      I couldn't reproduce your problem. Which platform, PHP version and browser (type/version) are you using?

      The scripts 'modify.php' and 'user_validation.php' check the contents of the superglobal PHP variable '$_SERVER['HTTP_REFERER']' and if the script was called by something else than 'record.php' (or 'user_details.php', respectively), they fire the error message you're seeing.

      The '$_SERVER' variable was introduced with PHP 4.1.0, so you'll need at least this PHP 4.1.x to run refbase.

      Have you tried to add any records/users using a different browser?

      Matthias

       
    • Sebastian

      Sebastian - 2005-04-07

      Hello Matthias,

      thank you very much for your quick response. I'm running on a linux platform, running PHP 4.1.2 and browse using Firefox 1.0.2. I've however been able to correct the problem by reinstalling the entire package and using a modified version of the installation script. I initially used the manual installation procedure since I do not have an admin password for our sql database, I only have access to specific databases. I installed the database manually and edited out any reference to the database in the install script. I do not know how this fixed my problem since it should in theory produce about the same results as a manual install, but it did. So it appears the problem was on my side :-)

      You might however be interested in another issue I had to resolve. For the export to RIS/EndNote/... I had to modify the files in the export dir for it to work properly. It appears that in the export_xml2*.php files you open a temporary file for writing in a tmp dir. You then pass that temp file to one of the bibutils programs for further processing and then you close it. In my specific case the bibutils program didn't run properly until I moved the instruction closing the file in front of the instruction to pass the temp file to bibutils. It might be a good idea to change this in the distribution files as it probably affects other people as well. I hope this was sufficiently clear. You're welcome to mail me if you would like more info.

      Thanks again and congratulations with your fantastic work on this program.

      Kind regards,
      Sebastian

       
      • adrianbj

        adrianbj - 2005-04-07

        I am also having problems with Endnote export.

        I made the change mentioned by unfimaer, but I still don't receive any output. If I chooss html the page is blank. If I choose file then I get a blank enw file. The same occurs with a bibtex export. The only thing that does produce output is the MODS XML option. I am running a WIN2K server with Apache. My Bibutils are installed under c:\bibutils

        The installation script did not produce any errors when I gave the path to bibutils. I have mades sure there is a c:\tmp, c:\bibtutils\tmp and even a tmp folder in the root of my htdocs folder.

        Is there something I am missing?

        Other than that, this is an amazing upgrade - thanks guys!

         
        • Richard Karnesky

          I have refbase-0.8.0+bibutils working on WinXP with no modifications (using the latests stock versions of both WAMP and  Apache+MySQL+PHP) .

          MODS XML is the native export format, so it sounds like you're having a problem getting bibutils to actually execute.

          I used the path '/refs/bibutils/' and placed bibutils under 'C:\refs\bibutils\' (where 'C:\refs\" is my directory for refbase, with all of the PHP scripts, etc.)

          I did not have to create tmp directories.

          Could you please double-check which path is being used for bibutils (SELECT depends_path FROM depends) & I can try to replicate your setup over here?

           
          • adrianbj

            adrianbj - 2005-04-07

            Rick,

            I have refbase installed under 'htdocs/refbase' on a separate drive to the C: drive. Bibutils are at: c:\bibutils

            Paths from the database are:

            refbase: NULL
            bibutils: C:/bibutils

            Should I simply place the bibutils exe files in a subdirectory of my refbase, ie htdocs/refbase/bibutils and then use the path: /refbase/bibutils

            Thanks

             
            • Matthias Steffens

              Hi Adrian,

              I'm just guessing from Rick's post here but would it work if you specify just '/bibutils/' as value in field 'depends_path' of table 'depends':

              UPDATE depends SET depends_path = "/bibutils/" WHERE depends_external = "bibutils";

              Matthias

               
    • Matthias Steffens

      Hi Sebastian,

      I'm glad to hear that your problem is gone. :-) Of course, it would be interesting to understand why this has happened in the first place.

      > I installed the database manually and edited out any reference to
      > the database in the install script. I do not know how this fixed my
      > problem since it should in theory produce about the same results as
      > a manual install

      Yes, I would have thought the same. Strange.

      > It appears that in the export_xml2*.php files you open a temporary
      > file for writing in a tmp dir.

      That's correct and it's a weak point since we can't really assume that the temp directory is always '/tmp' (e.g., on my provider's server I need to use 'phptmp' instead). Problems are that I don't know how to dynamically query the server's current temp directory. At least we should have made this an option in 'initialize/ini.inc.php'...

      > You then pass that temp file to one of the bibutils programs for
      > further processing and then you close it. In my specific case the
      > bibutils program didn't run properly until I moved the instruction
      > closing the file in front of the instruction to pass the temp file
      > to bibutils.

      Ok. However, it's elusive to me why this should make for any difference. I'll change the files as you suggest. Thanks for notifying us!

      Matthias

       
    • Matthias Steffens

      > I am also having problems with Endnote export.
      >
      > I made the change mentioned by unfimaer, but I still don't receive
      > any output. If I chooss html the page is blank.

      The resulting page will be blank if:

      - the path to bibutils isn't correct
      - the path to bibutils doesn't end with a slash (or backslash on Windows)
      - bibutils can't be accessed by the server (due to incorrect permissions)

      There may be more conditions that trigger a blank page on (bibutils) export but these are the ones I'm aware of.

      Best, Matthias

       
    • adrianbj

      adrianbj - 2005-04-07

      Ok - I have tried several things without luck - I am sure it is something I am doing wrong though. I moved a few things around. This is what I have now.

      refbase location: htdocs/refbase
      bibutils location: htdocs/refbase/bibutils

      depends_path entries:

      refbase: /refbase\
      (i tried forward and backslash at the end since Matthias mentioned that for windows)

      bibutils: /refbase/bibutils\ (i tried forward and backslash at the end since Matthias mentioned that for windows)

      Do I need a depends path for refbase - it was NULL after the installation?

      What should be in the bibutils folder - I have:
      11 separate exe files and nothing else

      Do I need to worry about the tmp folder issue - where exactly (what path) would refbase be looking for tmp?

      Any other info I can provide?

      Thanks,

      Adrian

       
    • Matthias Steffens

      Hi Adrian,

      sorry that this is causing you so much trouble!

      > (i tried forward and backslash at the end since Matthias mentioned
      > that for windows)

      I don't have a windows box for testing this, but (judging from Rick's post) I was wrong in suggesting a backslash. Sorry for the confusion!

      From what Rick was suggesting, I think that if you have bibutils installed under 'C:/bibutils' your path to bibutils should be '/bibutils/'.

      Things may be more complicated if bibutils isn't installed under 'C:' but on a separate drive (at least I have no clue what would be the correct path to this drive for the MySQL table).

      The path for 'refbase' must not be changed, NULL is fine (specifying another path shouldn't make any difference, though).

      > What should be in the bibutils folder - I have:
      > 11 separate exe files and nothing else

      Currently, refbase makes use of the bibutils programs xml2bib, xml2end and xml2ris. I.e., only these exe files will be required for refbase.

      Have you tried, moving your bibutils programs back to 'C:/bibutils' and specifying '/bibutils/' as path? You should also make sure that the permissions are set correctly for 'C:/bibutils', otherwise the server can't access the program files.

      HTH, Matthias

       
      • adrianbj

        adrianbj - 2005-04-07

        Matthias,

        I think I should have thought a little more simply right from the start. Being on windows you definitely (or at least with my configuration) need to specify the drive. I have put the bibutils back under c:\bibutils and made the path:

        C:/bibutils/

        The only thing I didn't have at the start was the final forward slash which of course was written in your documentation, so basically it's all my fault! After moving things around, I added the foward slash, but never got the combination of location and path correct.

        Anyway, its working perfectly now - I can import and export to endnote very easily - thanks again for all your hard work on this!

         
        • Matthias Steffens

          Adrian,

          I'm glad you could fix this! :-)

          > I have put the bibutils back under c:\bibutils and made the path:
          >
          > C:/bibutils/

          So then it's true that you must use a forward slash as directory separator on windows. That's odd, but well. We should add a note about this to the install script.

          Originally I did plan to have the script check whether the path ends with a slash and add one if it doesn't. But I wasn't sure if I could always add a forward slash or if this would break on Windows. Apparently it's always a forward slash and we should add code so that users don't need to bother with it.

          Thanks for figuring this out, I'm sure other PC users will benefit from it!

          Matthias

           
        • Richard Karnesky

          > Being on windows you definitely (or at least with my configuration) need to specify the drive.
          Pathnames on windows are a bear!  Either forward or backslash are SUPPOSED to work.  If on C:, drive letter is SUPPOSED to be optional.  As you have seen, Your Mileage May Vary!

          > Anyway, its working perfectly now
          Great to hear!  Thanks for posting your solution for others who have the same problem!

          --Rick

           

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks