Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
<?php
 
    //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;
 
    mysql_close($server);
 
?>
 

 

 
Please help me......
Posted 9-Jun-12 2:11am
Comments
Sandeep Mewara at 9-Jun-12 13:36pm
   
Did you try anything?
Tim Corey at 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
good
Please Sign up or sign in to vote.

Solution 1

I just answered a similar question
 
PHP to ASP.NET conversion[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

string URLAuth = "http://www.lyndatobin-howes.com/wp-login.php";
WebClient webClient = new WebClient();
NameValueCollection formData = new NameValueCollection();
formData["log"] = "xxxx";
formData["pwd"] = "xxxx";
formData["wp-submit"] = "Log In";
formData["redirect_to"] = "http://www.lyndatobin-howes.com/wp-login.php";
formData["testcookie"] = "1";
byte[] responseBytes = webClient.UploadValues(URLAuth, "POST", formData);
string resultAuthTicket = Encoding.UTF8.GetString(responseBytes);
webClient.Dispose();
 
//string searchammount = comboBox1.SelectedItem.ToString();
WebRequest Logingrequest = WebRequest.Create("http://www.lyndatobin-howes.com/wp-login.php");
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;
 
reader.Close();
dataStream.Close();
response.Close();
  Permalink  
Rate this: bad
good
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']);
}
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,614
3 Maciej Los 4,989
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2014
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