Jump to content
GIGN Forum

Neinsreto.


DST
 Share

Recommended Posts

Iepriekš viss strādāja nesaprotu kpc tgt nekas nenotiek. :( ?

if($_COOKIE['member_id'] > 0) {
if(isset($_POST['news'])) {

if(!empty($_POST['name']) and !empty($_POST['bilde']) and !empty($_POST['zina']) and !empty($_POST['bigzina']) and !empty($_POST['image']))
    {
$selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']);
while ($r = mysql_fetch_array($selekts))
{
$name = $_POST['name'];
$bilde = $_POST['bilde'];
$zina = $_POST['zina'];
$bigzina = $_POST['bigzina'];
$image = $_POST['image'];
$userid = $_COOKIE['member_id'];
$user = $udata->members_display_name;
$datums = time();
mysql_query("INSERT INTO zinas (virsrakts, teksts, datums, user, userid, bilde, text, size) VALUES ('$name', '$bigzina', '$datums','$user', '$userid', '$bilde', '$zina', '$image')", $link);
$errprs - mysql_errno($link) . ": " . mysql_error($link) . "\n";


$oks = '<div class="success">Viss noriteja veiksmigi.  </div>';
}
}else {
$kluda = '<div class="error">Kads lauks netika aizpildiits.</div>';}
}



?>


<?

echo $errors;
if(isset($oks)) echo $oks;
if(isset($kluda)) echo $kluda;  ?><form action="" name="news" method="POST">
<table>
<tr><td>Virsraksts</td><td><input type="text" name="name" class="jaunumi " /></td></tr>
<tr><td>Bilde</td><td><input type="text" name="bilde" class="jaunumi" /></td></tr>

<tr><td>Ziņa mazā.</td><td>        <script>edToolbar('zina'); </script>
    <textarea name="zina" id="zina" class="ed"></textarea></textarea></td></tr>
<tr><td>Ziņa lielā</td><td>        <script>edToolbar('bigzina'); </script>
    <textarea name="bigzina" id="bigzina" class="ed"></textarea></textarea></td></tr>
<tr><td>Lielā bilde</td><td><input type="radio" name="image" value="big" class="radio" /></td></tr>
  <tr><td>Mazā bilde</td><td><input type="radio" name="image" value="small" class="radio" /></td></tr>
  </table><br />
  <div class="poga"><button type="submit" name="news" value="Sūtīt <button>" class="submit">    
    <span><span> Pievienot</span></span>
</button></div>
</form>
</div>
<?
}

Link to comment
Share on other sites

$selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']);

Nomaini uz

$selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']."");

Vajadzētu iet

Tev tur pilnīgi nekas nemainās...

anyway, -

<?php
if(isset($_COOKIE['member_id']) === true && is_numeric($_COOKIE['member_id']) === true && $_COOKIE['member_id'] > 0) 
{
    if(isset($_POST['name']) === true && empty($_POST['name']) === false &&    isset($_POST['bilde']) === true && empty($_POST['bilde']) === false &&    isset($_POST['zina']) === true && empty($_POST['zina']) === false && isset($_POST['bigzina']) === true && empty($_POST['bigzina']) === false &&    isset($_POST['image']) === true && empty($_POST['image']) === false)
    {
        $selekts = mysql_query('SELECT `id` FROM `ibf_sessions` WHERE `member_id` = ' . $_COOKIE['member_id'], $link);
        if(mysql_fetch_object($selekts) != false)
        {
            $name = mysql_real_escape_string($_POST['name'],$link);
            $bilde = mysql_real_escape_string($_POST['bilde'],$link);
            $zina = mysql_real_escape_string($_POST['zina'],$link);
            $bigzina = mysql_real_escape_string($_POST['bigzina'],$link);
            $image = mysql_real_escape_string($_POST['image'],$link);
            
            $userid = $_COOKIE['member_id'];
            $user = $udata->members_display_name;
            $datums = time();
            
            mysql_query("INSERT INTO `zinas` (virsrakts, teksts, datums, user, userid, bilde, text, size) VALUES ('$name', '$bigzina', '$datums','$user', '$userid', '$bilde', '$zina', '$image')", $link);
            
            if(mysql_error($link) != '')
            {
                $mess = mysql_errno($link) . ": " . mysql_error($link) . "\n";
            }
            else
            {
                $mess = '<div class="success">Viss noriteja veiksmigi.  </div>'
            }
        }
        else
        {
            $mess = '<div class="error">IPB sessija netika atrasta</div>';
        }
    }
    else
    {
        $mess = '<div class="error">Kads lauks netika aizpildiits.</div>';
    }

    echo $mess; 

?>
<form action="" name="news" method="POST">
<table>
<tr><td>Virsraksts</td><td><input type="text" name="name" class="jaunumi " /></td></tr>
<tr><td>Bilde</td><td><input type="text" name="bilde" class="jaunumi" /></td></tr>

<tr><td>Ziņa mazā.</td><td>        <script>edToolbar('zina'); </script>
    <textarea name="zina" id="zina" class="ed"></textarea></textarea></td></tr>
<tr><td>Ziņa lielā</td><td>        <script>edToolbar('bigzina'); </script>
    <textarea name="bigzina" id="bigzina" class="ed"></textarea></textarea></td></tr>
<tr><td>Lielā bilde</td><td><input type="radio" name="image" value="big" class="radio" /></td></tr>
  <tr><td>Mazā bilde</td><td><input type="radio" name="image" value="small" class="radio" /></td></tr>
  </table><br />
  <div class="poga"><button type="submit" name="news" value="Sūtīt <button>" class="submit">    
    <span><span> Pievienot</span></span>
</button></div>
</form>
</div>
<?php
}

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...