Spying on your local network with wireshark, ($_POST is not as safe as you think)
Open wireshark Submitt the form Find the packet in wireshark. There You go!
Open wireshark Submitt the form Find the packet in wireshark. There You go!
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 […]
$string = “hello”; for ($i = 0; $i < strlen($string); $i++) { echo $string[$i]. ‘ ‘ ; } outputs: h e l l o
Counting long strings in PHP
Here is a way to submit and process multiple values in PHP. Just like this program: https://htmlbylearning.wordpress.com/2021/08/17/your-own-php-get-form/ But with multiple values. <?php if (isset($_POST[‘lunch’])) //is the var submitted { print “<ol>”; foreach ($_POST[‘lunch’] as $choice) //for each value in array { echo “<li>”; print “You want a $choice bun.<br/>”; echo “</li>”; } }else{ //if no […]
#!/bin/bash
if [ “$(whoami)” != ‘root’ ]; then
echo “You are not root!”
echo “You are $(whoami)”
exit1;
fi
Here is the source code for my inventory application. It’s made for kitchen inventory but can be used for any kind of inventory. https://github.com/Dummeswe/pantry
function make_div($color,$width = ’25’,$height=’25’)
{ print ‘divs’ .
‘ div {background-color:’ . $color . ‘;’ .
‘width:’ . $width . ‘;’ .
‘height’ . $height . ‘;’ .
”;
print ”; print ”; print ‘
‘; print ”;}
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 […]
Want to make more money?
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() //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
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”);}
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: […]
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 […]