Using A Variable as a value in php Header() function using UrlEncode()

I was using an EDIT page where the URL were like http://www.mahmudfaisal.com/edit_page?id=39 after the Submission of form, the page should be reloaded to the same page. so, I took the ID in a session variable: I loved to use URLENCODE() function here. Continue reading Using A Variable as a value in php Header() function using UrlEncode()

localhost error :: connection Failed The system returned: (111) Connection refused

I installed my apache server in my PC, but yet, I couldnt load "localhost" . the error was. I was using Mozilla Firefox and IE both. While trying to retrieve the URL: http://localhost/ The following error was encountered: Connection Failed The system returned: (111) Connection refused Finally the solution I found was interesting! Go to the LAN settings (in Chrome : Tools-> Options-> Under the … Continue reading localhost error :: connection Failed The system returned: (111) Connection refused

You have an error in your SQL syntax; check the manual for the right syntax to use near ‘check

I was working with an SQL syntax today and found an error which was like : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘check) VALUES (‘YES’)’ at line 1 I was trying again and again checking DB connection and fixing other things but the error were not … Continue reading You have an error in your SQL syntax; check the manual for the right syntax to use near ‘check

Opening a pop up window using Javascript

I was in need of a JS function of opening a pop up window. I found a wonderful tutorial about this from Here Here is the Javascript Function for POP UP window named popitup() The interesting part is, the the window.open() function. The arguments of this function are mainly three. First one is URL, second is NAME. and in third one we can put many … Continue reading Opening a pop up window using Javascript

sending php array variable as link to argument of javascript function

I have got a javascript function popitup() which will be used for opening a pop up window. I have PHP Array variable $row_rstest[‘id’] which holds the ID of a data set fetched from database. I have a page named print_data.php. To view the data of this page the url should be like print.data?id=12 I have taken this in variable $url. Then passed this $url in … Continue reading sending php array variable as link to argument of javascript function

Names of Images Saved in PHP Server Root Are Case Sensitive

I used some images in my PHP scripts. I typed the perfect names of images (eg chair.jpg) in my PHP script. Though in my web root directory, the images are stored by the same name, in output, I didn’t find the images. Later I found that, the image was named like “checked.PNG” in my web root. But in my program, it was “checked.png”. For having … Continue reading Names of Images Saved in PHP Server Root Are Case Sensitive

Inserting form variables into mysql database query string

I was working with a form where I need to insert some form variables in my MySQL database. Inserting data into database is not any problematic issue. But as I had to insert dynamic data contained by the form variables, I faced a little problem. The solution is very very simple! 🙂 the most important thing is — putting the dot(.) and double quotation(“) and … Continue reading Inserting form variables into mysql database query string

Comparing date type variables as form inputs in PHP

I was working with a search module where I needed to work upon the user “date” inputs. The form inputs of dates were string type like “2011-05-06”. I had to confirm few things:
— if both of the input fields [said as $var6 and $var7] are blank or not.
— if first one [$var6] is filled only
— if second date [$var7] is filled only
— user can give two dates in any order. BUT MYSQL ‘BETWEEN’ command [which I used to compare two dates] expects the first argument as early number and second one as big number. so I had to swap two numbers in proper order
here goes some additional needless info,
$var6 = @$_GET[‘date_1’] ;
$var7 = @$_GET[‘date_2’] ;
$wh = “WHERE”; //initializing variable
$cond6 = “”; // initializing variable
Continue reading “Comparing date type variables as form inputs in PHP”