تبليغاتX
Welcome to Leftclick

Welcome to Leftclick

آموزش نوشتن یک لاگین ساده در PHP

ولین قدم بعد از یاد گرفتن بدیهیات پی اچ پی تشخیص هویت کاربرا هست .
به زبون ساده همین لاگین کردن .
نکته 1 - توجه کنید که توی این آموزش کوتاه فرض شده شما دستورات اس کیو ال ، مفاهیم بانک اطلاعاتی و استفاده بانک اطلاعاتی در پی اچ پی رو بلدید .
نکته 2 - در این برنامه ی کوتاه از یک دیتا بیس به اسم db1 و یک جدول با اسم tbl1 با فیلد های user_id, user_name, password استفاده شده .
یک فایل برای کانفیگ دیتا بیس لازم داریم


1.$host = 'localhost';
2.$user = 'root';
3.$pass = 'anything';
4.$db_name = 'db1';

اطلاعات بالا رو توی یک فایل با اسم db-config.php ذخیره کنید . این کار رو به این دلیل می کنیم که اگه نیاز شد هر جای برنامه و توی هر صفحه ای از دیتا بیس استفاده کنیم اطلاعات لاگین رو مستقیما اونجا وارد نکنیم .
بزرگترین مزیت این روش اینه که اگه مجبور بشیم اسم دیتا بیس رو عوض کنیم یا یوزر و پس رو تغییر بدیم باید هر جای برنامه که از دیتا بیس استفاده کردیم این تغییرات رو اعمال کنیم . ولی با استفاده از این روش با تغییر فایل کانفیگ مسائل حله !
خب حالا یه فایل اچ تی ام ال ساده لازم داریم که یه فرم یوزر و پسورد رو ارسال کنه به صفحه ی login.php اسم اون صفحه می تونه index.html باشه .
فایل بعدی که باید بسازیم فایل login.php هستش .
ادامه مطلب
+ نوشته شده در  2009/4/23ساعت 8:4 PM  توسط مهدی فروتن  | 

seven lessons from Mozilla on community building

Open source is very popular these days, but it remains a bit of a mystery how to actually build a successful open-source project. I once reviewed some research on how to create winning open-source projects, but delivering results against basic principles remains a crap shoot of sorts.

I was therefore gratified to see John Lilly, CEO of Mozilla, weigh in on the subject with his excellent "Lessons from Mozilla" talk at Heise in Nuremberg, Germany, this week. With more than 220 million users and 40 percent of its code contributed by developers that don't work for Mozilla, the company behind the Firefox browser is an excellent example of open-source success.

Even so, Lilly was quick to warn people away from a cookie cutter approach to open-source success. While he was slated to discuss "how to bring an open-source project into the mainstream," he called out three serious caveats to that premise:



ادامه مطلب
+ نوشته شده در  2009/1/29ساعت 2:3 PM  توسط مهدی فروتن  | 

iPhone 3G now with in-home activation

When the iPhone 3G went on sale exactly five months ago, AT&T and Apple ended the in-home activation process that customers enjoyed with the original version. Though AT&T and Apple may have thwarted some iPhone unlockers, rule-abiding customers weren't happy about being forced to visit an Apple or AT&T store to buy the phone.

On Thursday, however, AT&T had a change of heart. You now can buy the iPhone 3G on AT&T's site (Apple will still make you come into the store) and have it delivered right to your home for activation through iTunes. The price is unchanged ($199 or $299) but as I said when AT&T business customers could buy the iPhone online, the convenience of activating at home is priceless.

Gadgetell first reported the news this morning, but I have confirmed it with AT&T's media relations office. Now hurry, you have only eight more ordering days to get a delivery by Christmas.

+ نوشته شده در  2008/12/12ساعت 12:1 PM  توسط مهدی فروتن  | 

Block a country

You can now block them easily with our free blocking service. Simply select the countries you want to block from your website and press the "Go" button.

Following, in step 3, .htaccess information is generated for you. Copy and past this generated code into your .htaccess document and visitors from the selected country will not be able to access your website.

Take a look at this blog

+ نوشته شده در  2008/11/18ساعت 5:30 PM  توسط مهدی فروتن  | 

ScriptCryptor Compiler

ScriptCryptor lets you quickly produce standalone, royalty free applications from your VBS or JS files. VBScript or JScript files will be converted into EXE files, the source of your scripts will be encrypted with Blowfish algorithm. Once converted, they cannot be modified or viewed by other users.

ScriptCryptor Compiler also lets you set various resources in the .EXE file, such as its description, the company name, version information and even the application icon. In additional, you may include any files to compiled exe file and use it during execution.

Main Features:
Convert Javascript and VBScript to console or windowed programms (VBS to EXE, JS to EXE)
No temporary file will be created while executing.
Command-line compilation
Hides and protects sources of a script from viewing.
Highlight command's syntaxis inside built-in editor
Allows you to use your own Icon and Version Info for compiled files.
Built-in WScript object
Script become independent Win32 executables, without relying on "cscript.exe" or "wscript.exe

Download This file with 1 mg

+ نوشته شده در  2008/11/16ساعت 2:46 PM  توسط مهدی فروتن  | 

Using the mobile phone as a credit card

I  admit it; I've been put off by the term "contactless payments." But it's an emerging area that deserves some attention.

If you are in Asia, you know what I'm talking about. People there have been making payments with their mobile phones using what's called "near-field communications." Just wave the handset in front of a reader and voila, the transaction is done.

In the U.S., we've had RFID technology embedded in cards. But the long-term goal is to eliminate the need to carry credit cards, building access badges and transit cards and just turn the phone into an all-in-one device.

Well, while the mobile phone has turned into an entertainment device over the last few years, it hasn't become the payment and access device in the U.S. that was envisioned when contactless payment strategies were born back in 2005 and earlier.

And now, with the economic downturn, the near-field communications industry is likely to take even longer to take off. Broad adoption of near-field communications will take longer than expected now, as long as three to four years, predicts Shyam Krishnan, an industry analyst at Frost & Sullivan.

So, a French company called Inside Contactless has come up with an interim solution that will let people turn their phones into credit cards and transit cards. Inside's MicroPass technology will be embedded into a sticker that can then be affixed to a phone, wallet, or anything else.

The company, which entered the U.S. bank card market with a microprocessor-based chip in 2005 and is backed by Nokia, Motorola and Samsung, recently announced that Colorado Plastics will be producing stickers using the MicroPass technology.

Soon, we may see people waving their mobile phones, iPods, ID badges, or wallets in front of readers to get on the subway or buy coffee at Starbucks.

"It's a cool way to pay; convenient," said Charles Walton, executive vice president of the payments business at Inside. "It turns the phone into a super wallet."

"It's a card in a different format," said Jonathan Collins, principal analyst in ABI Research's RFID and contactless group. "We've had American Express fobs, but they didn't prove to be overly popular. Stickers are more useful."

The MicroPass technology should fare better with regard to security scrutiny than the much-maligned NXP Mifare Classic RFID chip, which has been found to have severe flaws and can be cloned.

"We're using a microprocessor with open-standard security techniques, not a fixed memory, proprietary security scheme" like Mifare Classic, Walton said. The applications implemented using MicroPass "cannot be cloned in that way."

Adoption will depend on how quickly banks, retailers and phone companies can agree on standards and implementation, as well as on whether people are ready to merge their phone and their wallet.

"There has to be a benefit for the end user," Krishnan said. "It all boils down to its convenience, at the end of the day."

+ نوشته شده در  2008/10/26ساعت 9:15 AM  توسط مهدی فروتن  | 

Google, universities offer tool to detect Net filtering, blocking

WASHINGTON--Is your Internet provider interfering with your network traffic, and perhaps even running afoul of Net neutrality principles? Google and some like-minded folks believe they've come up with what amounts to an early warning system.

The idea behind the so-called Measurement Lab, or M-Lab, is that just about anyone interested in Internet regulation--including consumers, regulators, and content providers--could use more details about their network's performance. Google, the Democratic Party-affiliated New America Foundation, and the PlanetLab Consortium (a university-business consortium devoted to next-generation networks) announced M-Lab on Wednesday.

The launch's timing is probably no coincidence: M-Lab may become especially relevant if the Net neutrality wars between Google and broadband providers in Washington heat up again. If Democratic legislators get their way, the so-called stimulus package expected to become law will require federal regulators to define and enforce "open access" rules for certain broadband and wireless networks. The 2007 discovery that Comcast was throttling BitTorrent traffic showed that it can be difficult to determine when network providers are interfering.

M-Lab aims to bring more transparency to network activity by allowing researchers to deploy Internet measurement tools and share data. The platform launched Wednesday with three Google servers dedicated to the project, and within six months, Google will provide researchers with 36 servers in 12 locations around the globe. All the data collected will be made publicly available.

Sascha Meinrath, research director of the New America Foundation's Wireless Future Program, said his organization's role in M-Lab is to translate the data collected into meaningful and understandable information for policymakers. M-Lab founders and supporters told an audience here at the New America Foundation headquarters that more information would lead to better policymaking from anyone's perspective.

"I'm going to argue no matter what position you take on Net neutrality, you should be happy things like M-Lab are being built," said Ed Felten, a computer science and public affairs professor from Princeton and the director of the Center for Information Policy.

"If you believe the government should take more active steps to mandate Net neutrality...it will help you gather the evidence you need" to support such policies, he said. On the other hand, he said, more transparent networks would give Internet service providers true market incentive to behave in consumer-friendly ways.

Meinrath, however, said they do not intend to use M-Lab data for any kind of political agenda.

"The goal is not to be actively involved in using that ammunition," he said. "It's just creating results."

For now, M-Lab is running three diagnostic tools for consumers: one to determine whether BitTorrent is being blocked or throttled, one to diagnose problems that affect last-mile broadband networks, and one to diagnose problems limiting speeds.

Vint Cerf, Google's chief Internet evangelist, said that while such information may be hard for some consumers to understand, it would help them explain their Internet problems to people with more expertise.

"This data could be made available to someone who is trying to help you," he said, "but instead of getting anecdotal information like, 'Gee, this is slow,' you could actually send this data."

"You'd have some raw data coming from the customer's point of view," he continued. "Maybe it will allow people to start businesses like 'Call a Geek' to figure out what's wrong with their Internet connection."

+ نوشته شده در  2008/10/23ساعت 11:29 AM  توسط مهدی فروتن  | 

Amazon meets expectations, but offers dim holiday forecast

Amazon's third-quarter revenue was in line with analyst expectations, but e-commerce doesn't appear to be immune to the economic slump pounding offline and online retailers alike.

For the quarter ended September 30, Amazon reported $4.26 billion in revenues, up 31 percent compared with $3.26 billion in third quarter of 2007. The numbers came in on the low side of Amazon's forecasts from last summer. The company said revenue would be between $4.2 billion and $4.4 billion. Analysts, on average, expected revenue to be $4.28 billion.

Amazon rival eBay last week lowered fourth-quarter revenue expectations, and Wall Street was very interested to learn how Amazon thought it would fare during the holiday season. Forrester Research expects online retail growth to slow for the first time this holiday season as a result of the weak economy.

Forrester estimates that shoppers will spend $44 billion online during the holiday season. That figure represents a 12 percent increase from last year, but it's the slowest rate of growth for online retail to date.

During a conference call after the earnings release, Amazon executives said sales of the Kindle, the company's digital book reader, continue to surpass expectations and the company doesn't have plans to introduce an upgraded model until next year at the earliest.

Amazon's stock closed trading Wednesday at $49.99. Shares, however, dropped as much as 16 percent in after-hours trading, changing hands recently at $43.75, down $6.24 or nearly 13 percent from their closing price.

Wall Street has hammered Amazon's share price; the stock is down more than 50 percent from its 52-week high of $101.09.

Net income for the quarter was up 48 percent to $118 million, or $0.27 per diluted share, compared with net income of $80 million, or $0.19 per diluted share for the same period last year.

Amazon said the fourth quarter, the vital holiday period, will produce revenue of between $6 billion to $7 billion. That represents growth of 6 percent to 23 percent. During the conference call, company executives didn't provide many more details on what they think the holiday quarter will bring.

+ نوشته شده در  2008/10/23ساعت 11:23 AM  توسط مهدی فروتن  | 

Vista laptops not top sellers on Amazon

Computer sales on Amazon.com are not exactly a proxy for the broader retail market. Still, I do think it is noteworthy that of the top 20 best-selling laptops on Thursday evening, just one was running Windows Vista.

That one is an HP mini-notebook that ranked No. 18, trailing behind a gaggle of Macs and Netbooks running either Windows XP or Linux.

On the plus side for Redmond, 10 of the top 20 machines were running some flavor of Windows. And, as I mentioned, Amazon is not a true barometer.

Apple's market share, while growing isn't exactly neck and neck with Microsoft's. And Netbooks, while a rising trend, aren't completely taking over the market.

But while the numbers are skewed the trends are worth paying attention to. Two of the hottest parts of the PC market are the areas where Windows faces its stiffest competition.

The Amazon sales trend was noted earlier Thursday by MacDailyNews, though they used a slightly different measurement.

+ نوشته شده در  2008/10/17ساعت 11:41 AM  توسط مهدی فروتن  |