Hi, i really need help with my script.
Everything works fine except the script won't post to inbox, just married.
You enter the name of the person you want to marry and then choose a ring.
This line works perfectly:
mysql_query("INSERT INTO married ( id , starter , other , done , ring )
But not this, nothing happens, every fields in inbox are empty:
mysql_query("INSERT INTO inbox ( id , to , from , message , date , read )
VALUES (
'', '$name', '$username', '$invite_text', '$date', '0'
Here is the question i want it to post in table inbox "a copy from the script":
<form name=marriage method=post action='?accept=marry&marrie_who=$username'>
<div align=center>You have been asked to marry $username, you got 2 options:<br>
<input name=Decline type=submit id=Decline value=Decline>
|
<input name=Accept_marriage type=submit id=Accept value=Accept>
</div>
</form>
<?php
session_start();
include_once "database_con.php";
include_once "functions.php";
include_once "jail.php";
logincheck();
$username=$_SESSION['username'];
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
if (strip_tags($POST['Submit']) && strip_tags($POST['name'])){
$name=strip_tags($POST['name']);
$ring=strip_tags($POST['ring']);
if (!$name){
echo "Please enter the name of the person whom you wish to marry.";
}elseif ($name){
if ($ring == "1"){
$price="100000";
$ring_type="Cheap ass ring";
}elseif ($ring == "2"){
$price ="500000";
$ring_type="Golden Ring";
}elseif ($ring == "3"){
$price ="1000000";
$ring_type="Diamond Ring";
}elseif ($ring == "4"){
$price ="10000000";
$ring_type="Beers Diamond Ring";
}
$total = 10000 + $price;
if ($total > $fetch->money){
echo "You dont have enough money";
}elseif ($total <= $fetch->money){
$new_money=$fetch->money - $total;
$married_tr=mysql_num_rows(mysql_query("SELECT
FROM married
WHERE done = '1'
AND starter = '$username'
OR other = '$username'"));
if ($married_tr != "0"){
echo "Your already married!";
}elseif($married_tr == "0"){
$married_tt=mysql_num_rows(mysql_query("SELECT
FROM married
WHERE done = '1'
AND starter = '$name'
OR other = '$name'"));
if ($married_tt != "0"){
echo "This user is not single.";
}elseif ($married_tt == "0"){
mysql_query("INSERT INTO married ( id , starter , other , done , ring )
VALUES (
'', '$username', '$name', '0', '$ring_type'
)");
$invite_text="<form name=marriage method=post action='?accept=marry&marrie_who=$username'>
<div align=center>You have been asked to marry $username, you got 2 options:<br>
<input name=Decline type=submit id=Decline value=Decline>
|
<input name=Accept_marriage type=submit id=Accept value=Accept>
</div>
</form>";
mysql_query("INSERT INTO inbox ( id , to , from , message , date , read )
VALUES (
'', '$name', '$username', '$invite_text', '$date', '0'
)");
echo "You asked $name to marry you!";
}}}}}
if (strip_tags($_POST['div'])){
$c=mysql_num_rows(mysql_query("SELECT * FROM married WHERE starter='$username' OR other='$username' AND done='1'"));
if ($c == "0"){
echo "Your not married.";
}elseif ($c != "0"){
mysql_query("DELETE FROM married WHERE starter='$username' OR other='$username'");
echo "You divorced your partner.";
$new_money=$fetch->money - 1000000;
mysql_query("UPDATE users SET money='$new_money' WHERE username='$username'");
mysql_query("INSERT INTO inbox ( id , to , from , message , date , read )
VALUES (
'', '$name', '$username', '$username has divorced you.', '$date', '0'
)");
}
}
?>