Become a Hacker with xss(cross-site-scripting)

Here is the php file. <?php 2 //logic to do the right thing based on the request method 3 if ($_SERVER[‘REQUEST_METHOD’] == ‘POST’) 4 { 5 process_form(); 6 } else{ 7 show_form(); 8 } 9 10 //do Something when the form is submitted 11 function process_form() 12 { 13 print “hello” . $_POST[‘my_name’]; //this is […]

function to make div

function make_div($color,$width = ’25’,$height=’25’)
{ print ‘divs’ .
‘ div {background-color:’ . $color . ‘;’ .
‘width:’ . $width . ‘;’ .
‘height’ . $height . ‘;’ .
”;
print ”; print ”; print ‘

Hello World

‘; print ”;}

Beginning Ajax Chapter2

Ajax bases server requessts is quite simple. Create XMLHttpRequest Validate that is has been created Point it where it will go And then send it Server Response HTTP Codes 200 OK = File found and served 304 Not Modified = THe browser has a cahed copy and it is = to servers copy 401 Unauthorized […]

Flexbox Layout, text and hypnotoad

Let’s Create This. First create the index.html file <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Lizard with text</title> <link rel=”stylesheet” href=”style.css”> </head> <body> <div class=”wrapper”> //this is the flex container <div id=”text_div”> //A flex item <h2>Draw Now!</h2> <p>Each Lesson is 30 minutes Long</p> <p>The Goal is to teach […]

str_replace()

//str_replace() //replace all occurensec of a search string with a replacement ‘ ‘ . “The lord of the rings” . ““; $some_string = “You cannot say Sauron, or mordor, or nazgul, if you do, you won’t”; $forbidden_words = array(‘Sauron’,’mordor’,’nazgul’);echo str_replace($forbidden_words,’Hobbits’,$some_string); OUTPUT: You cannot say Hobbits, or Hobbits, or Hobbits, if you do, you won’t

Validate Emails with PHP and html-forms…

First the form form method =”post” action=”validate_email.php”> <label for=”input_email”>Enter Your Email:</label> <input type=”email” name=”input_email”> <input type=”submit” value=”Validate”> </form> And now the php script. if (‘POST’ == $_SERVER[‘REQUEST_METHOD’]){$email = $_POST[‘input_email’]; //sanitize this(htmlspecialchars…etc}else{echo “Error”;} if (filter_var($email,FILTER_VALIDATE_EMAIL)){echo (“$email is a valid email address”);} else{echo (“$email is not a valid email address”);}

Finally finished my first website:

It’s finally here, nothing advanced, just a simple page that lets you create a food menu for the week. You can use translate it if you need to but i think it’s pretty simple for anyone to understand. Just enter the form then press the big green button to print it. Here is the address: […]

Learning javascript

I decided it was time to learn javascript and got the book eloquent javascript by Written by Marijn Haverbeke. /Link here It’s a book where everything is explained in detail. I’m gonna walk throught it as fast as i can and see if i can build something useful. Learning js would also be a requirement […]