NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

editing.php

<?php

include('check.php');


if(isset($_POST['Submit']))
{
$exist = mysqli_query($con, "select name from tuition where name='".$_POST['name']."' && id<>$_GET[id]");
$result= mysqli_num_rows($exist);

if($result > 0)
{
echo " name already exists";
}
else
{

$updt = "update tuition set
name = '".$_POST['name']."',
gender = '".$_POST['gender']."',
email_id = '".$_POST['email_id']."',
phone_no = '".$_POST['phone_no']."',
subjects = '".implode(',',$_POST['subjects'])."',
website = '".$_POST['website']."'
where id = '".$_GET['id']."'";

if(mysqli_query($con, $updt))
{
echo "Data Inserted";
('Location: listing.php');
}
else{
echo "Error" . mysqli_error($con);
}
}
}

$qry= "select name, gender, email_id, phone_no, subjects, website from tuition where id=$_GET[id]";
$result= mysqli_query($con, $qry);
$row= mysqli_fetch_array($result);

$subjects= explode(',',$row['subjects']);
?>

<form action="" method="POST">
<fieldset style= "width:100%; text-align:center;">
<!--<p id="msg"></p>-->
<b>Name</b>
<input type="text" name="name" id="name" value="<?php echo $row["name"]?>"><br><br>

<b>Gender</b>
<input type="radio" name="gender" value="1" <?php echo $row['gender'] === '1' ? 'checked="checked"':'' ?>/>Male
<input type="radio" name="gender" value="2" <?php echo $row['gender'] === '2' ? 'checked="checked"':'' ?>/>Female<br><br>

<b>Email Id</b>
<input type="text" name="email_id" id="email_id" value="<?php echo $row["email_id"]?>"><br><br>

<b>Contact No.</b>
<input type="int=15" name="phone_no" id="phone_no" value="<?php echo $row["phone_no"]?>"><br><br>

<b>Subjects</b>
<input type="checkbox" name="subjects[]" value="1" <?php if(in_array("1",$subjects)) { echo "checked='checked'";} ?>/>Physics</option>
<input type="checkbox" name="subjects[]" value="2" <?php if(in_array("2",$subjects)) { echo "checked='checked'";} ?>/>Chemistry</option>
<input type="checkbox" name="subjects[]" value="3" <?php if(in_array("3",$subjects)) { echo "checked='checked'";} ?>/>Biology</option>
<input type="checkbox" name="subjects[]" value="4" <?php if(in_array("4",$subjects)) { echo "checked='checked'";} ?>/>Maths</option><br><br><br>

<b>Website</b>
<input type="text" name="website" id="website" value="<?php echo $row["website"]?>"><br><br><br>

<input type="submit" name="Submit" id="btnSubmit" value="Submit"><br><br>

</fieldset>
</form>

<script src="jquery.min.js"></script>
<script>

$(function(){
$('#btnSubmit').click(function(){
var email = $('#email_id').val();
if ($.trim(email).length == 0 || $("#name").val()=="" || $("#phone_no").val()=="" || $("#website").val()=="")
{
alert('All fields are mandatory');
return false;
}
if (!validateEmail(email))
{
alert('valid Email Address');
return false;
}

});
});

function validateEmail(email) {
var filter = /^[w-.+]+@[a-zA-Z0-9.-]+.[a-zA-z0-9]{2,4}$/;
if (filter.test(email)) {
return true;
}
else {
return false;
}
}

$(function(){
$("#Submit").click(function() {
var name= $("name").val();
var gender= $("#gender").val();
var email_id= $("#email_id").val();
var phone_no= $("#phone_no").val();
var subjects= $("#subjects").val();
var website= $("#website").val();
});
});

</script>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.