vibhaJ 126 Master Poster

You need SMTP server..
Even if you have live SMTP server's credentials you can send mail via that also.
Check this phpmailer link. http://phpmailer.worxware.com/index.php?pg=examplebgmail

vibhaJ 126 Master Poster

Check this post that how string concatenation works in PHP.
http://www.daniweb.com/web-development/php/threads/369623/1588766#post1588766

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

you can have one table for storing user_id and post_id.
When user vote any post there will be entry in that table and if there is any entry vote up-down arrow will not be shown for that post.

vibhaJ 126 Master Poster

I think you can not download multiple file at a once.
You can zip all files in one zip file and then download that zip file.
That is best solution.

vibhaJ 126 Master Poster

Debug all values.
I think size[0] is zero or blank.

echo '<br />$size[1] ->'.$size[1];
echo '<br />$size[0] ->'.$size[0];
echo '<br />$width ->'.$width;
exit;
$h = number_format(($size[1] / $size[0]) * $width, 0, ',', '');
vibhaJ 126 Master Poster

I think your $refnum is comming blank or invalid.
Echo this query and run it in phpmyadmin.

echo $sql = "UPDATE `order` SET `receiver_tel`  = '".$recetel."' WHERE `reference_num`  = '".$refnum."'" ; exit
mysql_query($sql);
vibhaJ 126 Master Poster

Didn't understand the logic of writing echo "0__notice__Email is empty."; and expecting Email is empty as output. Can u explain..

vibhaJ 126 Master Poster

If you can post your complete code then anyone can test at their end.

vibhaJ 126 Master Poster

I have created some demo kind of code.
Check this may be this will give you some info.

<? session_start();
   $array = $_SESSION['array'];

    if (isset($_GET['id']))
	{
		if (isset($_SESSION['array']))
		{
	    	if(!array_key_exists($_GET['id'], $array))
	    	{ 
				$array[$_GET['id']] = array( 
                                            "name" =>'vibha'
							   );	
			}
			 
		}
		else
		{
	    	$addarray = array($_GET['id'] => array( 
                                            "name" =>'vibha'
							   ));	
		    $array = $addarray;							    
		}
		unset($_SESSION['array']);		
		$_SESSION['array'] = $array;
    }
	echo '<pre>';
	print_r($_SESSION['array']);

?>
vibhaJ 126 Master Poster

It may be because of un paired { or }.
Post complete code.

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

I am using phpmailer.
http://phpmailer.worxware.com/

vibhaJ 126 Master Poster

Below is logic which i am using.
- there is one table having fead url along with last feed date.
- second table is feeded data along with inserted date.

So when you want to show feed data check last feed date in first date if it is today's date then you can directly use second table to display data.

But if last feed date is tomorow then you need to parse that feed url and save all data in second table and display from second table.

vibhaJ 126 Master Poster

Not sure but if you have written.

include(include_fns.php);

then try below and check.

include('include_fns.php');
vibhaJ 126 Master Poster

Below is query.

ALTER TABLE `tbl_name` AUTO_INCREMENT =1000 ;

Once you run this query, next auto id in tbl_name will be 1000.

vibhaJ 126 Master Poster

Also its good practice to write 'header' after php logical code.
So you can replace below code

echo "<script language='javascript' type='text/javascript'>
            location.href = 'cash_transactions.php?msg=".$message."';
         </script>";

with

header("location:cash_transactions.php?msg=".$message);
exit;
vibhaJ 126 Master Poster

You don't require : between date and time.
i.e $requested=date("d/m/y : H:i:s", time());
should be
$requested=date("d/m/y H:i:s", time());

vibhaJ 126 Master Poster

Simplest way to debug is take your output query and run in phpmyadmin, you will get some idea of error.

$query = "INSERT INTO *********** (time, ad1) VALUES ('$FileName','$topnow')";
mysql_query($query) or die('Error, insert query failed.<br />Run this query in phpmyadmin:'.$query);
vibhaJ 126 Master Poster

session_start(); must be on top of page. i.e. there should not any echo ot HTML code above session_start(); function.
And php code should be also at top and then html form, tables. Its not necessary but its a good practice.
You forget to add action=" in form.

vibhaJ 126 Master Poster

Check also this:

RewriteCond %{REQUEST_URI} !/forum
vibhaJ 126 Master Poster
IIM commented: helpful +4
vibhaJ 126 Master Poster
<?
	if($row_rs_details['image_main'] == "")
		$src = 'propertyimages/dot.gif';
	else
		$src = $row_rs_details['image_main'];
?>
<img src="<?php echo $src ?>" width="240" height="160" border="0" />
vibhaJ 126 Master Poster

Try this code.

$name = "vibha";	
echo str_replace('$name',$name,$description); // $description is database value
vibhaJ 126 Master Poster

Is your both table have one to one mapping OR one to many mapping?
Also you should have primary key in both table.

If one to one mapping then check below query in phpmyadmin.

select * from account LEFT JOIN account_details ON account.account_number = account_details.account_number
vibhaJ 126 Master Poster

Which IE you are using?
I have checked in IE9,IE8,IE7.
Also check once in some another PC.

vibhaJ 126 Master Poster

phpmailer is best solution.
You can give your excel fle path to AddAttachment function.

Here is a link. http://phpmailer.worxware.com/index.php?pg=examplebsendmail

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

Your code didnt work for me..
Try this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>ToolTips Example</title>
		<style type="text/css">
		.tooltip {
			border-bottom: 1px dotted #000000; color: #000000; outline: none;
			cursor: help; text-decoration: none;
			position: relative;
		}
		.tooltip span {
			margin-left: -999em;
			position: absolute;
		}
		.tooltip:hover span {
			border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; 
			box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
			font-family: Calibri, Tahoma, Geneva, sans-serif;
			position: absolute; left: 1em; top: 2em; z-index: 99;
			margin-left: 0; width: 250px;
		}
		.tooltip:hover img {
			border: 0; margin: -10px 0 0 -55px;
			float: left; position: absolute;
		}
		.tooltip:hover em {
			font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
			display: block; padding: 0.2em 0 0.6em 0;
		}
		.classic { padding: 0.8em 1em; background: #FFFFAA; border: 1px solid #FFAD33; }		
		</style>
	</head>
	<body>		

		<p>
        <a class="tooltip" href="#">Classic<span class="classic">Mouse Over</span></a>
        </p>

	</body>
</html>
vibhaJ 126 Master Poster

You need to JOIN query for both table.
Post your table structure.

vibhaJ 126 Master Poster

Try this.

RewriteEngine On
RewriteRule ^user=([^=]*)$ /profile.php?user=$1 [L]
diafol commented: nice +13
vibhaJ 126 Master Poster

Other than API you can use phpmailer class and add addresses as bcc in email.

vibhaJ 126 Master Poster

Try this recursive function.

<?
function directoryToArray($directory, $recursive) {
	$array_items = array();
	if ($handle = opendir($directory)) {
		while (false !== ($file = readdir($handle))) {
			if ($file != "." && $file != "..") {
				if (is_dir($directory. "/" . $file)) {
					if($recursive) {
						$array_items = array_merge($array_items, directoryToArray($directory. "/" . $file, $recursive));
					}
					$file = $directory . "/" . $file;
					$array_items[] = preg_replace("/\/\//si", "/", $file);
				} else {
					$file = $directory . "/" . $file;
					$array_items[] = preg_replace("/\/\//si", "/", $file);
				}
			}
		}
		closedir($handle);
	}
	return $array_items;
}
$arr = directoryToArray('.',true);
echo '<pre>';
print_r($arr );
?>
vibhaJ 126 Master Poster

I haven't tried but exec may help you.

exec('/etc/init.d/httpd graceful');
vibhaJ 126 Master Poster

Hi All,

I have checked some available functions for error handling in php.
But i didn't reach to goal.

I want any php error to be shown on custom page.
e.g. if there is comma missing and system throw Parse error: syntax error, unexpected T_VARIABLE on the browser, can i create one error.php in proper design and show error message there.
Please guide friends.

Thanks.

vibhaJ 126 Master Poster

You can also have one single ajax function and pass both user and sex parameter on ajax request.

<html>
<head>
<script type="text/javascript"> 
function showUser() 
{ 
	var users = document.getElementById('users').value;
	var sex = document.getElementById('sex').value;
	
	  if (users=="" && sex=="")
	  {
		document.getElementById("txtHint").innerHTML="";
		 return;
	  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getuser.php?users="+users+"&sex="+sex,true);
xmlhttp.send();
}
 </script>
</head>
<body>
<form>
  <select name="users" id="users" onChange="showUser()">
    <option value="">Select a person:</option>
    <option value="1">Peter Griffin</option>
    <option value="2">Lois Griffin</option>
    <option value="3">Glenn Quagmire</option>
    <option value="4">Joseph Swanson</option>
  </select>
  
<select name="sex" id="sex" onchange="showUser()">
<option value="">Male/Female:</option>
<option value="1">All</option>
<option value="2">Male</option>
<option value="3">Female</option>
</select>
</form>
<br />
<div id="txtHint"><b>Person info will be listed here.</b></div>
</body>
</html>

On php side you have two variable GET. users and sex.
You can create sql query based on that.

vibhaJ 126 Master Poster

Yes.. Try to debug printed sql query in phpmyadmin.

echo $sql = "INSERTO INTO users (username) VALUES (?)"; exit;
vibhaJ 126 Master Poster

if $location = mypic.jpg
and you have store that image under some directory.
e.g. under 'project' folder you have saved image in upload/avatar/mypic.jpg
Then <img src="<?='upload/avatar/'.$location?>"> // if your page is beside upload folder. This is relative path.

vibhaJ 126 Master Poster

Don't repeat thread...
Explain post properly.

vibhaJ 126 Master Poster

Firstly you need to add strong captcha to your form.
Then check this link for checking of email address.
http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/smtpvalidateclassphp/

vibhaJ 126 Master Poster

Try this code.

<?php 
  $i = 0;
    while ($row=mysql_fetch_array($result)){
  ?>
    <tr>
    <form name="form1" action="submitAction.php" method="post">
    <td width="72" ><input type="text" autocomplete=off readonly="readonly" id="ProjectName_<?=$i?>" name="ProjectName<?php echo $row['No'];?>" value="<?php echo  $row['ProjectName'];?>" size="20" style="font-size: 9"></font></td>
    <td width="72" ><input type="text" autocomplete=off readonly="readonly" id="DeviceType_<?=$i?>" name="DeviceType<?php echo $row['No'];?>" value="<?php echo  $row['DeviceType'];?>" size="15" style="font-size: 9"></font></td>
 <td width="64" ><input type="button" value="EDIT!" onclick="removeAlignment(<?php echo $i; ?>);"></font></td>
    <td width="67" style="font-size: 12">
    <select name="action" onchange="submitRequest(<?php echo $i; ?>);">
    <option value=>Ongoing </option>
    <option value="<?php echo $row['ProjectName'];?>">Complete</option>
    <option value="<?php echo $row['No'];?>">Update</option>
    </select>								
    </form>
      </td>
    </tr>
  <?php 
  $i++;
  }
  ?>
  
  <script language="JavaScript">
  function removeAlignment(id){
    document.getElementById("ProjectName_"+id).removeAttribute("readonly",0);
	document.getElementById("DeviceType_"+id).removeAttribute("readonly",0);
  }
</script>
vibhaJ 126 Master Poster

You want to show image on profile page or message page?
You have written image code.What is the problem?
echo "<img src='$location' width='100' height='100'>";
For src you have to give either relative path to image or absolute path.

vibhaJ 126 Master Poster
// select from database and assign it in some variable
if($key == $res['years']) // compare it with looping $key
	$checked = 'checked="checked"';
else
	$checked = '';
<input type="checkbox" name="years[]" <?php echo $checked; ?>  id="years" value="<?php echo $key; ?>"  >
vibhaJ 126 Master Poster

Error is not because of $Title, its because of $_POST.
Write if condition as shown below.

if(isset($_POST['title']))
	$Title = $_POST['title'];

Also you can use error_reporting function to rid of errors.

karthik_ppts commented: yes +5
vibhaJ 126 Master Poster

@ardav: I have made one file and one directory hidden by right click and changing property to hidden.
And used exec to read file/folder attributes in PHP as shown in above post..
exec('attrib '.$path)

vibhaJ 126 Master Poster

Ohh..
i have checked only for hidden folder. Below is the complete code for files and folder both.
I have checked in win7 and its working. Try in your PC.

<?php

 function getDirectoryList ($directory)  
  { 

	// create an array to hold directory list 
	$results = array(); 

	// create a handler for the directory 
	$handler = opendir($directory); 

	// open directory and walk through the filenames 
	while ($file = readdir($handler)) { 

	  // if file isn't this directory or its parent, add it to the results 
	  if ($file != "." && $file != "..") { 
	  	$str = $directory.'\\'.$file;
		$out = trim(exec('attrib '.$str));		
		$ar = explode($directory,$out);		
		$temp = explode(' ',trim($ar[0]));		
		if(!in_array('H',$temp))
		$results[] = $file; 
	  } 

	} 

	// tidy up: close the handler 
	closedir($handler); 

	// done! 
  return $results; 

  } 
  $array_1=getDirectoryList("C:\wamp\www\\test"); // add your path here

  
 foreach($array_1 as $value) 
 { 
 echo "<br/>".$value; 
 }
?>

Replace your directory path.

vibhaJ 126 Master Poster

This code works in windows.
I have used exec function to run attrib command to check type of file.
In linux os attrib won't work.

<?php

 function getDirectoryList ($directory)  
  { 

	// create an array to hold directory list 
	$results = array(); 

	// create a handler for the directory 
	$handler = opendir($directory); 

	// open directory and walk through the filenames 
	while ($file = readdir($handler)) { 

	  // if file isn't this directory or its parent, add it to the results 
	  if ($file != "." && $file != "..") { 
	  	$str = $directory.'\\'.$file;
		$out = trim(exec('attrib '.$str));
		$start = substr($out,0,1);
		if($start != 'H')
		$results[] = $file; 
	  } 

	} 

	// tidy up: close the handler 
	closedir($handler); 

	// done! 
  return $results; 

  } 
  $array_1=getDirectoryList("C:\wamp\www\\test"); 

  
 foreach($array_1 as $value) 
 { 
 echo "<br/>".$value; 
 }
?>

Try this and let me know if it works.

vibhaJ 126 Master Poster

Also always try to habit of mysql_error so once there is something wrong with query your code wont execute further.

$rs=mysql_query($sql) or die( '<br /><strong>Your Query: </strong>'.$sql.'<br /><br /><strong>Error: </strong>'.mysql_error());
vibhaJ 126 Master Poster

NP karthik :)

vibhaJ 126 Master Poster

Its good idea,
But in India we can't send sms this way. :(