php

PHP URL submitter

Can anyone please provide example how can submit URL to search engines by PHP? ...

Filtering out MySQL query in PHP

Hey there, I'm doing some queries to a MySQL database that involves some user-input.. And I was wondering how to prevent injection attacks, like, for example, if someone were to type "; a-MySQL query here;" It would be executed, this would allow people access to compromise my system. I'm wondering how i could protect against things l...

Large amounts of text - mysql or flatfile?

I am writing a web application in PHP that will store large numbers of blocks of arbitrary length text. Is MySQL well suited for this task with a longtext field or similar, or should I store each block of text in its own file and use a MySQL table for indexes and filenames? Think online bulletin board type stuff, like how you would store...

How can I create a threshold for similar strings using Levenshtein distance and account for typos?

We recently encountered an interesting problem at work where we discovered duplicate user submitted data in our database. We realized that the Levenshtein distance between most of this data was simply the difference between the 2 strings in question. That indicates that if we simply add characters from one string into the other then we e...

registration form validation usinga ajax

hi there guys, i need your help. can you please give me some simple codes in validating a registration form using ajax? please... :-( I'm a beginner. i need your help guys. ...

Posting a sub-form with jQuery

I'll start off by saying I'm new to jQuery but I am really enjoying it. I'm also new to stackoverflow and really loving it!! The problem: I've created a sub-form with jQuery so that a user may add, then select this information from a dropdown list if it is not already available. I'm unable to POST this data with .ajax(), so that the u...

How to use PHP to get the *idex* of the selected combobox item, not its text?

If I have a combobBox with values red/white/blue and the users chooses blue then I want my form action php page to use the value 2, not `blue. I hope you see what I mean. Is there any easy way to do that? ...

Zend Framework PHP Solutions

Hello my fellow Stackoverflownians :), I just came across this thing called Zend. And it looks pretty cool and i wanna get my hands on it, but I have a question. So if anybody knows anythin about Zend, I would really appreciate your advice. I am using Winhost as my hosting provider (http://www.winhost.com/) and they are a Windows Hoste...

Tough Mysql Query ....

Hi guys, I am trying to do a complex query from two tables...It's a question from a skill quiz.... table **Orders Customer**s id id date first_name shipping_amount last_name order_stat...

php string to variable

I have built variable $line based on the following: foreach ($regex as $each){ $parts = explode('::',$each); $pattern = '"/^'.$parts[1].'/i"'; $subject = '$row['.$parts[0].']'; $line .= 'preg_match'.'('.$pattern.','.$subject.')'; if (end($regex) != $each){ $line .= '&&'; } } I have a function that call the $line. Once called, ...

PHP Assign array to variables

I'm not sure if my memory is wrong, but when I last used PHP (years ago), I vaguely remember doing something like this: $firstVariable, $secondVariable = explode(' ', 'Foo Bar'); Note that the above is incorrect syntax, however in this example it would assign 'Foo' to $firstVariable, and 'Bar' to $secondVariable. What is the correct ...

javascript:show alert if not match

dear all..i have a textfield. i want after i have typed identity number inside it, the script can identifying to "user table" at DB. i want if id number not match can show an alert.. how do i do that?i'm newbie at javascript ...

MLT framework and PHP

Does anyone used MLT (Media Loving Toolkit )Framework along with PHP. Is there a kick start material or code sample that i can refer for MLT - PHP API integration ...

Proper way to save a 1970 type date

I have a date that looks like 1003029303, which I guess is what's known as a linux UNIX time stamp. What format should I save it as in a mysql database? I don't suppose that an int(10) is the right way. `gottime` int(10) ...

What is an effecient way to code separate comment areas?

I realize this is somewhat of an abstract question that has several answers, but I am at a loss as to where to begin. I want to have a separate comments area for each of my blog posts. Should I just set up a different table for the comments for each entry manually every time I update the code to include the latest entry? ...

which one is faster/smarter and why: COUNT(*) or storing the numbers each the do something

PHP $total_points = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM account WHERE id='$id'"),0) Mysql account table |user_id| mysql points table |id | user_id | points | or PHP $total_points = mysql_query("SELECT points FROM account WHERE id='$id'"); Mysql account table |user_id| points | Mysql points table |id | u...

need an ideea to optimize an algorithm for matching multipart rar files from input in php

Hello, i'm looking for a better optimized way to find and group multipart archives from an array of filenames I have as an input for example: array( books.part1.rar, books.part3.rar, 00000114.rar, svoy_20ostrov.rar, svoy_20ostrov.rar, koncert_20v_20dk_20mir.rar, koncert_20v_20centralnom_20teatre_20kukol.rar, LP_LIVE_PR_Tampa.part2.rar...

what are the advanteges and disadvanteges of PHP,ASP.NET and JAVA for developing a datacentric application?

this question is related to my previous question http://stackoverflow.com/questions/3334580/siutable-tool-and-technology-for-electronic-health-system i need the comparison and expert opinion in this aspect. thanx in advance. ...

How to write content type in cakephp ?

Hi, How can i write ["Content-Type"] = "text/xml" in cakephp and in which file i have to include that one. Please Help. Thanks. ...

Session/authorize comet on Nginx HTTP PUSH

The Nginx approach to HTTP PUSH is relatively simple. There are 3 party involve: Subcriber (receiver), Publisher (sender), and the server itself act as multicast server. Nginx can also separate into different channel with different channel ID that user can access. But I still don't know how to authorize/limit content only for logged in...