PHP - plz help
Asked By sweta *
09-Feb-12 02:34 AM
<html>
<body>
<form action="<?php echo $_SERVER['SCRIPT_NAME'] ?>" method="post">
<input type="submit" value="Save" />
</form>
</body>
</html>
<?php
$url = $_GET['url'];
$dbc = mysqli_connect('xxxx', 'xxxx', 'xxxx', 'xxxx')
or die('Error connecting to MySQL server');
$query = "INSERT INTO xxxx (url)".
"VALUES('$url')";
$result = mysqli_query($dbc, $query)
or die('Error.');
mysqli_close($dbc);
?>
Danasegarane Arunachalam replied to sweta *
So where is the question ?
megha n replied to sweta *
<?php
include_once('simple_html_dom.php');
$target_url ="http://www.censusindia.gov.in/Census_Data_2001/Census_data_finder/A_Series/area.htm";
$html = new simple_html_dom();
$html->load_file($target_url);
foreach($html->find('table') as $img)
{
echo $img->src."<br />";
echo $img."<br/>";
}
foreach($html->find('a') as $link)
{echo $link->href."<br />";
}
?>
retriving the data
megha n replied to sweta *
html>
<body>
<form action="<?php echo $_SERVER['SCRIPT_NAME'] ?>" method="post">
<input type="text" name="url">
<input type="submit" value="Save" />
</form>
</body>
</html>
<?php
$hostname = 'localhost';
$username = 'user';
$password = 'user123';
$Database_Name = "info";
$url = $_GET['www.censusindia.gov.in'];
$dbc = mysql_connect("$hostname", "$username", "$password") or die(mysql_error());
mysql_select_db("$Database_Name") or die(mysql_error());
//$query = "INSERT INTO table (url)"."VALUES('$url')";
$query = "INSERT INTO `table` VALUES('id','$url')";
$result = mysql_query($query)
or die('Error.');
//echo "$result";
mysql_close($dbc);
?>
a WebRequest on a remote machine. The code looks like: req = WebRequest.Create(uri); req.Method = "POST"; / / Post method req.ContentType = "text / xml"; / / content type req.Credentials = CredentialCache.DefaultCredentials; StreamWriter writer = new StreamWriter(req
Send and Get data using post method Hi everyone, How can i send and get data between two pages using POST method. Thank a lot! i need aspx page code and code behind both. We use the POST method because we want to hide the query string in the address bar. . so another option void Page_Load( object sender, EventArgs e) { Label1.Text = Session[ "user" ].ToString(); } If data passed with Post method we need the following code to retrieve the data: Page.Request.Form[<param> ]; One of
POST"<form> Hi, Usually I only have 1 "<form method = "post" action = "next.asp"> " in a .asp page to "POST" data . If i went to have more than 1 "<form method = "post" > " in a .asp page, how do i do that? e.g. I have 2 forms that i need to use "POST" to 2 different .asp page. thanks <form> tag to your page. You can have as may <form> elements in the body as you like. <body> <form method = "post" action = "page1.asp"> . . . < / form> <form method = "post" action = "page2.asp"> . . . < / form> <form method = "post
Please post this thread a correct full method, method about Excel Nast Runsome Customer Service Microsoft Corporation Subject: Please post this thread a correct full method, method about text-hovering in Microsoft Office Excel 2003. Dear, Customer Service: Please post this thread a correct full method, method about text-hovering in Microsoft Office Excel 2003. Drawing of .xls sheet in the
POST method variables? Hi I need to retrive some values which was sent to my page by another page trough "POST" method. *the sender page which sends variables to mypage.aspx is on different server I mean other page has somehing like this : <form method = "post" action = "mypage.aspx"> <input type = "text" name = "price" value = "100"> . . . . . . . . < / form> How can I get of "price" in my .aspx.cs file? Thanks You can get the value of the post variable using the Request object: string price = Request["price"]; If you are using POST method you normally use Request.Form("<yourval") If you use GET use Request.QueryString("<yourval