1

My script displays a list of offers that I can either deny or approve. The problem I am having is sometimes I click deny and the offer is correctly denied but sometimes I click deny and it is incorrectly approved.

Using Live HTTP Headers I've checked the post data being sent when the offer is incorrectly approved and I see

denymes=Not+In+Downline&status=4&status=1

So the problem is that status is being sent twice.

I don't understand what is wrong. Sometimes it works correctly.

The code in question:

$list.="
    <div class=\"borderBox\" id=\"approve_ad_main".$temp[id]."\">
        <form name=\"deny".$temp[id]."\" action=\"index.php?view=account&ac=myads&adtype=ptsu&id=$temp[id]&action=approve&".$url_variables."\" method=\"post\">
        <div style=\"border:0px solid #000;padding:5px;\" valign=\"top\" colspan=\"2\">Add Denied Message : <input type=\"text\" name=\"denymes\" value=\"\" size=\"50\"><br/>
        <small>This is for displaying a message as to why the ad was denied<br/>
        Leave blank if approving the ads.</small><br/>
        <input type=\"hidden\" name=\"status\" value=\"4\">
        <input type=\"submit\" value=\"Deny\" style=\"width:150px;float:left;\">
        </form>
        <form name=\"approve".$temp[id]."\" action=\"index.php?view=account&ac=myads&adtype=ptsu&id=$temp[id]&action=approve&".$url_variables."\" method=\"post\">
        <input type=\"hidden\" name=\"status\" value=\"1\">
        <input type=\"submit\" value=\"Approve\" style=\"width:150px;float:left;margin-left:5px;\">
        </form>
        <br/><br/>

        <a href=\"$temp[target]\" target=\"_blank\">$temp[title]</a>
        <div id=\"approve_ad".$temp[id]."\">
            Username: $temp[username]<br />
            <div style=\"height: 150px; overflow: auto; border: 1px solid #c8c8c8; background-color: white; text-align: left; padding: 5 5 5 5px; color: black\">
                <b>Userid Used: </b> $temp[userid]<br />
                ".nl2br($temp[welcome_email])."
            </div>
        </div>
    </div>


Here's code from view source. Still can't figure out what's wrong.

<div class="borderBox" id="approve_ad_main1000">
    <form name="deny1000" action="index.php?view=account&ac=myads&adtype=ptsu&id=1000&action=approve&sid=27TWk0MU39VX4YhlU0Tn&sid2=28TYk&siduid=28&" method="post">
    <div style="border:0px solid #000;padding:5px;" valign="top" colspan="2">Add Denied Message : <input type="text" name="denymes" value="" size="50" /><br/>
    <small>This is for displaying a message as to why the ad was denied<br/>
    Leave blank if approving the ads.</small><br/>

    <input type="hidden" name="status" value="4" />
    <input type="submit" value="Deny" style="width:150px;float:left;" />
    </form>

    <form name="approve1000" action="index.php?view=account&ac=myads&adtype=ptsu&id=1000&action=approve&sid=27TWk0MU39VX4YhlU0Tn&sid2=28TYk&siduid=28&" method="post">
    <input type="hidden" name="status" value="1" />
    <input type="submit" value="Approve" style="width:150px;float:left;margin-left:5px;" />
    </form>
    <br/><br/>


    <a href="http://cw.nu/click?aid=9758&linkid=B18917&subid=&subid2=&subid3=&subid4=&subid5=" target="_blank">Beauty Discount Club - (submit Page &amp; Confirm Email)</a>
    <div id="approve_ad1000">
        Username: dan1190<br />
        <div style="height: 150px; overflow: auto; border: 1px solid #c8c8c8; background-color: white; text-align: left; padding: 5 5 5 5px; color: black">
            <b>Userid Used: </b> dan<br />

            dan
        </div>
    </div>
</div>
2
  • can you show the whole form as it appears from view source? Commented Jan 2, 2012 at 21:43
  • What ahppens when you chage the name of your status variable to something else? try to make it more unique, perhaps offStatus Commented Jan 2, 2012 at 21:45

1 Answer 1

1

your input tags aren't being closed, which may cause the form close tag to be ignored.

Your current code:

<input type=\"hidden\" name=\"status\" value=\"1\">

Correct code:

<input type=\"hidden\" name=\"status\" value=\"1\" />

Because the form isn't being closed, it is counted as a single form, hence the double status.

Sign up to request clarification or add additional context in comments.

3 Comments

hmmm.. I went through and closed all input tags as suggested but still having the same problem.
What is in the $url_variables? Is it possible that the status of a previous form submit is going into the next one?
The $url_variables are session ids. It's not possible on the previous submit. This is really annoying. I don't understand why its only happening some of the time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.