How to copy a file from one directory to another using PHP?
-
zendnwar
-
March 18, 2013
-
PHP Basic
-
0 Comments
This should be pretty easy. You want to copy & rename images that already exist on the server while still retaining the original image. Here’s the original image location: images/ folder/ your_image_name.jpg This is what I want: images/ folder/ your_image_name.jpg your_image_new_name.jpg <?php $file = ‘images/folder/your_image_name.jpg’; $newfile = ‘Images/folder/your_image_new_name.jpg’; if (!copy($file, $newfile)) { echo “failed to copy”; } Hope it will …
Continue Reading
Deprecated: Function set_magic_quotes_runtime()
-
zendnwar
-
January 31, 2013
-
PHP Basic
-
234 Comments
Open the “include/config.php” find: set_magic_quotes_runtime(0); replace: ini_set(“magic_quotes_runtime”, 0); Hope it will work.
Continue Reading
Error Reporting Directives in php.ini
-
zendnwar
-
December 14, 2012
-
PHP Basic
-
0 Comments
Error Reporting Directives in php.ini To diagnose bugs in your code, you should enable the directive that allows error messages to be written to the browser. This is on by default. display_errors = On You can also set the level of error reporting. For working through this book, you should set this to the following: error_reporting = E_ALL & ~ …
Continue Reading
New Functions in php5
-
zendnwar
-
December 13, 2012
-
PHP Basic
-
0 Comments
New Functions in php5 PHP 5 there are some new functions. Which are given below: Arrays: array_combine() – Creates an array by using one array for keys and another for its values array_diff_uassoc() – Computes the difference of arrays with additional index check which is performed by a user supplied callback function array_udiff() – Computes the difference of arrays by …
Continue Reading
Website Development by PHP Basics,HTML,CSS,Javascript & Joomla 2.5
-
zendnwar
-
December 13, 2012
-
Others, PHP Basic
-
1 Comment
In this PHP course, you will learn Basic level PHP programming and how to execute scripts on your server. You will also learn about MySQL, HTML, CSS, and JavaScript. Advanced level CSS, Database & Relation of Database will also be discussed in the sessions. After completing the training, participants are expected to develop projects using PHP with MySQL. Joomla! is …
Continue Reading
Function ereg_replace() is deprecated
-
zendnwar
-
August 31, 2012
-
PHP Basic
-
0 Comments
Function ereg_replace() is deprecated : Example : print $input.”<hr>”.ereg_replace(‘/&/’, ‘:::’, $input); Replace print $input.”<hr>”.preg_replace(‘/&/’, ‘:::’, $input); Another example : $anwar = ereg_replace(‘^A-Za-z0-9_’, ”, $ anwar ); Replace to $ anwar = preg_replace(‘/^A-Za-z0-9_/’, ”, $ anwar );
Continue Reading
How to minus in array php code
-
zendnwar
-
August 13, 2012
-
PHP Basic
-
0 Comments
How to minus in array php code $A = array(5,10,10); $B = array(1,1,1); $a=array(); for($i=0; $i<=2; $i++){ $a$i= $A$i- $B$i; echo”<br>”.$a$i; } Output: 4 9 9
Continue Reading
Regular Expression Basic Tutorial
-
zendnwar
-
July 27, 2012
-
PHP Basic
-
0 Comments
Characters Character Description Example Any character except \^$.|?*+() All characters except the listed special characters match a single instance of themselves. { and } are literal characters, unless they’re part of a valid regular expression token (e.g. the {n} quantifier). a matches a \ (backslash) followed by any of \^$.|?*+(){} A backslash escapes special characters to suppress their special meaning. …
Continue Reading
Regular Expressions Examples
-
zendnwar
-
July 27, 2012
-
PHP Basic
-
0 Comments
Regular Expressions Examples Regular Expressions for Username Pattern : /^a-z0-9_-{3,16}$/ Description: The beginning of the string (^), followed by any lowercase letter (a-z), number (0-9), an underscore, or a hyphen. Next, {3,16} makes sure that are at least 3 of those characters, but no more than 16. And last, the end of the string ($). Matches: an-wa3r_t5h3 Doesn’t match: dgdgd1-www_78chfdhgvsfdsaas …
Continue Reading
How to connect php and oracle database?
-
zendnwar
-
July 26, 2012
-
PHP Basic
-
0 Comments
oci_connect : Connect to an Oracle database. oci_connect ( string $username , string $password , string $connection_string , string $character_set , int $session_mode ) To create a connection to Oracle that can be used for the lifetime of the PHP script, perform the following steps. <?php // Create connection to Oracle $conn = oci_connect(“phphol”, “welcome”, “//localhost/orcl”); if (!$conn) { …
Continue Reading