vibhaJ 126 Master Poster

With form ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
	/* CREATE TABLE `tbl_hindi` (
	  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;
	
	INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर'); */
	
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	if(isset($_POST['save']))
	{
		$sql = "insert into tbl_hindi values ('".$_POST['data']."')";
		mysql_query($sql);
	}
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);		
		
?>
<form  method="post">
<table width="900%" border="0">
  <tr>
    <td>Add New : <input type="text" name="data" size="20" />
<input type="submit" name="save" value="Save" /></td>
  </tr>
  <tr>
    <td>-----------------------------</td>
  </tr>
  <tr>
    <td><strong>Hindi Data</strong></td>
  </tr>
  <? while($sar = mysql_fetch_assoc($res)) { ?>
  <tr>
    <td><?=$sar['data'];?></td>
  </tr>
  <? } ?>
</table>
</form>
</body>
</html>
diafol commented: nice one - like it +13
vibhaJ 126 Master Poster

Post complete loop code.
There should be something wrong in loop only.

vibhaJ 126 Master Poster

Okay dude..
This is with form code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	if(isset($_POST['save']))
	{
		$sql = "insert into tbl_hindi values ('".$_POST['data']."')";
		mysql_query($sql);
	}
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);		
		
?>
<form  method="post">
<table width="900%" border="0">
  <tr>
    <td>Add New : <input type="text" name="data" size="20" />
<input type="submit" name="save" value="Save" /></td>
  </tr>
  <tr>
    <td>-----------------------------</td>
  </tr>
  <tr>
    <td><strong>Hindi Data</strong></td>
  </tr>
  <? while($sar = mysql_fetch_assoc($res)) { ?>
  <tr>
    <td><?=$sar['data'];?></td>
  </tr>
  <? } ?>
</table>
</form>
</body>
</html>
dalip_007 commented: fabulous , awsome , thanks +3
vibhaJ 126 Master Poster

I have tried with following php code to insert hindi data.
And also using phpmyadmin tab.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	$sql = "insert into tbl_hindi values ('कंप्यूटर कंप्यूटर ')";
	mysql_query($sql);
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	while($sar = mysql_fetch_assoc($res))
	{		
		print_r($sar);
	}
?>
vibhaJ 126 Master Poster

Below is mysql code.

CREATE TABLE `tbl_hindi` (
  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');

Below is PHP code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	mysql_query("SET NAMES utf8"); 
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	$sar = mysql_fetch_assoc($res);
	echo $sar['data'];
?>
</body>
</html>

I didnt get why this is not working for you.
See attached image, it works for me.

vibhaJ 126 Master Poster

thank-you.html is in form action so page is redirecting to there.

vibhaJ 126 Master Poster

Your loop is messy.
This code shows simple looping for showing data in tabular form.

<?php
 $username="root";
 $password="";
 $database="";

 mysql_connect('localhost',$username,$password);
 @mysql_select_db($database) or die( "Unable to select database");
 $query="SELECT * FROM jokes";
 $result=mysql_query($query);

 echo '<table width="900%" border="0">';
 while($sar = mysql_fetch_assoc($result))
 {
 	echo '<tr>
    <td>'.$sar['name'].'</td>
    <td>'.$sar['content'].'</td>
  </tr>';
 }
 echo '</table>';
 mysql_close();
 ?>
vibhaJ 126 Master Poster

There are so many jquery form validations available, Check this both if anyone match your needs.
http://www.raymondselda.com/php-contact-form-with-jquery-validation/
http://webcloud.se/log/Form-validation-with-jQuery-from-scratch/#demo-form

vibhaJ 126 Master Poster

Firstly you need to log some table data to compare in future.
Lets say primary key of table.
Create one table table_log which will have all primary key.

tbl_log:
id primary_key datetime
1 12,13,14,16,19,20,21 timestamp
2 12,13,14,19,20,21,22,23 timestamp

Now make one php script which will be set in cron job.
Task of php script is as below:
It takes last entry from table_log and export primary_key by ','
Then make a loop to compare with existing table primary_key.
Based on that you can check whether record is deleted or added and you can make an email for that.
Lastly take all primary key from you table and implode it and insert into table table_log for next compare.

vibhaJ 126 Master Poster

Can you try this code?

echo 'Query:'.$sql = "SELECT * FROM Products";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
	echo $row['Description'] . " " . $row['Price'] . " " . $row['Quantity'];
	echo "<br />";
}
vibhaJ 126 Master Poster

You can make changes according to your database.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	$sql = "select student_name,student_sirname from student";

	// Query Database	
	$filename = 'file.csv';		
	$rsSearchResults = mysql_query($sql) or die(mysql_error());
	
	$out = '';
	
	// fiels to export
	$out .='Student Name,Sirname';
	$out .="\n";
	
	// Add all values in the table
	while ($l = mysql_fetch_array($rsSearchResults)) {
	for ($i = 0; $i < 2; $i++) {
	$out .=''.$l["$i"].',';
	}
	$out .="\n";
	}
	// Output to browser with appropriate mime type
	header("Content-type: text/x-csv");	
	header("Content-Disposition: attachment; filename=$filename");
	echo $out;
	exit;	
?>
vibhaJ 126 Master Poster

Sorry last attachment was incorrect.

vibhaJ 126 Master Poster

Try this demo code.
See attached output image.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>    
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAwoZubRYDwEsxPfeOl798iRS9zaDN-rzK-R-PNcf5yAaJ9r7Z4BTy9LU9DUBfJ7r-F6C7tX-2AidMHQ&sensor=true"
            type="text/javascript"></script>
    <script type="text/javascript">

    function initialize() 
	{
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(23.005, 72.5959), 15);
        map.setUIToDefault(); // will add top menu,left menu etc	
		
		var new_icon = new GIcon();  
		new_icon.image = "images/car_blue.png" ;
		new_icon.size = new GSize(16,16) ; 
		new_icon.iconAnchor = new GPoint(6, 20);
		new_icon.infoWindowAnchor = new GPoint(5,1)  ;		
		var marker = new GMarker(new GLatLng(23.005, 72.5959), new_icon);
		map.addOverlay(marker);
		}		
	}
	 </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 700px; height: 500px"></div>
  </body>
</html>
karthik_ppts commented: helpful post +3
vibhaJ 126 Master Poster

Can you give live link if possible?

vibhaJ 126 Master Poster

Can you replace your code with this.
Also make sure image exists in given path.

var new_icon = new GIcon();  
new_icon.image = "images/car_blue.png" ;
new_icon.size = new GSize(16,16) ; 
new_icon.iconAnchor = new GPoint(6, 20);
new_icon.infoWindowAnchor = new GPoint(5,1)  ;

var marker = new GMarker(point, new_icon);
map.addOverlay(marker);
vibhaJ 126 Master Poster

Your question is pretty unclear.
Do you have problem with matching posted id with table OR dou you want to parse html ?

vibhaJ 126 Master Poster

you need to replace this line.

mysql_query("SELECT*FROM Products='"$result"'");

to

$result = mysql_query("SELECT * FROM Products");
vibhaJ 126 Master Poster

Replace this much code and check whether all three values are coming correct or not.
If its correct that means code is right and problem is in mysql credentials.

function DBLogin()
{
echo '--host--'.$this->db_host.'--username--'.$this->username.'--pwd--'.$this->pwd;
$this->connection = mysql_connect($this->db_host,$this->username,$this->pwd);
vibhaJ 126 Master Poster

Can you post your whatsoever code for review.

vibhaJ 126 Master Poster

Here is a code for date difference you can use $days and save it in your database.

<?
	$duedate = '2011-04-29';
	$currdate = date('Y-m-d');
	
	$date1 = $duedate;
	$date2 = $currdate;
	
	$diff = abs(strtotime($date2) - strtotime($date1));
	
	$years = floor($diff / (365*60*60*24));
	$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
	$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
	
	echo "Difference is $years years, $months months, $days days.";
?>
vibhaJ 126 Master Poster

What is the code to save the last url? Thanks!

This is the simplest way to save current page url.
<?
	$_SESSION['sess_currPageName'] = basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'];
?>

Agree to ardav, i also prefer ajax than iframe.
As in ajax all controls are in your hand.

vibhaJ 126 Master Poster

If iframe's search page is your php code then you can make a session and save last url in that session.
When page is loaded or refreshed you can use session's remembered url as a src of iframe.

vibhaJ 126 Master Poster

ics file is sort of xml structure.
You can find xml php parser or xmltoarray function like this and then can save its value in mysql database.

vibhaJ 126 Master Poster

You can use mysql_real_escape_string function for filtration.
Refer this link.http://in2.php.net/manual/en/function.mysql-real-escape-string.php

vibhaJ 126 Master Poster

You can not get it in urgency.
First you have to refer 2 or 3 matching sites like naukri, monster.
Then you can discuss with your client and decide your required modules.
You can simultaneously design database and can start working on admin panel.

vibhaJ 126 Master Poster

Change your update query to below code:

$sql = "UPDATE oocust SET
 tax = '" . mysql_real_escape_string($tax) . "',
 amtdue = '" . mysql_real_escape_string($amtdue) . "',
dayslate = '" . mysql_real_escape_string($dayslate) . "'
 WHERE id='".$id."'";
vibhaJ 126 Master Poster

1) Why there is two time mysql_connect
2) what is $data, it is nevwe defined above code.

$taxrate = $_POST['taxrate'];
  echo "taxrate " . $data['taxrate'];

3)there should be some variable which hold mysql_fetch_assoc result.

mysql_fetch_assoc(mysql_query($query));

4) so finaly

<?php
  mysql_connect("localhost", "root", "");
  mysql_select_db(numbersdb) or die("Unable to select database");
  
  $query = "SELECT taxrate FROM numbdata ";
  $result = mysql_fetch_assoc(mysql_query($query)); 
  $taxrate = $result['taxrate'];
  echo "taxrate " . $taxrate;  
 
  $query = "SELECT id, tax,charges,datediff(curdate(),duedate) AS dayslate FROM oocust WHERE pd = ' '"; 
  $result = mysql_query($query);
  while ($row = mysql_fetch_array($result))
  {
      $id = $row['id'];
      $amtdue = $row['amtdue'];
      $shipamt = $row['shipamt'];
      $charges = $row['charges'];
      $tax = $charges * $taxrate;
      $amtdue = $charges + $tax + $shipamt;
      echo "tax is $tax <br /><br />";
      $days_late = ($row['dayslate'] > 0) ? $row['dayslate'] : 0;
      $sql = "UPDATE oocust SET tax = " . $tax . ", amtdue = " . $amtdue . ", dayslate = " . $days_late . " WHERE 
id='$id'";
      mysql_query($sql);
      $err = mysql_error();
      if ($err != "")
      {
          echo "Error in $sql: $err\n";
      }
  }
  echo "Invoice Prep completed";
?>
vibhaJ 126 Master Poster

Export your table structure and post it here.
I will give you code.

vibhaJ 126 Master Poster

This is because you may have incorrect data in query output.
comment all header lines and check mysql_fetch_row is returning proper output or not?
Also check all list function arguments.

while(list($name,$sirname)=mysql_fetch_row($result))
vibhaJ 126 Master Poster

Use array [] in check box name in form as shown below.

Orders
    <input name="orders[]" type="checkbox" value="One" /> One
    <input name="orders[]" type="checkbox" value="Two" /> Two
    <input name="orders[]" type="checkbox" value="Three" /> Three

Then you need to change php code:

<?php
$name = $_POST['name'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$orders = $_POST['orders'];

mysql_connect("localhost", "root","") or die ('Error: '. mysql_error());
mysql_select_db("store");

if(count($orders)>0)
{
	foreach($orders as $key=>$order)
	{
		$query="INSERT INTO orders (id, name, address, phone, custorder) VALUES ('NULL','".$name."','".$address."','".$phone."','".$order."' )";
		mysql_query($query) or die ('Error Updating the Database' . mysql_errno());		
	}
	echo "Order Successfully Placed";
}
else
	echo "No Orders";
?>
vibhaJ 126 Master Poster

This is because default timezone for mysql and php is different.
Check here for mysql timezone and here for php timezone.

vibhaJ 126 Master Poster

This is simple code for exporting student table to excel.
Hope this helps you.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	$sql = "select name,sirname from student";

	// Query Database
	$result=mysql_query($sql);
	$filename = 'file.xls';
		
	// Send Header
	header("Pragma: public");
	header("Expires: 0");
	header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
	header("Content-Type: application/force-download");
	header("Content-Type: application/octet-stream");
	header("Content-Type: application/download");;
	header("Content-Disposition: attachment;filename=$filename");
	header("Content-Transfer-Encoding: binary ");
	
	// XLS Data Cell
	
	xlsBOF();	  
	xlsWriteLabel(0,0,"Name : ");
	xlsWriteLabel(0,1,"Sirname :");
   
	$xlsRow = 1;
	while(list($name,$sirname)=mysql_fetch_row($result)) 
	{		
		++$i;
		xlsWriteLabel($xlsRow,0,"$name");
		xlsWriteLabel($xlsRow,1,"$sirname");                         
		$xlsRow++;
	}
	xlsEOF();
	exit();

function xlsBOF() {
    echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);  
    return;
}

function xlsEOF() {
    echo pack("ss", 0x0A, 0x00);
    return;
}

function xlsWriteNumber($Row, $Col, $Value) {
    echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
    echo pack("d", $Value);
    return;
}

function xlsWriteLabel($Row, $Col, $Value ) {
    $L = strlen($Value);
    echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
    echo $Value;
return;
} 

?>
vibhaJ 126 Master Poster

Below is mysql code.

CREATE TABLE `tbl_hindi` (
  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');

Below is PHP code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	mysql_query("SET NAMES utf8"); 
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	$sar = mysql_fetch_assoc($res);
	echo $sar['data'];
?>
</body>
</html>
vibhaJ 126 Master Poster

ckeditor is one of the mostly used editor.
check here demo
And see fourth tab (Custom toolbar)
All editor icons are customized, you can change configuration based on requirement.

vibhaJ 126 Master Poster

I am using that on http://www.pdfsearchmachine.com

Hey it is working on this link now.
What was issue?

vibhaJ 126 Master Poster

Hey.. m not bro.. m sis :)

ok,bro ,Thanks doing that

vibhaJ 126 Master Poster

Hope you are using proper Application id.
It is different for individual sites.
http://developer.yahoo.com/faq/#appid

vibhaJ 126 Master Poster

I wonder the other website http://pdf-download-engine.com uses same query and it works

You have to debug it and find the reason.
There is no rocket science.
So i told you to upload my last code on live so that i can debug.

vibhaJ 126 Master Poster

Place this code and upload it on live.
I want to see result on live.

$search = urlencode($_GET["search"]);
$rs = $rss->get("http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=$search");
echo '$rs IS ==><br />'; 
print_r($rs);
exit;
vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

Try this

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
<?

$search = urlencode($_GET["search"]);
 
if ($rs = $rss->get("http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=$search")) 
{  
	// Go through the list powered by the search engine listed and get the data from each <item>
	$colorCount="0"; 
	if(count($rs['items']) >0)
	{
		foreach($rs['items'] as $item) 
		{  
			// Get the title of result 
			$title = $item['title']; 
			// Get the description of the result 
			$description = $item['description']; 
			// Get the link eg amazon.com 
			$urllink = $item['guid']; 
			if($colorCount%2==0)
			{
				$color = ROW1_COLOR;
			}
			else
			{
				$color = ROW2_COLOR;
			}		
			include "resulttemplate.php";
			$colorCount++;
			echo "\n"; 
	 
		}  
	}
	else
	{
		echo "No items in result";exit;
	}
}
else
{
	echo "No result in RSS parser";exit;
}
?>

M considering you have proper RSS reader class.

vibhaJ 126 Master Poster

Previously i have explained you reason for foreach error.
Also as i said your given API string is not working for me.

Here is API link i found for yahoo.
http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=yahoo

You can find more parameter options here.
http://developer.yahoo.com/search/web/V1/webSearch.html

vibhaJ 126 Master Poster

$myQueryVar1 = mysql_query("DELETE FROM mytable1 WHERE id='$idExecuted'");
$myQueryVar2 = mysql_query("DELETE FROM mytable2 WHERE id='$idExecuted'");
$myQueryVar3 = mysql_query("DELETE FROM mytable3 WHERE id='$idExecuted'");
$myQueryVar4 = mysql_query("DELETE FROM mytable4 WHERE id='$idExecuted'");
$myQueryVar5 = mysql_query("DELETE FROM mytable5 WHERE id='$idExecuted'");

The above code is right and should work.
What is problem you are facing.

vibhaJ 126 Master Poster

Yup..
Your logic is absolutely right. :)

vibhaJ 126 Master Poster

tomato is right.
If field is integer then you can direct use php variable but here you have to use single quote.

vibhaJ 126 Master Poster

I think you need ajax.Reason is below.
let you have a result in frame-1.
Once you submit form page is refreshed.
So even your next target is frame2, your frame1 data will be cleared because of second form submit.

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

If you dont want to use database then you can use one simple txt file for lock and unlock.
If master login add text in txt file as 'ON'. Make it 'OFF' when logout.
If slave login then read txt file, if it is 'ON' then only slave can login.

vibhaJ 126 Master Poster

For php error,
Always put foreach in if condition.

if(count($rs['items'])>0)
{
	foreach($rs['items'] as $item) 
	{ 
		//--- code---
	}
}
else
{
	echo 'There is no items...';
}

And for URL there are some php variables in url like $search.
Check the string generated (output of php code) in the one you have used in another site.

vibhaJ 126 Master Poster

svilla is right.
Can you please use CODE tags now onwards...