Extracting parameters from an HTML page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidiwharper
    New Member
    • Mar 2007
    • 20

    Extracting parameters from an HTML page

    Hi everyone,

    I am rewriting a basic "email data to administrator" script to include an error check, which will ensure that all fields are filled with at least some data.

    However, there is a problem (almost certainly a coding error on my part). I divided the script into subroutines to make it easier to understand and my logic seems to have stuffed up somewhere.

    The code looks like this: Code Attached in program.pl.txt

    What appears to be happening is that the parameters are NOT being read from the web page; when I put a line into the HTML page at the end to show the contents of $username, $address, $fullname and $sender, they all came up as blank (not undef, just blank).

    So it seems that there is either a logic error or a script error.

    The relevent part of the shtml page:

    Code:
    <form method="post" onsubmit="return checkform()" action="/cgi-bin/activate_v2.pl" >
    
    <input type="hidden" id="ip" value="127.0.0.1" />
    
    <p><table>
    <tr>
    	<td>Full Name:</td>
    	<td><input type="text" id="fullname" size="31" /></td>
    </tr>
    <tr>
    	<td>Street Address:</td>
    	<td><input type="text" id="address" size="31" /></td>
    </tr>
    <tr>
    	<td>Email Address:</td>
    	<td><input type="text" id="email" size="31" /></td>
    </tr>
    <tr>
    	<td>Website User Name: </td>
    	<td><input type="text" id="username" size="31" /></td>
    </tr>
    </table></p>
    
    <p><button type="submit">Submit</button></p>
    
    </form>
    The exact same HTML is used in the existing activation page, and the Perl is pretty similar too. What am I doing wrong?

    Thanks!
    David
    Last edited by miller; Mar 23 '07, 08:11 AM. Reason: Code Attached
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Saying only "there is a problem" is not helpful. We already know there is a problem otherwise you probably would not be asking a question. What is the problem and were is the problem?

    Remove or comment out sections of your program until you narrow down the area of the problem. Few if anyone will want to look through your whole program and try and debug it for you.

    Comment

    • davidiwharper
      New Member
      • Mar 2007
      • 20

      #3
      True, and thanks. Can I have edit rights to my original post, please?

      Thanks again!
      David

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Contact Miller, the forum moderator, by PM and ask him to remove your thread if that is what you would like to do.

        Comment

        • miller
          Recognized Expert Top Contributor
          • Oct 2006
          • 1086

          #5
          Hello David,

          I've removed the code that your originally posted and included it as an attachment instead. (Note, you would not have been able to do this). I've also went ahead and removed your email address from your code as a secondary protection mechanism for you.

          If you would like me to just delete this thread, let me know. For now, I agree with Kevin that most likely people are not going to want to take the time to actually read through that much content, even though most of it is html and formatting.

          Nevertheless, next time make sure to remove your own email address and personally identifiable information so that spiders do not start spamming you.

          Regards,
          - Miller

          Comment

          Working...