Jump to content

Integer Value Help


marklarah

Recommended Posts

Code:

<?php
// 
// Edit below "if" if you want this feature available only to certain levels, or if they need a qwid shop item etc.
//

if (isset($username))
{
if ((isset($_POST['song'])) || (isset($_POST['score'])) || (isset($_POST['song'])) || (isset($_POST['game'])) || (isset($_POST['difficulty']))){

if (!is_int($_POST['score'])){

echo "No.";
exit;
}
//
// Below query may need editing
//
$game =$_POST['game'];
$difficulty =$_POST['difficulty'];
$score =$_POST['score'];

$song =  htmlentities($_POST['song']);

$resultb="INSERT INTO `Score` (ID, Game, Difficulty, Score, Song, Date, userid, ) VALUES(NULL, '$game', '$score', '$song', NOW(), '$useridm')";
mysql_query($resultb) or die(mysql_error());



echo "<h2>Score submitted.";

echo '</h2><br><br>';
}
?>

<font size="+1">Insert your game/score etc</font><br><small>Also dudes, don't be a faggot with it. Please be honest and such, otherwise it messes up the system, and everyone will hate you. So please, don't. Just don't.<br><br>
<form method="post" action="scores.php">
<b>Game</b>
<select name="game">
<option value ="1">Rock Band</option>
<option value ="2">Guitar Hero 1</option>
<option value ="3" selected="selected">Guitar Hero 2</option>
<option value ="4">Guitar Hero 3</option>
</select><br>

<b>Difficulty</b>
<select name="difficulty">
<option value ="1">Easy</option>
<option value ="2">Medium</option>
<option value ="3">Hard</option>
<option value ="4" selected="selected">Expert</option>
</select><br>

<b>Score</b>
<input type="text" name="score" size="20" maxlength="6"><br>

<b>Song</b>
<input type="text" name="song" size="20" maxlength="20">
<br><br>


<input type="submit" name="butt" value="Submit"></center>
</form>


<br><br>


<br><br><? include 'links.php'; ?>
</td></tr></table>

<?php
}else{
echo 'Authorization Required.';
}
require 'footer.inc.php';
?>

 

The elses at the bottom are from the header (above the posted code)

 

Anyway, whenever I enter a legit score, it says "no" (meaning php things it aint a integer value)

 

Help please?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.