Toon posts:

if else etc code doesnt work help pls

Pagina: 1
Acties:
  • 26 views sinds 30-01-2008

Verwijderd

Topicstarter
<?php
$db = @mysql_connect("localhost", "******", "*******");
mysql_select_db("*********", $db);
$ip=getenv(REMOTE_ADDR);
$result = mysql_query("SELECT * FROM rates where REMOTE_ADDR='$ip' AND rid=$id;",$db);
$number = mysql_numrows($result);
?>
<? printf("%s\n", $number);?>




if ($number != 0) {


<p>Here you rate the users for skill, loox and attitude</p>
<p>Submit only once, go BACK and RELOAD to see your addition.</p>
<form method="post" action="<?php ratesadds.php3+$id?>">
<div align="left">
<p>Skill Rating:
<select name=ratings>
<option value="">- Select -</option>
<option value="20">blaa<option>
<option value="40">Novice</option>
<option value="60">Average</option>
<option value="80">Inhuman</option>
<option value="100">Godlike</option>
</select>
</p>

<br>
<?php $rid = $id; ?><input type="hidden" name="rid" value="<?php echo $rid ?>"


<br>
</p>
<p>
<input type="Submit" name="submit" value="Enter information">
</p>
</div>
</form>

} else if ($submit) {
<?PHP

// process form
$db = @mysql_connect("localhost", "***", "**********");
mysql_select_db("*******",$db);
$date = date("Y-m-d");

$sql1 = "INSERT INTO rates (ratings,rid,REMOTE_ADDR,date) VALUES ('$ratings','$rid','$REMOTE_ADDR','$date')";
$result1 = mysql_query($sql1);
?>
} else {

<?PHP
echo "YOUR HAVE VOTED.\n";
}
?>

Kan iemand me helpen met deze code. Ik denk dat het de plaatsingen van de code van de if else zijn. BvD

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 09-09 20:58

Janoz

Moderator Devschuur®

!litemod

We gaan hier niet ff source neerplanten en door iemand anders laten debuggen!!! Zie ook quickstart

tip: Php die je wilt laten uitvoeren hoort tussen php tags te staan.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


Dit topic is gesloten.