Login | Register | FAQ
Anonymous

Correct this Error's

+ Post a reply

Page 1 of 1


Correct this Error's

by chatrapati » Sat Aug 17, 2013 12:34 pm

<?php

include "config.php";

$id=$_POST['id'];
$name=htmlspecialchars(addslashes($_POST['name']));

$sms=htmlspecialchars(addslashes($_POST['sms']));

$time=date("d-m-y");

if(isset($_POST['submitbutton']))
{

if(empty($name))
{
echo "Kindly enter your name<br/>";
}
if(empty($sms))
{
echo "May be you forgot to Add YOUR SMS <br/>";
}

$count=strlen($name);


if($count < 2)
{
echo "Your name must contain atleast Two characters<br/>";
}
if($count > 12)
{
echo "Your name Must contain less than Twelve characters<br/>";
}

$countsms=strlen($sms);

if($countsms < 20)
{
echo "Your Sms Must contain atleast Twenty characters<br/>";
}

if($countsms > 5000)
{
echo "Your Sms Must contain below Five Thousand Characters<br/>";
}
else
{
$sql="INSERT INTO form1(id,name,sms,time) VALUES('$id','$name','$sms','$time')";

$result=mysql_query($sql) or
die(mysql_error());

}

if ($result)
{
echo "SMS added successfully";
}
else
{
echo "could'nt add your SMS";
}
}
else
{
header("Location:form1.php");

}
?>



what's the error here,

if a user enter's incorrect details, it should not be inserted into the database,

it should show error,

but in this code, if statements are not working.

even if user enters incorrect details, it's inserted into database,

pls specify the error here,

and take a look at

http://wapfull.comoj.com/form2.php

yu'll know the Error's ! !
User avatar

chatrapati

  • Posts: 26
  • Joined: Wed Jul 31, 2013 12:54 pm

Re: Correct this Error's

by stonelee » Sat Aug 17, 2013 4:35 pm

chatrapati wrote:<?php

include "config.php";

$id=$_POST['id'];
$name=htmlspecialchars(addslashes($_POST['name']));

$sms=htmlspecialchars(addslashes($_POST['sms']));

$time=date("d-m-y");

if(isset($_POST['submitbutton']))
{

if(empty($name))
{
echo "Kindly enter your name<br/>";
}
if(empty($sms))
{
echo "May be you forgot to Add YOUR SMS <br/>";
}

$count=strlen($name);


if($count < 2)
{
echo "Your name must contain atleast Two characters<br/>";
}
if($count > 12)
{
echo "Your name Must contain less than Twelve characters<br/>";
}

$countsms=strlen($sms);

if($countsms < 20)
{
echo "Your Sms Must contain atleast Twenty characters<br/>";
}

if($countsms > 5000)
{
echo "Your Sms Must contain below Five Thousand Characters<br/>";
}
else
{
$sql="INSERT INTO form1(id,name,sms,time) VALUES('$id','$name','$sms','$time')";

$result=mysql_query($sql) or
die(mysql_error());

}

if ($result)
{
echo "SMS added successfully";
}
else
{
echo "could'nt add your SMS";
}
}
else
{
header("Location:form1.php");

}
?>



what's the error here,

if a user enter's incorrect details, it should not be inserted into the database,

it should show error,

but in this code, if statements are not working.

even if user enters incorrect details, it's inserted into database,

pls specify the error here,

and take a look at

http://wapfull.comoj.com/form2.php

yu'll know the Error's ! !



Try this :

Code: Select all
<?php

include "config.php";

$id=$_POST['id'];
$name=htmlspecialchars(addslashes($_POST['name']));

$sms=htmlspecialchars(addslashes($_POST['sms']));

$time=date("d-m-y");

if(isset($_POST['submitbutton']))
{
   $Error  = false;
   if(empty($name))
   {
   echo "Kindly enter your name<br/>";
   $Error = true;
   }
   if(empty($sms))
   {
   echo "May be you forgot to Add YOUR SMS <br/>";
   $Error = true;
   }
   
   $count=strlen($name);
   
   
   if($count < 2)
   {
   echo "Your name must contain atleast Two characters<br/>";
   $Error = true;
   }
   if($count > 12)
   {
   echo "Your name Must contain less than Twelve characters<br/>";
   $Error = true;
   }
   
   $countsms=strlen($sms);
   
   if($countsms < 20)
   {
   echo "Your Sms Must contain atleast Twenty characters<br/>";
   $Error = true;
   }
   
   if($countsms > 5000)
   {
   echo "Your Sms Must contain below Five Thousand Characters<br/>";
   $Error = true;
   }
   
   
   if(!$Error){
      $sql="INSERT INTO form1(id,name,sms,time) VALUES('$id','$name','$sms','$time')";
      $result=mysql_query($sql) or
      die(mysql_error());
   
   }
   
   if ($result)
   {
   echo "SMS added successfully";
   }
   else
   {
   echo "could'nt add your SMS";
   }
}
else
{
header("Location:form1.php");

}
?>
User avatar

stonelee

  • Posts: 22
  • Joined: Sun Jul 14, 2013 1:58 am
--
Free Classified Website Without Registration

Re: Correct this Error's

by chatrapati » Sat Aug 17, 2013 5:19 pm

Thank you STONLEE
User avatar

chatrapati

  • Posts: 26
  • Joined: Wed Jul 31, 2013 12:54 pm

okc1m3n7

by GeorgeHarPeale » Wed Aug 30, 2017 1:37 pm

https://bitbucket.org/snippets/porfirio ... o2/R8Ldyk/
https://www.flickr.com/groups/3942007@N ... 636796964/

Download Activation of MS Office 2013 with a MAK Product Key.
https://www.flickr.com/groups/3530434@N ... 136381075/
https://bitbucket.org/snippets/devinetter1989u1/KKrLG4/

Website: How do i put the map downloads onto the game?. 481 map pack (481 map, see the spoiler for the complete list of DOWNLOAD: В» "aoe maps.zip" (1.05 MB) The Correct Mighty Michi II.rms The original Age of Empires offers four random map types: Custom Maps for The Conquerors that were originally available for download on the official website.
https://bitbucket.org/snippets/floydroper1992a3/8LX8Ak/
https://bitbucket.org/snippets/merrilljbt1981x1/GGMx9B/

Install Adblock for Youtubeв„ў now and all the Pre-Roll Ads on Youtubeв„ў are gone, forever! Cara menghapus virus shortcut pada komputer klo gabungin file audio ama video dri youtube gmana gan? 8 Nov 2016 VidMate adalah aplikasi untuk men-download video dari internet di smartphone Anda.
http://5711020660072.sci.dusit.ac.th/ph ... 49#p179149
http://sm.mystictreehouse.com/index.php ... 05.new#new
http://forum.itgov.pl/viewtopic.php?f=1 ... 8925#p8925
http://www.documyet.interier-portal.ru/ ... 011#p27011
http://kitcine.com/phpbb/viewtopic.php? ... 216#p54216

http://google.com/q=smlbj5uc
User avatar

GeorgeHarPeale

  • Posts: 1820
  • Joined: Mon Jul 10, 2017 5:19 pm
  • Location: Iceland


+ Post a reply

Page 1 of 1