Archive for January 2012

Your Own Matrimonial Website PHP Script | Matrimonial portal script


Your Own Matrimonial Website PHP Script | Matrimonial portal script
Matrimonial software script, an online website development PHP script that is user-friendly in all bases including search, update, add/remove, and edit profiles from the database. This online matrimonial system application includes member registration with features of feeding basic details, religious background, physical status, and profile insertion with a confirmation message.


For more details contact us on ready2goportals@gmail.comVisit us at www.ready2goportals.com

Beware of Relative Includes

Say you have an application with an index.php that contains:


require_once 'include/config.php';
require_once '/path_to_lib/util/all.php';

The util library also has an include/config.php file. In util/all.php it has:

require_once 'include/config.php';

Which config file will util/all.php include?

Relative paths are converted to absolute pathnames with something like:

function relativeToAbsolute($relativePath) {
return realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $relativePath);
}


Since index.php is the script that is being executed then util/all.php will include the config file in the application folder instead of the one from the util library folder. The solution is instead of relative includes use:

require_once dirname(__FILE__) . '/include/config.php';

Disable UAC and IIS.

Before proceeding to installation we will have to disable
user account control (UAC) and Internet Information
Services (IIS) for the time being. You can enable them
again once installation is complete.

To disable UAC go to
Start>Control Panel>User Accounts” there you will
find an option “Turn User Account Control on or off
just click on it and uncheck “User Account Control to
help protect your computer”, click “OK”.

To disable IIS go to “Start>Control Panel>Programs and Features
on the leftmost side you will find an option
Turn Windows features on or off” click on it and
uncheck “Internet Information Services”, click “OK
and restart your computer.


Also visit :

-> http://online-income-sources.blogspot.com/
to learn genuine money making techniques.

If you are facing any other problem (Error)
regarding Apache PHP and MySQL then please
mail me directly on metech11@gmail.com


GuDLuck!


Retrieving from Database and show checkboxes

I was working on a project and i had landed in an awkward situation, where i have to save the tick box values in a database and once done, i had to retrieve those values and present it to the user for editing.so i create the solution yourself.

For example when there are checkboxes for 5 colors – Red, Green, Blue, Yellow, Brown and i have the php script doing insertion into database.

http://corpocrat.com/2009/05/24/how-to-store-and-retreive-checkbox-value-in-mysql-with-php/

Javascript Return Statement

After 20+ years of programming I learnt something new today, while messing about with the php_spidermonkey extension.

If you place a carriage return after a 'return' statement in Javascript, and put some code on the line underneath, the function returns 'undefined', as if the statement was simply: return;

Here's an example of a function that returns 'undefined':

function whatelse()
{
var ok = false;
return // function ends here
ok ? 'OK (true)' : 'OK (false)'; // this line is never executed!
}

Interview Tips

First impressions are vital to a successful interview. Make sure you have followed the guidelines to dressing professionally for the interview. For men, a smart looking suit with all the accessories. For women, a business suit with limited jewelry. Your clothing should be clean and wrinkle free.

* Trial run of the travel route
         See how long it takes you to get from start to finish. See if there is construction or an overload of traffic that could possibly cause adelay in your arrival at the interview. Find out where you will be parking. If there are parking meters, make sure you have enough change available on the day of your interview. There’s nothing worse than being unprepared.

* Don’t arrive too early or too late
A person who arrives hours before their assigned interview time will be perceived as someone who has nothing else to do. Arriving too late will not only make you seem unreliable, but it will stress you out and that is no way to start off an interview.

* Greet the receptionist with respect
Often this is one of the deciding factors to be considered if the company is making a decision about two candidates. The interviewer may ask the receptionist after you leave how you treated them. How you conduct yourself with employees will help you clear that first important hurdle.

 * Give a firm and quick handshake
This goes for women too! Don’t shake their arm up and down or make them pull away because it lasts too long. Smile and look the interviewer in the eyes and introduce yourself with all the confidence in the world. If you want this job, you need to appear enthusiastic about meeting them.

 * Breathe!
Seriously, it will relax you and calm any anxiety you might be experiencing. EVERYONE has felt this way, including the person interviewing you.

* SHUT UP and LISTEN!
This is not a social event; it is about business. Let the interviewer set the tone and pace of the interview now. Many interviewers dislike chatty applicants. You will know if you are talking too much because your interviewer will look bored. If the interviewer finds interest in the way you are answering the questions, keep that style. Don’t be reluctant to toot your own horn, campaign for yourself by suggesting how you can become an integral part of the organization with your special skills and talents. You are there to sell yourself to the interviewer.

* Any questions? ASK !
Do not shrug your shoulders like a goober and say no. This is your chance to ask well thought out questions that you want to know as a result of your research on the company beforehand. This information can be found in newspapers, business directories and nowadays all over the Internet. Other questions that would be appropriate at this time in the interview are about office attire, other responsibilities you might have besides the ones mentioned as a job description. You can also ask when the final decision will be made on the position.

* DO NOT ASK ABOUT SALARY
You do not even have the job yet! That part comes with the job offer interview. The focus now should be on all your extraordinary qualities that make you more valuable than the other candidates.

* Get Business cards from Interviewers
Most interviewers will give out their business cards but if they do not, request one. This will serve two purposes. It will give you the name, address and phone number for sending a thank you note after the interview. Secondly, it will give you the person to contact so you can follow up on the interview process.

* Be positive and enthusiastic
Make sure you sell yourself without exaggerating. This is your moment to shine and prove that you are the most viable candidate for the job opening.

* SEND A THANK YOU NOTE
This is very appropriate and important and a step above other candidates.
After the interview is over and you have left the office, take a moment to analyze your answers to their questions. Jot down some areas that you feel could have gone better and go get something to eat and calm down. The worst part is over. Until the next job interview


Wedd Fest - Wedding Exhibition 2010 will Organize on 23-24-25 October at Imperial Palace in Rajkot Gujarat India

Wedd Fest - Wedding Exhibition 2010

Wedd Fest - Wedding Exhibition 2010 will Organize on 23-24-25 October at Imperial Palace in Rajkot Gujarat India .

Wedd Fest is Brand Name of Wedding Exhibitions used to Organize by Espresso Events from Rajkot Gujarat India.

Espresso Events presents this Wedding Show Every Year in major cities of various states in India.

Useful Links

Espresso Events - Nri Gujarati Classified Link

Espress Events Link - Link on Blog Wedding World

Espress Events - Wedd Fest Website

Espress Event - Company Website

Thanks & Regards

Espresso Events,

Rajkot, Gujarat-India

bounce php-fpm

To stop

killall -w -v php-fpm

-w is to wait for the processes selected to stop
-v verbose

I observed that few php-fpm processes took time to stop (might be they are wrapping up stuff). Immediately starting php-fpm after passing the killall command without -w might cause error (port in use or unix socket in use).

Another important point. In case if you are running php-fpm in the unix socket mode then make sure to bounce your server in case you are bouncing php-fpm. I follow this

stop server && stop php-fpm && start php-fpm && start server

reset a directory with rewinddir() in php

 rewinddir.php :

<?php

//Open send directory
if(@$dir = opendir("send"))
{

//List files in send directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}

//resets the directory stream
rewinddir($dir);

//to check for changes

closedir($dir);
}
else
{
echo 'directory not opened';
}
?>

outputs :
 1)
directory not opened

2)


filename: .
filename: ..
filename: sendsms.html
filename: sendsms.php
filename: send_vard.php
filename: send_vcard_sms.html
filename: smser.php

Beware of References

I got tripped up by the following code:


// This data actually comes from csv file
$data = array(
array('Area1', null, null),
array(null, 'Section1', null),
array(null, null, 'Location1'),
array('Area2', null, null),
array(null, 'Section2', null),
array(null, null, 'Location2')
);
$root = array();
foreach ($data as $row) {
if ($row[0]) { // Is Area
$area = array();
$root[$row[0]] =& $area;
} elseif ($row[1]) { // Is Section
$section = array();
$area[$row[1]] =& $section;
} elseif ($row[2]) { // Is Location
$section[] = $row[2];
}
}
print_r($root);


Expected result:
Array(
[Area1] => Array(
[Section1] => Array(
[0] => Location1
)
)
[Area2] => Array(
[Section2] => Array(
[0] => Location2
)
)
)


Actual result:
Array(
[Area1] => Array(
[Section2] => Array(
[0] => Location2
)
)
[Area2] => Array(
[Section2] => Array(
[0] => Location2
)
)
)


So what did I do wrong? To answer this lets look at a simpler example:

$a = array();
$b =& $a;
$a[] = 'hello';
echo implode(' ', $b); // Outputs 'hello'
$a = array('world');
echo implode(' ', $b); // Outputs 'world'


See I was expecting the last line to output 'hello' because I was thinking references were like C pointers. That is:
void* a = array();
void* b = *a;


So looking up the PHP manual it says:
They are not like C pointers; instead, they are symbol table aliases...
References can be thought of as hardlinking in Unix filesystem.

php.ini di XAMPP 1.6.2

Sering sekali pada saat kita melakukan kesalahan atau bingung pada saat konfigurasi php.ini di XAMPP. Hal ini disebabkan ada beberapa php.ini yang tersebar di beberapa folder XAMPP, mana yang digunakan ?


PHP sebagai Module PHP

Untuk melakukan pengecekan php.ini yang digunakan pada modul Apache cukup gampang, kita cukup menggunakan informasi dari fungsi php_info() dan melihat isi dari entri Loaded Configuration File.

Untuk xampp, coba jalankan server Apache dan ketik pada browser http://localhost/xampp/index.php, hasilnya terlihat seperti gambar di bawah ini (klik gambar untuk melihat ukuran sebenarnya).



Pada gambar terlihat entri Loaded Configuration FIle menunjuk ke c:\xampp\apache\bin\php.ini, inilah lokasi file php.ini yang yang dikenali dan digunakan oleh Apache web server di XAMPP.
Penggunaan php.ini di Interpreter Command Line

Selain sebagai modul Apache, php tentu saja bisa digunakan sebagai interpreter di command line atau terminal. Untuk ini php.ini yang dikenali adalah yang berada pada folder yang sama dengan program php.exe.

Sebagai contoh, instalasi XAMPP di sisi saya adalah di C:\xampp\php maka php.ini yang dikenali di sini adalah c:\xampp\php\php.ini. Apabila belum ada terdapat file php.ini di folder ini, maka carilah file php.ini-dist dan diubah namanya menjadi php.ini.

Demikian tips ini saya buat, semoga bisa berguna. Untuk saran, kritik dan pertanyaan dapat diajukan melalui comment di bawah atau kirimkan email ke pintarphp@komputasiawan.com.

SubID tracking php affiliate script

with this script you will make your small ad network which you will add your affiliate links as the offers when the visitor of your site register as a new user it will show him the offers with a commission for each lead/sale and your affiliate links will be modified by adding this member ID at the end of your affiliate links in a way able you to track this member leads/sales from your statistics at the original ad network which these leads/sales belongs to.


For example if you are a publisher at an ad network your affiliate link for a certain program would be something like this;http://www.youraffiliatelink...?sid=

now when member number 33 promote this link he/she will promote this link;http://www.youraffiliatelink...?sid=33

when this member bring for you a lead/sale it will shown at your statistics at this network affiliate/publisher area and so you will add for this member the number of leads/sales from your website Control Panel and so on for all other ad networks which have the sub id features.


Admin features includes add/edit/delete categories offers add/edit/delete payment methods complete/deny/delete payment requests set site setting like name slogan minimum pay out privacy page add leads/sales to members add/edit/block/delete members accounts and much much more.


members can view their day by day statistics from time to time stats. request payment when reach the minimum pay out modify profile and much more.


CSS style file available so you can modify your website look contact page you can reply to your contacts from admin cp and more.


demo information:

demo website: click here

login as member1 username: member1 and password: member

login as member2 username: member2 and password: member

login as member3 username: member3 and password: member

login as member4 username: member4 and password: member

login as admin click here username: admin and password: admin


* click here to visit website for this script.

Assignment #4

File created:
1) adminLogin.php --- Time spent: 30mins
2) adminVal.php --- Time spent: 40mins
3) admin.php --- Time spent: 40mins
4) adminLogout.php --- Time spent: 20mins
5) adminOnlyINC.php --- Time spent: 40 mins
6) connINC.php --- Time spent: 20 mins
7) utilINC.php --- Time spent: 30mins
8) sessionINC.php --- Time spent: 10mins
9) editTable8.php --- Time spent: 20mins
Learnt: I have learnt to use session to identify different user's state and to connect to Mysql database using php.