#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Gig Harbor, Washington, USA
    Posts
    29
    Rep Power
    0
    I am writing a script that will allow users to vote on the bottom of the page "Was this section useful to you?" Then I specify who it's from (since the user is anonymous), make a specific folder in my mailbox for it, and get feedback on my sections.

    Anyways in the e-mail I want it to say "The Section (/address/goes/here.php4) was useful to the user" or if it wasnt useful then it would say that. I'm not too familiar with PHP_SELF but I think it should be able to accomplish this.. I just couldn't get it to work.

    each of the sections that I want this script to go on will simply have <? include(./feedback.php3); ?> in it. This is a rough draft of the script:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <?
    if (!$submit)
    {
    ?>
    <HTML>
    <HEAD>
    <title>Voting Script</title>
    </HEAD>
    <BODY>
    <form method="GET" action="email.php3">
    <table cellpadding=0 cellspacing=2 border=0>
    <tr>
    <td align="left">
    <font face="MS Sans Serif,Verdana,Arial,Helvica" size=1><b>
    Was this helpful to you?
    </b>
    </left>
    </td>
    <td align="right">
    <select name="voting">
    <option value="Yes">Yes
    <option value="No">No
    </select>
    </right>
    </td>
    <td>
    <input type="submit" name="submit" value="Tell Us">
    </table>

    <?
    }
    else
    {
    ?>
    <?php

    if ($voting == "Yes") {
    echo "<html><body>";

    $recipient = "Chris Swanicke <swanicke@defected.net>";
    $subject = "Vote: YES";
    $message = "USER VOTED YESnnThis section was useful to the user..nn";
    $extra = "From: voters@swanicke.comrnReply-To:nobody@noone.comrn";

    mail ($recipient, $subject, $message, $extra);

    echo "Thank You for your input.";
    echo "</body></html>";
    }
    else
    {
    echo "<html><body>";

    $recipient = "Chris Swanicke <swanicke@defected.net>";
    $subject = "Vote: NO";
    $message = "USER VOTED NOnnThis Section was not useful to the user.nn";
    $extra = "From: voters@swanicke.comrnReply-To:nobody@noone.comrn";

    mail ($recipient, $subject, $message, $extra);

    echo "Thank You for your input.";
    echo "</body></html>";
    }
    ?>
    <?
    }
    ?>
    [/code]

    So... can anyone tell me how I would get it to show me the url of the page that the user voted off of in the emails I get?

    EDIT:Some code lines messed up the table width.. just had to edit that
    ------------------
    chris swanicke
    swanicke@defected.net

    [This message has been edited by swanicke (edited August 10, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    15
    When they fill out the form, and hit submit, they'll be taken to the page that emails you, correct? If that is so, then the page they are just coming from (and hence, the page they are voting on) will be stored in $REFERER or $HTTP_REFERER - just access either of those 2 variables to get the page they are voting on. Hope that helped.

IMN logo majestic logo threadwatch logo seochat tools logo