How To Make Generate Email Lists Tool Using PHP Language

in #utopian-io7 years ago (edited)

What Will I Learn?

  • You will make many of email lists with ease
  • You will learn PHP generate function
  • You will learn PHP looping and branching function

Requirements

  • Basic Knowledge about HTML
  • Basic Knowledge about PHP
  • Already installed XAMPP on your computer

Difficulty

  • Basic

Tutorial Contents

On this tutorial I want to teach you how make tool generate email lists using php language. But first you must install xampp on your computer for runed a php language, if you alredy installed xampp now you can open notepad++ or else which is a text editor application.
write this code on your notepad and save with name index.html.

HTML Source:

<html>

<form action="email.php" Method="post">

Name : <input type="text" name="aa"><br><br>

Email : <input type="text" name="bb"><br><br>

Domain : <input type="text" name="cc"><br><br>

Limit : <input type="text" name="dd"><br><br>

Without Underscore<br><br>

<Input type = "Radio" Name ="ko" value= "number" checked> Numbering<br>

<Input type = "Radio" Name ="ko" value= "alph"> Alphabet<br>

<Input type = "Radio" Name ="ko" value= "All"> All<br><br><br>

With Underscore<br><br>

<Input type = "Radio" Name ="ko" value= "undernum"> Numbering <br&gr>
<Input type = "Radio" Name ="ko" value= "rand"> Auto Increment <br>

<Input type = "Radio" Name ="ko" value= "underalp"> Alphabet<br>

<Input type = "Radio" Name ="ko" value= "under"> All
<br><br>

<Input type = "Submit" Name = "Submit1" value = "Generate!">

</form>

</html>

HTML Output:

image.png

Explanation of HTML Code:

at this code is tag to create a form

<form action="email.php" Method="post">

which will be processed on file email.php.
for option of generates you can make on this tag

<Input type = "Radio" Name ="ko" value= "number" checked> Numbering<br>.

that option to generate email lists with numbering. if this tag to option ganerate email list with alphabet.

<Input type = "Radio" Name ="ko" value= "alph"> Alphabet<br>
and etc

to make a button on HTML you can use this tag

<Input type = "Submit" Name = "Submit1" value = "Generate!">

okay if you already writed now you must write file PHP to process this tool
open new file to write this source and save with name email.php
copy this source

Source PHP:

<?php

for ($x = 0; $x < $_POST['dd']; $x++) {

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

$selected_radio = $_POST['ko'];

if ($selected_radio == 'number') {

$str = '0123456789';

$shuffled = substr(str_shuffle($str),7);

$a = $_POST['aa'];

$b = $_POST['bb'];

$c = $_POST['cc'];

echo "<b>$a</b>$shuffled@$b.$c<br>";

> }

else if ($selected_radio == 'alph') {

$br = 'abcdefghijklmnopqrstuvwxyz';

$bt = substr(str_shuffle($br),23);

$e = $_POST['aa'];

$f = $_POST['bb'];

$g = $_POST['cc'];

echo "<b>$e</b>$bt@$f.$g<br>";

}

else if ($selected_radio == 'All') {

$be = '0123456789abcdefghijklmnopqrstuvwxyz';

> $bw = substr(str_shuffle($be),30);

$h = $_POST['aa'];

$i = $_POST['bb'];

$j = $_POST['cc'];

echo "<b>$h</b>$bw@$i.$j<br>";

}

else if ($selected_radio == 'undernum') {

$bu = '0123456789';

$bi = substr(str_shuffle($bu),7);

$k = $_POST['aa'];

$l = $_POST['bb'];

$m = $POST['cc'];

echo "<b>$k</b>
$bi@$l.$m<br>";

}

else if ($selected_radio == 'underalp') {

$bu = 'abcdefghijklmnopqrstuvwxyz';

$bi = substr(str_shuffle($bu),23);

$k = $_POST['aa'];

$l = $_POST['bb'];

$m = $POST['cc'];

echo "<b>$k</b>
$bi@$l.$m<br>";

}

else if ($selected_radio == 'under') {

$bu = '0123456789abcdefghijklmnopqrstuvwxyz';

$bi = substr(str_shuffle($bu),30);

$k = $_POST['aa'];

$l = $_POST['bb'];

$m = $POST['cc'];

echo "<b>$k</b>
$bi@$l.$m<br>";

}

else if ($selected_radio == 'rand') {

$aa = $_POST['aa'];

$bb = $_POST['bb'];

$cc = $_POST['cc'];

echo "$aa". (rand(1,1000) ."@$bb.$cc<br>");

}

}

}

?>

Explanation of PHP Code:

this code to looping on php
for ($x = 0; $x < $_POST['dd']; $x++) {
$_POST['dd']; on this command to get data from html form named dd to limit email list loop.

this code to selection of processes using php branching

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

if button generate! pressed on HTML output its will work to proses based on the menu options used.
exempel if you use the option menu using numbering, tool will process on this code.

$selected_radio = $_POST['ko'];

if ($selected_radio == 'number') {

$str = '0123456789';

$shuffled = substr(str_shuffle($str),7);

$a = $_POST['aa'];

$b = $_POST['bb'];

$c = $_POST['cc'];

echo "<b>$a</b>$shuffled@$b.$c<br>";



variable $selected_radio for save data from HTML code named ko, and variable $str for saved data list number from 0 to 9 which will be input on email.
command substr on variable $shuffled will make random number on email like [email protected].
variable $a to saved data name from html
variable $b to saved data email from html
variable $c to saved data domain from html

this command to show your output
echo "<b>$a</b>$shuffled@$b.$c<br>";

okay now I want to show how to use this tool.

  • First you must fill on all forms in the html view and click on the random selection menu and click generate!

    image.png
  • Then you get your email lists

    image.png

    Now you can make email lists with one click,huh?
    okay until now I teach you about PHP generate function. and I wanna to say thanks for your attention and thanks for read this tutorial sorry if I'm wrong on this tutorial :)



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @farahulfa I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Excellent contribution for those who work with html.