Thursday, February 26, 2015

Islam in Europe

Germany will become Islamic State, says Chancellor Merkel

by Paul Williams, PhD
Source: Muslim Village

Filed under: Europe,News | 
Dec 30 2010
Chancellor Angela Merkel said that Germans have failed to grasp how Muslim immigration has transformed their country and will have to come to terms with more mosques than churches throughout the countryside, according to the Frankfurter Allgemeine Zeitung daily.
“Our country is going to carry on changing, and integration is also a task for the society taking up the task of dealing with immigrants,” Ms. Merkel told the daily newspaper. “For years we’ve been deceiving ourselves about this. Mosques, for example, are going to be a more prominent part of our cities than they were before.”
Germany, with a population of 4-5 million Muslims, has been divided in recent weeks by a debate over remarks by the Bundesbank’s Thilo Sarrazin, who argued Turkish and Arab immigrants were failing to integrate and were swamping Germany with a higher birth rate.
The Chancellor’s remarks represent the first official acknowledgement that Germany, like other European countries, is destined to become a stronghold of Islam. She has admitted that the country will soon become a stronghold.
In France, 30% of children age 20 years and below are Muslims. The ratio in Paris and Marseille has soared to 45%. In southern France, there are more mosques than churches.
The situation within the United Kingdom is not much different. In the last 30 years, the Muslim population there has climbed from 82,000 to 2.5 million. Presently, there are over 1000 mosques throughout Great Britain – – many of which were converted from churches.
In Belgium, 50% of the newborns are Muslims and reportedly its Islamic population hovers around 25%. A similar statistic holds true for The Netherlands.
It’s the same story in Russia where one in five inhabitants is a Muslim.
Muammar Gaddafi recently stated that “There are signs that Allah will grant victory to Islam in Europe without sword, without gun, without conquest. We don’t need terrorists; we don’t need homicide bombers. The 50 plus million Muslims (in Europe) will turn it into the Muslim Continent within a few decades.”
The numbers support him.

http://muslimvillage.com/2010/12/30/8023/germany-will-become-islamic-state-says-chancellor-merkel/#.VO6JfL2oppX.facebook

Ontology Quran

http://corpus.quran.com/

Sunday, February 22, 2015

SQL copy value in table

INSERT INTO bonus_keyin (userid, bonusfrom, tarikh)
SELECT activateby, inv_no, timer
FROM 4800_1

Wednesday, February 11, 2015

Display submitted form data after redirecting to another page

http://support.themecatcher.net/quform-wordpress/guides/customization/display-submitted-form-data-after-redirecting-to-another-page


The submitted form data will be lost after redirecting, so we’ll use PHP sessions to save the data so that we can access it on the next page.

Step 1

Add the following code to the file wp-content/themes/YOUR_THEME/functions.php.
1
2
34
5
function mytheme_save_form_data($form)
{
    $_SESSION['iphorm_2'] = $form->getValues();}
add_action('iphorm_post_process_2', 'mytheme_save_form_data');
  • On lines 3 and 5, change the number 2 to your form ID

Step 2

We need to execute PHP code to print the saved variables on the page we redirect to. One way to be able to do this is to create a Page Template. To do this, copy the “page.php” file from your theme and call it template-thank-you.php
At the top of the file template-thank-you.php, after the opening PHP tag, add the comment below to register the page template with WordPress.
1
2
3
/**
 * Template Name: Thank You
 */
Remove the “loop” code from the file (see the Sample template-thank-you.php section below) and write your message HTML instead. You can print the submitted form data using the code below.
1
<?php echo $_SESSION['iphorm_2']['iphorm_2_1']; ?>
  • Replace iphorm_2_1 with the unique element ID of the element that you want to print the value for.
To print another value you can use the same code, just change the unique element ID.
Note: some form elements are not able to be printed directly as they return an array, see the Getting form values guide for the data types of all elements. You may need a PHP developer if you get stuck.

Step 3

Create or edit a page inside WordPress to be your destination page, on the right hand side at the Page Attributes box, for Template choose Thank You and save the page.

Step 4

Set up the form to redirect to this page by going to Form Builder → Settings → General → Successful submit options, at On successful submitchoose Redirect to another page, at Redirect to choose Page and select the destination page created in Step 3.

Sample template-thank-you.php

The following file was created by following the above guide on the TwentyTwelve theme, it will possibly not work with your theme, but it will show you how to modify the file. If you compare this to the default page.php file of the TwentyTwelve theme, you’ll be able to figure out what code to change.
<?php
/**
 * Template Name: Thank You
 */

get_header(); ?>

 <div id="primary" class="site-content">
  <div id="content" role="main">

   Thank you <?php echo $_SESSION['iphorm_2']['iphorm_2_1']; ?>, your message has been sent!

  </div><!-- #content -->
 </div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Still having trouble? Head over to the forums.

Thursday, February 5, 2015

Exercise


Write a program that ask user to enter student's full name. Repeat the process until user click 'N'.
After the program stop, the program will display the total number of students


Write a program that ask user to input student's full name, three quizzes, two test and two assignments. And calculate the total marks. Repeat the process until no more student to enter.

Tuesday, February 3, 2015

Using the PHP Session in WordPress

WordPress and Sessions

The WordPress platform is totally stateless and provides no support for the use of sessions outside of the cookie that keeps a user logged in.  This is a very good policy and helps keep your blog light and responsive.  Unfortunately there are times that a session might be convenient to hold some data between requests.  If you search online and in the WordPress forums you will find a lot of discussion of this and a few ideas that point in the correct direction.  
The best of these is Frank Verhoeven’s blog Post on this topic which is short and sweet and contains the basic idea.  The comments on this are the real gold.  What I’m providing here is a summary of the facts I’ve found in those comments and much other online study and experimentation.

Getting access to the session if you are not writing a plugin or theme

The simplest way to get access to the session is to add the following lines to wp-config.php before the call to wp-settings:
if (!session_id())
    session_start();
This is what Frank suggested and it works well if you want to get the session for some of your own code and register_globals isn’t set.

What about register_globals?

You’ll hear a lot of talk about the deprecated PHP option register_globals in php.ini and WordPress’s attempts to defeat its use with the wp_unregister_globals function in load.php. WordPress is correct in doing this, so don’t just comment out wp_unregister_globals.
If register_globals is set WordPress will clear all the globals that it are set. Calling session_start will set the $_SESSION global, so if you call it before wp-settiings is run and register_globals is set you will lose your session variables. In most cases this isn’t a problem, but your hosting provider may have turned that option on and you can’t turn it off.
If that’s the case, you can’t put the session_start in wp-config.php. You will need to put it in your code before you need the session. And if you put it elsewhere be sure to remove it from wp-config.php or you will lose your session.

But of course It’s a plugin that needs a session

You can’t put your session_start in wp-config.php if you are intending to distribute your code to others, since you have no access to it and your users might have register_globals set.  In that case you need to hook into an action that takes place after WordPress is loaded but before your code needs the session.  
You can hook into the “init” action, to do that you would add some code like this to your plugin or your theme’s functions.php:
add_action('init', 'myStartSession', 1);
function myStartSession() {
    if(!session_id()) {
        session_start();
    }
}
This code starts the session early in the initialization process, the 1 is the priority to cause this to run before other initialization. The session will be available once this has run.

One last piece in the puzzle

But it’s still missing a crucial piece.  The data stored in the session doesn’t go away when the user logs out or logs into a different account. For that you need to destroy the session.  And of course that requires a couple more hooks.  This results in the following code to start and destroy the session:
add_action('init', 'myStartSession', 1);
add_action('wp_logout', 'myEndSession');
add_action('wp_login', 'myEndSession');

function myStartSession() {
    if(!session_id()) {
        session_start();
    }
}

function myEndSession() {
    session_destroy ();
}

Now the session is yours to use as you wish in your code

To save some data into the session
$_SESSION['myKey'] = "Some data I need later";
And to get that data out at a later time
if(isset($_SESSION['myKey'])) {
    $value = $_SESSION['myKey'];
} else {
    $value = '';
}
I hope this is of help to others who have faced this problem.