a php functions library that helps you to write code effieciently, it helps you perform database operations, validation, tracking user and some other cool stuff by just calling functions.
- clone the repository.
- copy it somewhere inside your application.
- include rapid.php in your application's root or wherever you want to call methods.
- π sendMail(smtpHost, smtpPort, smtpEmail, smtpPassword, smtpProtocol, smtpFrom, recipient,isHTML, subject, message)
- π uploadFile(file, directory, maxSize)
- trackIP(ip)
- getOS()
- getBrowser()
- insertData(table, fields, values, conn)
- fetchData(table, conn)
- fetchDataById(table, PrimaryKey, id, conn)
- deleteDataById(table, PrimaryKey, id, conn)
- editData(table, data, PrimaryKey, id, conn)
- π verifyValues(table, data, conn)
- checkExistance(table, column_name, value, conn)
- getLastRow(table, PrimaryKey, conn)
- verifyValues(table, data, conn)
- verify_email(email)
- verify_phone(phone_number)
- validateDate(date, seperator)
- validatePassword(password)
- validateUsername(username)
- validatePlainText(plainText)
- validateAlphanumeric(alphanumeric)
- validateEmail(email)
- π estimate_gender(name)
- clean_text(string)
- random_strings(length_of_string)
- getNextDays(number_of_days)
- calcMonths(start_date, end_date)
- getHeader(pageName, headerPath)
- getFooter(footerPath)
- redirectWindow(url)
- showAlert(msg)
- generateInsult()
- generateAdvice()
- generateQuote()
uploads file for now it only support .jpg, .png, .jpeg, .gif files
uploadFile(
$_File['image'],
'/assets/imges',
1000
);
sends email using PHPMailer
sendMail(
'your smtp host',
'your port',
'your smtp email',
'your smtp password',
'your smtp protocol',
'your sender name',
'your recipent email',
true,
'Send Mail',
'your message'
);
verifies values from a specific table by writing mysql query
verifyValues(
"table_name",
array(
"field_name",
"column_name",
"field_name",
"column_name"
)
$conn
);
tracks user's ip address and retrieves information out of it
trackIP('168.212. 226.204')
gets user's operating system
getOS()
gets user's browser name
getBrowser()
verifies phone number and retreives some information out of it
verify_email("13654008480")
verifies if email is true and valid without sending a mail
verify_email("[email protected]")
estimates a gender from a first name
estimate_gender("Shehzad")
this method wont return any value it will just insert the data.
insertData(
"table_name",
array(
"column1_name",
"column2_name"
),
array(
"value1",
"value2"
),
$connection
);
this method will return mysqli_query result, you can handle it that way.
fetchData(
"table_name",
$connection
);
this method will return mysqli_query result, you can handle it that way.
fetchDataById(
"table_name",
"primary_key_column_name",
$primary_key_value,
$connection
);
this method wont return any value it will just insert the data.
deleteDataById(
"table_name",
"primary_key_column_name",
$primary_key_value,
$connection
);
this method wont return any value it will just insert the data.
editData(
"table_name",
array(
"column_name",
"value",
"column_name",
"value"
),
"primary_key_column_name",
$primary_key_value,
$connection
);
this method verifies values from a specific table by writing mysql query
verifyValues(
"table_name",
array(
"column_name",
"value",
"column_name",
"value"
),
$connection
)
this method will return true if the value exists or else it will return false.
checkExistance(
"table_name",
"column_name",
"value",
$connection
);
this method will return mysqli_query result, you can handle it that way.
getLastRow(
"table_name",
"primary_key_column_name",
$connection
);
this method will return true if the provided date is correct or else it wil return false.
validateDate(
"2020-02-20",
"-"
);
this method will check if the password's length is between 8 to 32 and furthur it will check if the password matches at least three of four scenarios which are 1) have at least one symbol 2) have at least one small letter 3) have at least one capital letter 4) have at least one number or else it will return false.
validatePassword(
"input"
);
this method will check username according to twitter and instagram standard usernames if the username is correct this will return true or else it will return false.
validateUsername(
"input"
);
this method will return true if the input is plain text or else it will return false.
validatePlainText(
"input"
);
this method will return true if the input is alphanumeric or else it will return false.
validateAlphanumeric(
"input"
);
this method will return true if the input is correct email or else it will return false.
validateEmail(
"input"
);
this method will remove any useless white spaces in text and make the text clean.
clean_text(
"input"
);
this method will generate random string with combination of caps and small letters and digits of provided length.
random_strings(20);
this method will return complete dates of number of days provided after todays date in array.
getNextDays(10);
this method will count months between two days.
calcMonths("date1", "date2");
this method will buffer page name and header everytime the page reloads.
getHeader("any page name", "header file path");
this method will load footer file.
getFooter("footer file path");
this method will redirect pages with javascript.
redirectWindow("url");
this method will show alerts with javascript.
showAlert("some text");
this method generates random evil insult in english
generateInsult();
this method generates random advice in english
generateAdvice();
this method generates random quote in english
generateQuote();