Results 1 to 4 of 4

Thread: another ini problem

  1. #1
    Join Date
    Feb 2008
    Posts
    9

    Default another ini problem

    first id like to say hi, and appreciate the users and work that has been put into this script, great script from what ive seen so far

    just a couple of things,i am using the form to process one username and with that username i want a random quote to be pulled out of my quote file, send to me and displayed on the thank you page what that quote was. My quotes are congrations youve won "X" prize. A couple of things go wrong for me

    Here is what works
    ``````````````````````````````````````````````````````````````````

    <html>
    <head>
    <title>Find out what you won</title>
    <style type="text/css">
    <!--
    .style1 {
    font-size: 24px;
    font-weight: bold;
    }
    -->
    </style>
    </head>
    <body>
    <p>&nbsp;</p>
    <p></p>

    <form method="post" action="http://www.whatever.com/mail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">


    <input type="hidden" name="recipients" value="email" />


    <input type="hidden" name="subject" value="winner" />
    <table width="987" border="0" cellspacing="5%">
    <tr>
    <td width="563">
    <p align="right" class="style1">Please enter your user name:</p> </td>
    <td width="399"><input type="text" name="realname" /> </td>
    </tr>
    <tr>
    <td>

    <div align="right">
    <input type="submit" value="Submit" />
    </div></td>
    <td></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    ````````````````````````````````````````````````````````````````
    that goes with my ini file

    [email_addresses]
    email = "whatever@whatever.com"
    `````````````````````````````````````````

    and produces me an email

    `````````````````````````````````````````````````````````````
    email:
    realname: Username whatever

    ==================================

    REMOTE_HOST=
    REMOTE_ADDR=XXXXXXX
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2)
    REMOTE_USER=

    ````````````````````````````````````````````````````````````````

    so this is all fine and working

    now to get the random quote thrown in is where things go wrong

    if i use

    ````````````````````````````````````````````````````

    <html>
    <head>
    <title>Find out what you won</title>
    <style type="text/css">
    <!--
    .style1 {
    font-size: 24px;
    font-weight: bold;
    }
    -->
    </style>
    </head>
    <body>
    <p>&nbsp;</p>
    <p></p>

    <form method="post" action="http://www.whatever.com/mail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">


    <input type="hidden" name="recipients" value="email" />

    <input type="hidden" name="winner" value="<?php include('quotes.php'); ?>" />

    <input type="hidden" name="subject" value="winner" />
    <table width="987" border="0" cellspacing="5%">
    <tr>
    <td width="563">
    <p align="right" class="style1">Please enter your user name:</p> </td>
    <td width="399"><input type="text" name="realname" /> </td>
    </tr>
    <tr>
    <td>

    <div align="right">
    <input type="submit" value="Submit" />
    </div></td>
    <td></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    ```````````````````````````````````````````

    it only gives me an email of

    ````````````````````````````````````````````````````

    congratulations you have won $7
    ==================================

    REMOTE_HOST=
    REMOTE_ADDR=xxxxxxxxx
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2)
    REMOTE_USER=

    ``````````````````````````````````````````````````````````

    for some reason it doesnt display the realname /username result


    .Now i cant figure out why this does this, so i thought id try it with the ini file instead of using it like that

    ``````````````````````````````````````````````````````


    <html>
    <head>
    <title>Find out what you won</title>
    <style type="text/css">
    <!--
    .style1 {
    font-size: 24px;
    font-weight: bold;
    }
    -->
    </style>
    </head>
    <body>
    <p>&nbsp;</p>
    <p></p>

    <form method="post" action="http://www.whatever.com/mail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">


    <input type="hidden" name="recipients" value="email" />

    <input type="hidden" name="winner" value"win" />

    <input type="hidden" name="subject" value="winner" />
    <table width="987" border="0" cellspacing="5%">
    <tr>
    <td width="563">
    <p align="right" class="style1">Please enter your user name:</p> </td>
    <td width="399"><input type="text" name="realname" /> </td>
    </tr>
    <tr>
    <td>

    <div align="right">
    <input type="submit" value="Submit" />
    </div></td>
    <td></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    ``````````````````````````````````````````````````
    with ini file like this

    ````````````````````````````````````````````````````````
    [email_addresses]
    email = "whatever@whatever.com"

    [special_fields]
    win = "<?php include('quotes.php'); ?>"

    ``````````````````````````````````````````````````````
    I only get the email

    `````````````````````````````````````````````````````

    win
    ==================================

    REMOTE_HOST=
    REMOTE_ADDR=xxxxxxxxxx
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2)
    REMOTE_USER=

    `````````````````````````````````````````````````````

    any help or tips would be appreciated,
    i know that this a bit from what the script is intended for but i feel it would be the most secure script, that stops users being able to view source of what has been won and then deciding to refresh till they had a good win then add username.

  2. #2
    Join Date
    Feb 2008
    Posts
    9

    Default Re: another ini problem

    ok instead of all that is there just some way that i can add <?php include('quotes.php'); ?> into the formail script itsself ? so then it sends it to me and prints it 2 the success page ?

  3. #3
    Join Date
    Feb 2008
    Posts
    9

    Default Re: another ini problem

    dont worry about all that i added a hook and made mt self a little sript

    writting the random number quote and calling it as the $subject in the thank you form and sending it also, you can use any of the "special fiels " to write to the ini file and call them, therefor this comes like a mini database


    <?php

    $quote_file = "quotes.txt";

    $fp = fopen($quote_file, "r");

    $quotes = fread($fp, filesize($quote_file));
    $array = explode("\n",$quotes);
    fclose($fp);

    srand((double)microtime()*1000000);
    $array_index = (rand(1, sizeof($array)) - 1);

    $winner = $array[$array_index] ;
    $myFile = "winner.php";
    $fh = fopen($myFile, 'w') or die("can't open file");
    $stringData = "[special_fields]\n";
    fwrite($fh, $stringData);
    $stringData = "subject =\"$winner\"\n" ;
    fwrite($fh, $stringData);
    $stringData = "env_report = REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE\n" ;
    fwrite($fh, $stringData);
    $stringData = "[email_addresses]\n";
    fwrite($fh, $stringData);
    $stringData = "email = \"whatever@whatever.com\"" ;
    fwrite($fh, $stringData);

    fclose($fh);



    so what i would like to know now, is my actual form is loaded as my index file, so therefore i wont get the right referer .i want to know if my form mail script is getting used from from my index file, so how can i get sent that the information that tells me mailform has been refered from my index ?

  4. #4
    Join Date
    Feb 2008
    Posts
    9

    Default Re: another ini problem

    feell free to delete this post, as i am unable

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Selectable Recipient List using .ini file
    By Godan in forum Community Support
    Replies: 1
    Last Post: 10-Oct-2006, 09:18 PM
  2. mutiple recipients not working with ini file
    By saejoon in forum Bug Reports
    Replies: 3
    Last Post: 25-Sep-2006, 05:53 PM
  3. mutiple recipients not working with ini file
    By saejoon in forum Community Support
    Replies: 1
    Last Post: 19-Sep-2006, 09:51 PM
  4. Trouble with the formmail ini function
    By Carina in forum Community Support
    Replies: 3
    Last Post: 17-Sep-2006, 02:48 PM
  5. Formmail ini file
    By Wayne Hammond in forum Features Questions
    Replies: 5
    Last Post: 28-Jun-2006, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •