Click here to Skip to main content
13,301,100 members (55,989 online)
Rate this:
Please Sign up or sign in to vote.
See more:
    //connection information
    $host = "localhost";
    $user = "root";
    $password = "your_mysql_password_here";
    $database = "test";
    $param = $_GET["term"];
    //make connection
    $server = mysql_connect($host, $user, $password);
    $connection = mysql_select_db($database, $server);
    //query the database
    $query = mysql_query("SELECT * FROM friends WHERE name REGEXP '^$param'");
    //build array of results
    for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) {
        $row = mysql_fetch_assoc($query);
        $friends[$x] = array("name" => $row["name"]);
    //echo JSON to page
    $response = $_GET["callback"] . "(" . json_encode($friends) . ")";
    echo $response;

Please help me......
Posted 9-Jun-12 2:11am
Sandeep Mewara 9-Jun-12 13:36pm
Did you try anything?
Tim Corey 9-Jun-12 22:10pm
Code Project is not a place to get people to do your work for you. If you are doing your work and you get stuck on a particular point, this is the place to ask. This question is much too broad. If you are truly that lost, you need more help than we can give. What you need is a good tutorial on php and then on ASP.NET. Once you get those two down, you will understand how to accomplish a task like this.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I just answered a similar question

PHP to ASP.NET conversion[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

string URLAuth = "";
WebClient webClient = new WebClient();
NameValueCollection formData = new NameValueCollection();
formData["log"] = "xxxx";
formData["pwd"] = "xxxx";
formData["wp-submit"] = "Log In";
formData["redirect_to"] = "";
formData["testcookie"] = "1";
byte[] responseBytes = webClient.UploadValues(URLAuth, "POST", formData);
string resultAuthTicket = Encoding.UTF8.GetString(responseBytes);

//string searchammount = comboBox1.SelectedItem.ToString();
WebRequest Logingrequest = WebRequest.Create("");
Logingrequest.Credentials = CredentialCache.DefaultCredentials;
Logingrequest.ContentType = "application/x-www-form-urlencoded";
Logingrequest.Method = "POST";
WebResponse response = Logingrequest.GetResponse();
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
//richTextBox2.Text = responseFromServer;

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

$theValue = $_REQUEST['theValue'];
echo "theValue " . $theValue;
for($i = 1;$i <= $theValue;$i++)
echo basename($_FILES['imgfile' . $i]['name']);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100