Friday, 21 February 2014
Sunday, 3 November 2013
localhost is not working in Xampp after updating Avast
Open Avast
1) Go to "Settings"
2) Go to "Troubleshooting"
3) Expand "Redirect Settings"
4) Under "WEB" look for ignored address
5) Add localhost
6) Open browser and visit your localhost page.
1) Go to "Settings"
2) Go to "Troubleshooting"
3) Expand "Redirect Settings"
4) Under "WEB" look for ignored address
5) Add localhost
6) Open browser and visit your localhost page.
Sunday, 27 October 2013
Keep checkbox checked after submit refresh in PHP
Below code maintain checkbox value when user click preview button
<?php
if (isset($_POST['number']))
{
foreach ($_POST['number'] as $selectednumber)
$selected[$selectednumber] = "checked";
}
?>
<form action="" method="post">
<input type="checkbox" name="number[]" <?php echo $selected['one'] ?> value="one" />one<br />
<input type="checkbox" name="number[]" <?php echo $selected['two'] ?> value="two" />two<br />
<input type="checkbox" name="number[]" <?php echo $selected['three'] ?> value="three" />three<br />
<input type="checkbox" name="number[]" <?php echo $selected['four'] ?> value="four" />four<br />
<input type="submit" name="Submit" value="Preview" />
</form>
<?php
if (isset($_POST['number']))
{
foreach ($_POST['number'] as $selectednumber)
$selected[$selectednumber] = "checked";
}
?>
<form action="" method="post">
<input type="checkbox" name="number[]" <?php echo $selected['one'] ?> value="one" />one<br />
<input type="checkbox" name="number[]" <?php echo $selected['two'] ?> value="two" />two<br />
<input type="checkbox" name="number[]" <?php echo $selected['three'] ?> value="three" />three<br />
<input type="checkbox" name="number[]" <?php echo $selected['four'] ?> value="four" />four<br />
<input type="submit" name="Submit" value="Preview" />
</form>
Friday, 25 October 2013
Multiple submit button in a single form in PHP
<form method="post">
<input type="submit" name="save" value="Submit 1">
<input type="submit" name="cancel" value="Submit 2">
</form>
<?php
if (isset($_POST['save'])) {
// code
}
else if (isset($_POST['cancel'])) {
// code
}
?>
<input type="submit" name="save" value="Submit 1">
<input type="submit" name="cancel" value="Submit 2">
</form>
<?php
if (isset($_POST['save'])) {
// code
}
else if (isset($_POST['cancel'])) {
// code
}
?>
Thursday, 24 October 2013
Installing the Java Plugin for Firefox on CentOS
The OpenJDK bundled with CentOS is missing a java plugin for Firefox. A simple method of getting Java to run inside the webbrowser and to run java applications is to install icedtea-web
Open a terminal and type the below command
yum install icedtea-web
Then restart your browser
Click Tools- >Add-ons
The Add-ons Manager tab will open.
In the Add-ons Manager tab, select Plugins
Click icedtea-web plugin to select it and click on the Enable button
The java verification applet (http://www.javatester.org/version.html) works fine.
Open a terminal and type the below command
yum install icedtea-web
Then restart your browser
Click Tools- >Add-ons
The Add-ons Manager tab will open.
In the Add-ons Manager tab, select Plugins
Click icedtea-web plugin to select it and click on the Enable button
The java verification applet (http://www.javatester.org/version.html) works fine.
Installing and configuring Java in cent OS
Most of the Linux operating systems comes with pre-installed OpenJDK package to run java-based applications and plugins.But in certain cases we need Sun/Oracle Java program to compile and run
particular development applications.
1. Download java from
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. install java using rpm -uvh
## Install Java on 32-Bit OS ##
# rpm -Uvh jdk-7u45-linux-i586.rpm
# rpm -Uvh jdk-7u45-linux-i586.rpm
## Install Java on 64-Bit OS ##
# rpm -Uvh jdk-7u45-linux-x64.rpm
# rpm -Uvh jdk-7u45-linux-x64.rpm
3. check java installed
# java -version
output should be
java version "1.7.0_45"
4. Setting up java environment variables
The easiest way to set an environment variable in CentOS is to use export as in
$> export JAVA_HOME=/usr/java/jdk.1.7.0_45
$> export PATH=$PATH:$JAVA_HOME
However, variables will disappear the moment you exit the shell. Obviously this is not helpful when setting environment variables that need to persist even when the system reboots.In such cases, you need to set the variables within the system wide profile. In CentOS , the folder /etc/profile.d/ is the recommended place to add customizations to the system profile.
5. Create a new file called java.sh
vim /etc/profile.d/java.sh
6. Copy paste the below content in java.sh
export JRE_HOME=/usr/java/jdk.1.7.0_45/jre
export PATH=$PATH:$JRE_HOME/bin
export JAVA_HOME=/usr/java/jdk.1.7.0_45
export JAVA_PATH=$JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
7. If you want to load the environment variables within java.sh without having to restart the machine, you can use the source command as in:
$> source java.sh
particular development applications.
1. Download java from
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. install java using rpm -uvh
## Install Java on 32-Bit OS ##
# rpm -Uvh jdk-7u45-linux-i586.rpm
# rpm -Uvh jdk-7u45-linux-i586.rpm
## Install Java on 64-Bit OS ##
# rpm -Uvh jdk-7u45-linux-x64.rpm
# rpm -Uvh jdk-7u45-linux-x64.rpm
3. check java installed
# java -version
output should be
java version "1.7.0_45"
4. Setting up java environment variables
The easiest way to set an environment variable in CentOS is to use export as in
$> export JAVA_HOME=/usr/java/jdk.1.7.0_45
$> export PATH=$PATH:$JAVA_HOME
However, variables will disappear the moment you exit the shell. Obviously this is not helpful when setting environment variables that need to persist even when the system reboots.In such cases, you need to set the variables within the system wide profile. In CentOS , the folder /etc/profile.d/ is the recommended place to add customizations to the system profile.
5. Create a new file called java.sh
vim /etc/profile.d/java.sh
6. Copy paste the below content in java.sh
export JRE_HOME=/usr/java/jdk.1.7.0_45/jre
export PATH=$PATH:$JRE_HOME/bin
export JAVA_HOME=/usr/java/jdk.1.7.0_45
export JAVA_PATH=$JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
7. If you want to load the environment variables within java.sh without having to restart the machine, you can use the source command as in:
$> source java.sh
Subscribe to:
Posts (Atom)