Menu

Possbile Code Blocking Functions of Form

Help
2007-12-20
2013-06-03
  • Ravenspirit

    Ravenspirit - 2007-12-20

    Hello,

    I installed phpformgen and it works great and writes back to my database but I have run into a snag and I know its due to being new with working with PHP.  The address where the form actually is functioning is http://www.ravensongsworld.org/phpformgen/use/Avatar/form1.html

    Works great but I would like to put it under one of my modules and wasnt sure how to do this so I found a script to create a modules block and this is the code that they said to use: 

    <?php

    require_once("mainfile.php");
    $module_name = basename(dirname(__FILE__));

    $pagetitle = "Your page title";

        include("header.php");
        OpenTable();

    $handle = fopen("http://yourhtmlcodesite.com/","r");
    $i=1;
    while(!feof($handle))
    {
    $str = fgets($handle, 200);
    echo "$str";
    $i++;
    }
    fclose($handle);

        CloseTable();
        include("footer.php");
    ?>

    I changed this line ($handle = fopen("http://yourhtmlcodesite.com/","r");) to reflect the actual page but when I refresh the page you can see the form albeit the graphics icons are not shown and the submit button does not work.  I have read through the posts here and in one it suggested moving the files to the location of my module so I tried this but get the same results.  This is the defunct page:  http://www.ravensongsworld.org/modules.php?name=Avatars

    Any help would be appreaciated.  Thank You

     
    • TNTEverett

      TNTEverett - 2007-12-20

      It's likely that your only problem is that the form expects all files to be relative to where the form resides.  Since it appears you are calling the form from some other location the form features are refered to relative to the new location instead of where the form is actually located. 
      You can fix this is one of two ways.
      1. Move the form and all it components to the new location keeping all files and folders intact. 
      2. Change all the links in the form and process files to be explicit.  For example:
      action='process.php'
      change to
      action='http://url/path/process.php'

      <img border="0" src="bc_new.gif"
      change to
      <img border="0" src="http://url/path/bc_new.gif"

      Similar changes in the process.php file.

       
    • Ravenspirit

      Ravenspirit - 2007-12-20

      Sweet.  That did the trick on all the graphics.  I am still looking at the code and I believe I have made all the changes but when I hit the submit button now its telling me there is an error on Line 5 of the process.php and it has to do with the 'post' line.

      Error:  Fatal error: Call to undefined function pt_register() in /home/ravenson/public_html/modules/Avatars/process.php on line 5

      Now the actual process.php has this listed on line 5:
      pt_register('POST','CharacterName');

      Im kind of starting to understand some of the code on this.  The form has this on the top line and the command call 'post' is listed in the top line:

      <form enctype='multipart/form-data' action='http://www.ravensongsworld.org/modules/Avatars/process.php' method='post'>

      How should I edit the method='post'

      Thanks for the help

       
      • TNTEverett

        TNTEverett - 2007-12-20

        pt_register is in the global include file. 

        Look for this at the top of the process.php
        <?php
        include("global.inc.php");

        Make sure the same rules apply.
        1. Move the file relative to the folder it is called from.
        or
        2. Make the path explicit. 

         
    • Ravenspirit

      Ravenspirit - 2007-12-20

      I got it fixed thanks to your expertise.  Your help was greatly appreciated, thanks again.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.