Announcement

Collapse
No announcement yet.

Submit to Web; PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Submit to Web; PHP

    First of all, I would like to say that I am very impressed with SUF6.0. The application is extremely flexible for all of my needs. However, I have a question that I need answered and it has been eating at my brain:

    I am collecting information from my installers: Name & Email Address. I want to be able to submit the collected information to a PHP script that writes the information to a tect file on my site. When I wrote the script, it didn't work. The application ran, however, the text file was not updated with the information submitted. I did follow the information provided in the help file in SUF. My PHP script was as follows:

    <?php
    if (!$save = fopen("test.txt","a")) {
    exit;
    }
    fwrite($save,"$UserName\r\n");
    fwrite($save,"$UserEmail\r\n");
    fclose($save);
    ?>

    In SUF, my edit fields &amp; text stored in variables were as follows:
    Name: %UserName%
    Email Address: %UserEmail%

    My Parameters name for Submit to Web were as follows:

    USER EMAIL:
    Name: UserEmail
    Value: %UserEmail%

    USER NAME:
    Name: UserName
    Value: %UserName%

    Any thoughts on what I am doing wrong?

    Thanks,

    Gregg


    Gregg Payne

  • #2
    Re: Submit to Web; PHP

    Could be a few things. First thought though, you are using the append flag "a" for your write function. This means if the file doesn't already exist it will not be created. Did you realize that? If not then simply change that "a" to a "w+" and it should work fine... [img]/ubbthreads/images/icons/smile.gif[/img] for example:

    <?php
    if (!$save = fopen("test.txt","w+")) {
    exit;
    }
    fwrite($save,"$UserName\r\n");
    fwrite($save,"$UserEmail\r\n");
    fclose($save);
    ?>

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      Re: Submit to Web; PHP

      Thanks for your help. However, that didn't help. I actually forgot to set the write rights (CHMOD) to the file I was wanting to append to.

      Thanks again for your help.
      Gregg Payne

      Comment


      • #4
        Re: Submit to Web; PHP

        Yep that'll do it to. [img]/ubbthreads/images/icons/smile.gif[/img] Glad you got it working...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment


        • #5
          Re: Submit to Web; PHP

          Thanks Corey, for the TOP NOTCH SUPPORT! I can't believe the support we developers get here! Thanks again!

          Flight Factory-Simulations; LLC
          www.flightfactory-simulations.com
          Gregg Payne

          Comment

          Working...
          X