Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
help 2
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-04-02 12:50:54
i try to recreate a new mod but i think i have an error in it
i think is on this line
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")



i put the whole code also if want to help.

<?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly;

if (get_user_class() < 7)
show_error_msg('Error', 'Access denied.');
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
$updateset = $_POST['class'];
$res = SQL_Query_exec("SELECT id, invites FROM users WHERE class IN (".implode(",", $updateset).")");
while($arr=mysqli_fetch_assoc($res))
{
$curinvites = $arr["invites"];
$toadd = 0 + sqlesc($_POST["inviteadd"]);
$invites = ($curinvites + $toadd);
$shot = SQL_Query_exec("UPDATE users SET invites = $invites WHERE id = $arr[id]");
}
if ($shot)
show_error_msg("Done!", "Invitation were sent with succes!!");
else
show_error_msg("Error", "You didn`t select any class!");
}
stdhead("Invitation per class");
//$class = sqlesc($_POST["class"]);
?>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style7 {
font-size: 14px;
font-weight: bold;
}
-->
</style>


<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=inviteadder.php>
<table cellspacing=0 cellpadding=10>

<tr>
<td><b><center><font size=3 color=orangered>Select User Class:</font></center></b>
<br>
<table style="border: 0" width="750" cellpadding="0" cellspacing="0">

<td style="border: 0" width="20"><input type="checkbox" name="class" value="1"></td>
<td style="border: 0">Member</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="2"></td>
<td style="border: 0">Power User</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="3"></td>
<td style="border: 0">V.I.P</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="4"></td>
<td style="border: 0">Uploader</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="5"></td>
<td style="border: 0">Moderator</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="6"></td>
<td style="border: 0">S. Moderator</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="7"></td>
<td style="border: 0">Administrator</td>

<td style="border: 0" width="20"><input type="checkbox" name="class" value="8"></td>
<td style="border: 0">Owner</td>

</tr>
<td></td>

<td></td>
<tr></table>

   <tr><td><center><h2>
<span class="style1">How manny invites to send:</span>
<br></br>
   <strong>Invites</strong><input type=text name=inviteadd size=7>
   </h2></center></td></tr>
 
   <tr><td colspan=2 align=center><input type=submit value="Send!" class=btn></td></tr>

</form>
</table>


<?
stdfoot();
?>
2022-04-02 12:56:15
Try $_SERVER["REQUEST_METHOD"]
2022-04-02 13:57:21
it works thanks
2022-05-20 23:42:00
You want to use the strict comparison operator === when checking global variables, and when you are comparing integers.

== works but it ignores types (string, integer, object, etc) and checks value only. Expect slower parsing.

When you are working with C/C++ (C# also strict, but not relevant here) you gotta think.. that code is what PHP was built on, and using that code (say, compile johns_app.exe), you must declare types like crazy! Or compiler vomits with compiler faults. PHP expects absolutely beginner input so it does a incredible job of “guessing”, but performance goes to crap. This is no different.

When working with database fields, it’s best to use == because MySQL reports already what type the column is so it doesn’t really matter. Trust == on database fields.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728