Archive for the ‘programming in php’ Category

Web Programming (PHP, HTML, JAVA, etc.) question for Sorting arrays?

I need an answer as to which language (and hopefully pre-built algorithm) would be required to build a massive sort for multiple statements. i.e. "I would like to go to get ice-cream in toronto". I need the sort to find keywords (such as ice cream and toronto), then it needs to find people (in a website i control) and it needs to sort the people in order of an "availability" variable. I’m not asking that someone builds this, I am simply asking what program and what type of sort is the best for achieving some sort of undertaking like this.

java runs faster then php i think and if you want to go for speed i recommend you to use hasmaps or some sort of hastables not a sorted array… hastables uses linear algorithms to get the variables that means is really fast and its eays
if realy need arrays(i don’t see why) quick sort is proved to be the best comparing sorting method..
and you don’t have only numbers that mean you can’t applay a numerical sorting algorithm

still i recommend java with hasmaps

How to encrypt a string in php programming?


You can use md5 function to encrypt a string

<?php
$str="hello";
echo md5($str);
?>

What Is a Persistent Cookie in php programming language?


A persistent cookie is a cookie which is stored in a cookie file permanently on the browser’s computer. By default, cookies are created as temporary cookies which stored only in the browser’s memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
*Temporary cookies can not be used for tracking long-term information.
*Persistent cookies can be used for tracking long-term information.
*Temporary cookies are safer because no programs other than the browser can access them.
*Persistent cookies are less secure because users can open cookie files see the cookie values.

In PHP programming, what is a task number?

I can’t seem to find a specific answer to this question. For example, if I execute "php myprog.php 1 a.txt b.txt", from the command line, what the number 1 as the task number mean? Is it required?
**what does

Is that not just the first parameter being passed to myprog.php?
It depends on what myprog does with it

SQL / PHP Programming whats wrong in this code 5 stars?

What is wrong in this code?

<?php

$result = null;

//connect to the mysql database
mysql_connect(1221212′, ”password’, ‘dsdasd) or die(‘Error connecting to mysql’);
mysql_select_db(‘tabe);

//format the variables
$user_name = mysql_real_escape_string($_GET['reciept']);

//check the database for any users named $user_name
$grab_user = mysql_query("SELECT reciept FROM users WHERE reciept = ‘$user_name’");

//check if the query returned anything
if(mysql_num_rows($grab_user) == 0){

//no user by that name
$result['action'] = ‘success’;

}else{

//oops, already taken
$result['action'] = ‘error’;

}

$result['reciept'] = $_GET['reciept'];

//send the response back
echo json_encode($result);

Ps, i removed all of the database data
The error is {"action":"error","reciept":null}

The error is {"action":"error","reciept":null}

What technology to use in PHP ?

I want to scrape specific data from a web page automatically and store them in my database… I am going to use PHP for programming… what technology do i need to use for such operation ? i heard that CURL will be useful… do CURL consume huge server resources ?

Not really. AFAIK, you’d only need curl for https. It’s easy, but it isn’t the most secure technology in the world, though; depending on how you’re going about things you can almost always use OpenSSL.

But if you’re just scraping curl and vanilla php (obviously with support for your database) should be good enough.

Job help for PHP programming & MySQL?

I applied for a job at this company who posted online and i got called in for an interview next week

PROGRAMMER PHP/MY-SQL
Entry level position for individual with demonstrable skills and knowledge in PHP and MY-SQL. Applicant will undergo in office testing for verification of abilities.

I have websites i designed, i know HTML code like a second language but the only time i’ve used MySQL was to setup SMF forum, the interview is next week and i don’t know much about PHP or php programming, in desperate need of a job, what kind of tutorial or where online can i start off from to learn?
@char0811 i know i should’ve it’s just i saw ‘ENTRY LEVEL’ so i took a chance

My suggestion is to learn all you can learn before the interview and be honest in the interview by stating that you’re just starting out in PHP/MySQL and want a career in the field (but don’t mention the desperate thing). Depending on the pool of candidates, you may well get the job if you demonstrate that you’re personable and intelligent.

Too many programmers don’t have good communications skills and, even though they may be qualified, they don’t get the job because the company doesn’t want the hassle of dealing with that type of person. And take note, many employment ads are really just a wish list. Companies will overlook deficiencies, if they can, to get someone they feel is intelligent and willing to commit to the company.

Remember to wear professional attire, be upbeat, and make eye contact with the interviewer; and, if they ask you if you can do the job, don’t say something like "I think so" or "maybe." Just say "YES I CAN." Any weak response on this question will likely kill your chance of employment.

Web Programming(PHP ,ASP.NET) best institute in kolkata WEST-BENGAL?


Following two are among the best in Calcutta Programming Institutes (where You can get free lessons if You pass a talent test or at a very nominal fee):

1)Ejobindia –
ejobindia.com – Block AJ, Plot No.124, Ground Floor, SaltLake, Sector 2, Kolkata – 91, Kolkata – 09830125644

2)Karmick Solutions Pvt. Ltd -
www.seo-specialists-india.com – 116A, Purbalok (Premises No: 1118) Street No: 6th Kolkata – 700099 India, Kolkata – 033 2426 4362

Whats the best way to encrypt a string in php programming?


These are different algorithms

<?php
if (CRYPT_STD_DES == 1)
{
echo "Standard DES: ".crypt("hello world")."\n<br />";
}
else
{
echo "Standard DES not supported.\n<br />";
}

if (CRYPT_EXT_DES == 1)
{
echo "Extended DES: ".crypt("hello world")."\n<br />";
}
else
{
echo "Extended DES not supported.\n<br />";
}

if (CRYPT_MD5 == 1)
{
echo "MD5: ".crypt("hello world")."\n<br />";
}
else
{
echo "MD5 not supported.\n<br />";
}

if (CRYPT_BLOWFISH == 1)
{
echo "Blowfish: ".crypt("hello world");
}
else
{
echo "Blowfish DES not supported.";
}
?>

Is $smarty any known object/declaration/statement in PHP programming?


No, it’s the name of an often-used Variable related to the template-system Smarty. If you want to know, what smarty is and how it works, have a look at here:

http://en.wikipedia.org/wiki/Smarty