Upload
scci-cu
View
53
Download
2
Embed Size (px)
Citation preview
<body><p id=“SCCI">Seek the peak</p><script>document.getElementById(“SCCI").innerHTML = “Be your own hero";</script></body>
Changing HTML Elements using JS
Pop up codefunction div_show() {document.getElementById(‘id').style.display = "block";}function div_hide(){document.getElementById(‘id').style.display = "none";}
Validation in JSfunction check_empty() {if (document.getElementById('name').value == "" || document.getElementById('email').value == "" || document.getElementById('msg').value == "") {alert("Fill All Fields !");} else {document.getElementById('form').submit();alert("Form Submitted Successfully...");}}
How to connect to a DATABASE?
<?php $conn = mysqli_connect("localhost", "root", "", "devology");if (!$conn) { die("Connection failed: " . mysqli_connect_error());}?>
<?php$sql = "INSERT INTO teams(user_name, password, email, phone_number)VALUES (‘AssemSalem', 'Devology', ‘[email protected]‘, ‘01116877970')";$result = mysqli_query($conn, $sql);?>
INSERTSELECT
<?php$sql = "UPDATE teams SET user_name=‘MahmoudBahaa' WHERE password= 'Devology' ";$result = mysqli_query($conn, $sql);?>
INSERTSELECT UPDATE
<?php$sql = "DELETE FROM teams WHERE user_name= ‘AssemSalem' ";$result = mysqli_query($conn, $sql);?>
INSERTSELECT UPDATE DELETE