-
Hi Folks,
In trying the options presented I have created three examples that differ slightly from one another.
Howver if I change the value of say 80 to 100 or 80 to 10, no change occurs which means that the counting portion is not working.
Advice here would be welcome
-
Works for me without a DB, must be a problem with your db query.
To test it load your page with ?v=10 then ?v=1
PHP Code:
<tr class="alt2">
<td>GLENDOWER</td>
<td>27 FEBRUARY 2011</td>
<td>?</td>
<?php
// name of tournament you wish to count entries from
// maybe from a form entry?
//$tournament = 'GLENDOWER - 27/02/2011';
// count the total entries with that tournament name
//$c = mysql_query ("SELECT count(*) from `_Form_Nr_4` WHERE `I_wish_to_play` = '$tournament'");
// add these two lines here:
//$c = mysql_fetch_row($c);
//$c = $c[0];
$c = $_GET['v'];
// these lines take the result (a mysql resource)
// and turn it into an array - something we can actually use
// in php. The entry count is in the first index ( index 0 ).
$openORclosed = $c >= 10 ? 'Closed' : 'Open';
echo "<td>";
if ($openORclosed != 'Closed') {
?>
<form action="https://www.payfast.co.za/eng/process" method="post">
<input type="hidden" name="cmd" value="_paynow">
<input type="hidden" name="receiver" value="junior@hayesgolf.co.za">
<input type="hidden" name="item_name" value="Payment - Glendower - Glacier Series">
<input type="hidden" name="item_description" value="payment">
<input type="hidden" name="amount" value="120.00">
<input type="hidden" name="return_url" value="http://www.gnjgf.co.za/entryform.php">
<input type="hidden" name="cancel_url" value="http://www.gnjgf.co.za/Glacier_Main.html">
<input type="submit" style="width:66px;height:20px;background-color:#B5CCE4;font-size:10px; font-family: arial, sans-serif;" value="PAY NOW">
<?php
} else {
echo $openORclosed;
}
?>
</td>
</tr>
-
Hi,
Thanks for your reply.
Am I correct in understanding then that I must substitute 'v' with 10 or 'v' with 1 to do the test?
Regards
Rob
-
No, v is the get request so...
Load This should display the form. Then load This should display closed.
-
Hi,
Cant seem to log into your two pages ( ERROR 404 )and view what you have tried to show
Regards
Rob
-
those are example URLs, not actual links. He's demonstrating the ?get=variable syntax ( ?v=10 )
-
Hi Folks,
Thanks very much for the rplys.
I have tried the inclusion as requested - no change
Regards
Rob
-
I don't know what you mean by no change, can you be more specific. It shows closed for both, it shows the form for both, the page is blank, it shows the form and open? Please tell us what you are doing, what the response is, and what the response should be.
-
Hi,
The changes I refer to are what I would expect to see following the inclussion of the additional scripts.
In veiwing a test page the status of the page remians the same in terms of OPEN / CLOSED which to me indicates that the information is not being retrieved from MySQL. (This is my veiw and could be wrong)
The response as the entries happen is that the number of entires increase, thus the number changes until the ideal number of 80 is achieved. For this trial I have redueced the number to ten or one inrder for the open / closed status to be effected sooner.
If the status is closed the "PAY NOW" button should not appear in the enter column.
It should only appear when the "OPEN" status is in effect.
I hope this helps in answering your questions.
I would also like to say thanks for enduring in finding a solution.
Regards
Rob
-
I see open, open blue, and closed how are these being set? The open blue are the only ones with the pay now button, correct?