How to include other PHP file in your current file You can use the content from one PHP file to another. Include("filename.php"); Here filename.php is present on the same path as the file in which you are currently working. ...
phpsupport | phpsupportdesk Latest Articles
Constants
pHpSupportConstants This returns the value of the constant. Constant in PHP can be declared by using keyword “define” Eg. define(“MAXLENGTH”, “100”); CODE <?php define(“MAXLENGTH”, “100”); echo MAXLENGTH; ?> OUTPUT We can define the constants in the config file of the ...
Time Functions
pHpSupportStrtotime It converts the date into unix time stamp format. <?php echo $dateTime=strtotime(“13-02-2016”); ?> OUTPUT To add no. of days in current date <?php $currDate = date(‘Y-m-d’) ; // 2016-04-02 $dateTime=strtotime(“$currDate + 5 days”); echo date(“Y-m-d”, $dateTime); ?> OUTPUT You ...
Date
pHpSupportTO DISPLAY THE CURRENT DATE <?php $current_date = date("Y-m-d"); echo $current_date; ?> OUTPUT If you want to show current date with Hours, Minutes and Seconds. Then try the following code. <?php $current_date = date("Y-m-d H:i:s"); echo $current_date; ?> OUTPUT If ...
Echo & Print
pHpSupportTwo basic ways to get output in PHP are Echo and Print. Echo and Print are most likely same. Both are used to output data to the screen. But Echo is faster than Print. To print some value in PHP ...
PHP Introduction
pHpSupportPHP Introduction :- Earlier PHP comes out to be a small open source project. More and more people found it useful. The first version of PHP was unleashed in 1994 by Rasmuslerdorf. PHP in itself is recursive acronym for “PHP: ...
How to use Ajax using jQuery in PHP?
pHpSupportHow to use Ajax using jQuery in PHP? Firstly, you have to include the <script src=”https://code.jquery.com/jquery-1.12.0.min.js”></script> before </head> Or use the latest jQuery version as required. Then, use the main content of the page as below code: <div id=”content”> <ul> ...
How to get the list of file names in a folder in PHP?
pHpSupportIn PHP5, PHP7 it is easier to find the name of files. We are having the function using which we can find the names of the files under a specific folder. You can use the: <?php $dir = ‘C:/xampp/htdocs/phpSupport/questions/doctopdf/’; ...
How to integrate Paypal Payment Gate way?
pHpSupportFor simple PayPal integration we just have to send the user to the PayPal site with the required information to process the order. Here is the code to use that it in a simple manner. First of all you have ...
How to produce forget password recovery method with PHP?
pHpSupportHere we need to create two pages connect.php forgotpassword.php file 1:-connect.php <?php $connection = mysql_connect(‘localhost’, ‘root’, ”); if (!$connection){ die(“Database Connection Failed” . mysql_error()); } $select_db = mysql_select_db(‘test’); if (!$select_db){ die(“Database Selection Failed” . mysql_error()); } file 2:- forgotpassword.php <?php ...
Easy way to make login page in PHP
pHpSupportMost easy way to make login page in PHP:- <?php define(‘DB_HOST’,’localhost’); define(‘DB_NAME’,’logina’); define(‘DB_USER’,’root’); define(‘DB_PASSWORD’,”); $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD)or die(“Failed to connect to MySql:”.mysql_error()); $db=mysql_select_db(DB_NAME,$con)or die(“Failed to connect to MySQL:”.mysql_error()); function SignIn($username, $password) { if(!empty($username)) { $query=mysql_query(“SELECT *FROM username where userName=’$username’AND pass=’$password’”)or die(mysql_error()); $row=mysql_fetch_array($query) ...
Send attachment in PHP mail function
pHpSupportIn this post you will learn how to send doc attachment, pdf attachment any file attached in your php email. You can send a file through php mail function using HTML form in PHP. Firstly you have to create simple ...
How to upload zip file in php?
pHpSupportIn this post you will learn how to upload zip file into a folder using HTML form in PHP. Firstly you have to create simple HTML form. HTML Code <form action=“upload.php” enctype=“multipart/form-data” method=”post”> <input type=“file” name=“zipFile” accept=“zip/*”> <input type=“submit” name=“Submit” ...
How can we check current date & time of PHP server?
pHpSupportWe can check the PHP server time by using the following code date(“Y-m-d H:i:s”);
Where can we find the header and footer (phtml) files in Magento?
pHpSupportOnce you have got the complicated structure of MAGENTO, you can easily add content blocks within the desired place of the website.For this purpose we have to deal with header and footer files. Here is the brief description of the ...