vibhaJ 126 Master Poster

this is comman file, which will be included in your all php files.So you dont have to write this files code in all files.

vibhaJ 126 Master Poster

mapping means relation.
e.g.
tbl_upload => id,title,date,image, author_id
tbl_author => id, author

Here author_id from tbl_upload is foreign key from tbl_author's id.

Even above code should display authors.
check SELECT * FROM `tbl_author` query with phpmyadmin. Is table have any records?

vibhaJ 126 Master Poster

Try below code.
But why r u fetching all data from tbl_author table?
There should be some mapping between tbl_upload and tbl_author.

<html>
<body>
<form method=post action="find.php">
	<h2>Search For:</h2>
	<p> Academic Year :
		<input type=text name=search size=9 maxlength=9>
	<p>
		<input type=submit name=submit value=List>
		<input type=reset name=clear value=cancel>
</form>
</body>
</html>
<?php

if(isset($_POST['submit']))
{
	include 'conn.php';
	
	$search=$_POST['search'];
	$sy=explode('-',$search);
	
	
	$result = mysql_query ("SELECT * FROM `tbl_upload` WHERE (`year` >= $sy[0] AND `year` <= $sy[1])");
	echo '<h2>Result</h2>';
	if (mysql_num_rows($result) > 0) 
	{ 
		while($row = mysql_fetch_array($result))
		{
	
			  echo "<b>Title:</b>"; 
			  echo '<a href="">'.$row["title"].'</a>'; 
			  echo "<br>";
	
			  $result2 = mysql_query ("SELECT * FROM `tbl_author`");
			  if ($row2 = mysql_fetch_array($result2)) 
			  {
			  		echo "<b>Author:</b>"; 
					echo $row2["author"]; 
					echo "<p>";
			  }
		}						
	} 
	else 
	{
		echo 'Sorry, no records were found!';
	}   

}

?>
vibhaJ 126 Master Poster

use button element instead of submit.
Then your js function will run.

<form id="form1" name="form1" method="post" action="PaymentFormProcess.php">
    <table width="80%" align="center">
      <tr>
        <td width="43%"><strong>Do you accept these terms and conditions?</strong></td>
        <td width="29%" align="right"><p>
          <label>
            <input type="radio" name="TermsConditions" value="Accept" id="TermsConditions_0" />
            I Accept</label>          
        </p></td>
        <td width="28%" align="right"><label>
          <input type="radio" name="TermsConditions" checked="checked" value="Decline" id="TermsConditions_1" />
          I do not Accept</label>
        </td>
      </tr>
</table>
    <label for="ConfirmBooking">Confirm Booking:</label>
            <input type="button" name="ConfirmBooking" id="ConfirmBooking" value="Confirm Booking" onclick="Accept()" />      
    </form>
vibhaJ 126 Master Poster

It supports :
Video Formats: H.264 (.mp4, .mov, .f4v), FLV (.flv), 3GPP (.3gp, .3g2), YouTube
Sound Formats: AAC (.aac, .m4a), MP3 (.mp3)
Image Formats: JPEG (.jpg), PNG (.png), GIF (.gif)

Playlist link : http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/24/creating-a-playlist

I have created itunes like web based playlist using this only.
You need to surf longtailvideo's forums and help for your exact requirement.

vibhaJ 126 Master Poster

Try with jw player.
I am already using it in one my website, there are vast modification you can do with it using javascript.

vibhaJ 126 Master Poster

Okay.. it is working? gr8.

vibhaJ 126 Master Poster

Lets debug code.

<?
	function ClubGDC($userid)
	{
		$gdcarray = array();
		$query = "SELECT * FROM members WHERE access < 300 AND status='Active'";
		$query .= "AND group!= 1 AND group!= 234 AND group!= 99999999999 AND group!= 199 AND group!= 228 ";
		$query .= "AND id = $userid";
		$q = mysql_query($query);	
		echo '<br />Query:'.	$query;
		while($row = mysql_fetch_array($q))
		{
			$gdcarray[] = $row["group"];	
			echo '<br />group:'.$row["group"];		
		}
		return $gdcarray;		
	}
	
	$gdcarray1 = ClubGDC(54);
	//print_r($gdcarray1);
?>

Check this code and test if $query is returning proper output.
post your printed output.

vibhaJ 126 Master Poster
while($row = mysql_fetch_array($q))
	{
		$gdcarray[] = $row["group"];
		$i2++;
	}

Try to replace while loop with above code.

vibhaJ 126 Master Poster

index.php

<!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" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="content-language" content="zh-HK" />
	<title>Cantab Education: Timetable</title>
	<script type="text/javascript">
		function showCourse(string,key)
		{
			if (string == "") {
				document.getElementById("dynamic_display").innerHTML = "";
				return;
			}
						
			if (window.XMLHttpRequest) {
				xmlhttp = new XMLHttpRequest();
			} else {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
					document.getElementById("dynamic_display").innerHTML = xmlhttp.responseText;
				}
			}

			xmlhttp.open("GET", "search.php?key="+ key +"&search=" + string, true);
			xmlhttp.send();
		}
	</script>
    <style type="text/css">
		body {
			font-size: 0.75em;
			margin: 0px;
			padding: 0px;
		}
		
		table#search {
			border-collapse: collapse;
			margin: auto;
			width: 956px;
		}
		table#search tr th {
			border: solid #000000 1px;
		}
		
		table#results {
			border-collapse: collapse;
			margin: auto;
			width: 956px;
		}
		table#results tr th {
			background-color: #00561c;
			border: solid #000000 1px;
			color: #ffffff;
		}
		table#results tr td {
			border: solid #000000 1px;
			text-align: center;
		}
	</style>
</head>
<body>
	<form>
		<table id="search">
            <tr>
                <th>
                	<select name="subject" onchange="showCourse(this.value,'Subject');">
                    	<option selected="selected" value="">Subject:</option>
                        <option value="A%20Math">A Math</option>
                        <option value="BAFS(A)">BAFS(A)</option>
                        <option value="BAFS(Acc)">BAFS(Acc)</option>                       
                    </select>
                </th>
                <th>
                	<select name="tutor" onchange="showCourse(this.value,'Tutor');">
                		<option selected="selected" value="">Tutor:</option>
                		<option value="A.%20Yiu">A. Yiu</option>
                		<option value="Alan%20x%20Cars">Alan x Cars</option>
                		<option value="Ally">Ally</option>                		
                	</select>
                </th>
                <th>
                	<select name="level" onchange="showCourse(this.value,'Level');">
                		<option selected="selected" value="">Level:</option>
                		<option value="Form%201">Form 1</option>
                		<option value="Form%202">Form 2</option>
                		<option value="Form%203">Form 3</option>                		
                	</select>
                </th>
                <th>
                	<select name="center" onchange="showCourse(this.value,'Primary Center');">
                		<option selected="selected" value="">Center:</option>
                		<option value="Causeway%20Bay">Causeway Bay</option>
                		<option value="Fo%20Tan">Fo Tan</option>
                		<option value="Hung%20Hom">Hung Hom</option>                		
                	</select>
                </th>
            </tr>
    	</table>
    </form>
    <div id="dynamic_display"></div>
</body>
</html>

search.php

<?php
	require_once('MagicParser.php');	
	$counter = 0;
	$limit_results = 1000;
		
	$key = $_GET['key'];
	$search = $_GET['search'];
vibhaJ 126 Master Poster

Okay. Do you want Subject, Tutor, Level drop down values after form submit?
Your ajax portion is replacing dynamic_display inner HTML.which is outside of form.

vibhaJ 126 Master Poster

Here is complete code what you need.
Hope it will help you.

<?php

	if(isset($_REQUEST['calculate']))
	{
		$temp1 = explode('/',$_REQUEST['date1']);
		$date1 = mktime(0,0,0,$temp1[0],$temp1[1],$temp1[2]);
		
		$temp2 = explode('/',$_REQUEST['date2']);
		$date2 = mktime(0,0,0,$temp2[0],$temp2[1],$temp2[2]);
		
		$dateDiff = $date2 - $date1;
		$fullDays = floor($dateDiff/(60*60*24));
		$fullHours = floor(($dateDiff-($fullDays*60*60*24))/(60*60));
		$fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60);
		$answer = "Differernce between date2 and date1 is :  $fullDays days, $fullHours hours and $fullMinutes minutes.";
	}
?>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form method="post">
date1 : <input name="date1" type="text" value="<?=$_REQUEST['date1'];?>">
date2 : <input name="date2" type="text" value="<?=$_REQUEST['date2'];?>">
<input type="submit" name="calculate" value="calculate">
<br />
<br />
<?php echo $answer;?>
</form>
</body>
</html>
vibhaJ 126 Master Poster

Some points to mention:
-> form tag must always start exact html portion. e.g. in your code form should be above table tag.

<form id="form" name="form" method="get" >
    <table id="search">        
            <tr>

-> Subject select tag is not completed with </select>
-> try method="get" in form. and check how many variables are passed in url.

vibhaJ 126 Master Poster

If user clicks text should be clear and when user blur that field, then text should again come.. this is ideal case.it is not there in above code.

Yes the code you have used and what i do is the same thing, i used jquery.
Jquery is easy way, because you can just give class name or id to textfield.
and in " $(document).ready(function() {" you can point to that.

if code doesn't work for you check that you include jquery.min.js on top of " $(document).ready(function() {".

you can also check error console of browser to find issue.

vibhaJ 126 Master Poster

Here is a example code which uses jquery.

<!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=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script language="javascript">
	$(document).ready(function() {	
		 $("#keyword").val('Enter Your Search Here');		  
		 $("#keyword").bind("focus", function(){
		   if($(this).val() == 'Enter Your Search Here')	   
		   		$(this).val('');		   		
		 });
		 $("#keyword").bind("blur", function(){
		   if($(this).val() == '')	   
		   		$(this).val('Enter Your Search Here');		  
		 });
	});
</script>
</head>

<body>
<input autocomplete="off" id="keyword" name="" style="width:250px;" type="text" />
</body>
</html>

Hope it will help you.

vibhaJ 126 Master Poster

change line #6 to below code:

$path = "<a href=$link?id=".urlencode($id).">Inscripción curso</a>";
vibhaJ 126 Master Poster

If you just wish to display time it is not required to use iframe.
I means, You can also go with JS or AJAX.
What do you think?

vibhaJ 126 Master Poster

-vib
That is not true. When you use something like file_get_content() it does not parse/execute what it reads in. If you included the file then yes it would execute any php in that file.

-Gigs
This appears to me like you're trying to use it for some kind of template system? Where your output has a series of echo statements and you've already set some variables that should be replaced.

ob_start();
include ('lol.php');
$content = ob_get_contents();
ob_end_clean();

echo $content;

That code will include lol.php which will execute any php statements within it and then capture the content to a variable which you can then use at a later time. Is this more what you're trying to accomplish?

The function will not internally parse it.
But lets say i have one php page : http://www.mysite.com/register.php
And i use file_get_contents('http://www.mysite.com/register.php') then html source will be returned by file_get_contents function.

Simply we can have 'View Source' type of functionality.

vibhaJ 126 Master Poster

Ok.. get it.
Try with complete http path.
e.g.
<?php echo file_get_contents("http://localhost/project_name/lol.php"); ?>

vibhaJ 126 Master Poster

If you are referring my attached test.php.
then you will find below code at line # 125

// Test this class
$zipTest = new zipfile();
$zipTest->add_dir("images/");
$zipTest->add_file("photo.png", "images/photo.png");
$zipTest->add_file("logooo.jpg", "images/logooo.jpg");

Thus in add_file function you can pass whatever is your file location.

vibhaJ 126 Master Poster

how could it display php tags? its a scripting language and when you echo it it automatically executed.
Post your exact output if issue is still not solved.

vibhaJ 126 Master Poster

Here i have attached complete code.
This code will get two image file and zip ait and download it.
run test.php file in browser and you will have one zip file.

vibhaJ 126 Master Poster

Here i have attached complete code.
This code will get two image file and zip ait and download it.
run test.php file in browser and you will have one zip file.

vibhaJ 126 Master Poster
echo file_get_contents("./data.php");

code will not display any php tag. It shows HTML output of file data.php.
You want to display php tag also?

vibhaJ 126 Master Poster

i was also having such requirement once.
Then what i have done is:
create zip file of multiple files using php and then download that zip file.
Thus user can have multiple files in one zip.

vibhaJ 126 Master Poster

Below is example to get Google's content.

<?php
$homepage = file_get_contents('http://www.google.com/');
echo $homepage;
?>

Is this what u want?

vibhaJ 126 Master Poster

Here is code for index.php.
check it, hope it is what you want.

<?php
//File Snatcher 2.7
define('_ALLOWINCLUDE',0);
include 'setting.php';
$version = '2.7';
//////////////////////////////////////////////
//Do Not Change Below Here////////////////////
//////////////////////////////////////////////
if (function_exists('curl_init'))
{
	$snatch_system = 'curl';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>File Snatcher <?php echo $version; ?> - &copy; http://noveis.net</title>
</head>
<body>

<div id="main">
<?php
$submit = $_POST['submit'];
if ($submit)
{
	if (isset($password))
	{
		if ($_POST['password'] != $password)
		{
			die('<p><strong>Password incorrect!</strong></p>');
			$error = true;
		}
	}
	
	if (!$defaultDest)
	{
		$defaultDest = 'snatched';
	}
	
	if (!file_exists($defaultDest))
	{
		mkdir($defaultDest);
	}
	
	$sizelimit = $sizelimit * 1024;
	
	$files = $_POST['file'];
	$news = $_POST['new'];
	
	for($i=0;$i<count($files);$i++)
	{
	
	$file = $files[$i];
	$uploadfile = explode('/', $file);
	$filename = array_pop($uploadfile);
	
	$newfilename = $news[$i];
	
	if (!$newfilename)
	{
		$newfilename = $filename;
	}
	
	if (!isset($file))
	{
		echo '<p><strong>Please enter a URL to retrieve file from!</strong></p>';
		$error = true;
	}
	
	if (!isset($newfilename))
	{
		echo '<p><strong>Please enter a new file name!</strong></p>';
		$error = true;
	}
	
	if ($error == false)
	{
		$dest = $defaultDest;
		$ds = array($dest, '/', $newfilename);
		$ds = implode('', $ds);
		$newname_count = 0;
		if (file_exists($ds))
		{
			echo '<p><strong>File already exists!</strong></p>';
			$newname_count++;
			$newfile = array($newname_count, $newfilename);
			$newfile = implode('~', $newfile);
			$newfile_ds = array($dest, '/', $newfile);
			$newfile_ds = implode('', $newfile_ds);
			while($renamed == false)
			{
				if (file_exists($newfile_ds))
				{
					$newname_count++;
					$newfile = array($newname_count, $newfilename);
					$newfile = implode('~', $newfile);
					$newfile_ds = array($dest, '/', $newfile);
					$newfile_ds = implode('', $newfile_ds);
				}
				else
				{
					$renamed = true;
				}
			}
			$newfilename = $newfile;
			$ds = $newfile_ds;
Viruthagiri commented: one word... vibhadevit is awesome +1
vibhaJ 126 Master Poster

Hi,
Check this.
It might help you.

vibhaJ 126 Master Poster

Echo query below and run in sql window.
Does it returning result??

echo "SELECT * FROM albums WHERE userid='".$_SESSION['id']."'";
vibhaJ 126 Master Poster

create one session array.
when user click on link you can pass veh_id to ajax page.
where in ajax page you will add veh_id in session array.
And when user checkout it will use session array.

vibhaJ 126 Master Poster

Advance search depends on your records to be searched.
so first make a list of fields and options which are there in your search result.

vibhaJ 126 Master Poster

Okay. try above code i have posted.

vibhaJ 126 Master Poster

Here when form submitted you can have $max_no_img value.
max_no_img is text field in this code you can make it hidden.
Try this code.

<script type="text/javascript">

function increment(){

	if(!max_no_img)
	{ var max_no_img = document.getElementById('max_no_img').value; }
	
		max_no_img++;
		document.getElementById('max_no_img').value = max_no_img;
		return max_no_img;
	
}
</script>

<?
$max_no_img=2; // Maximum number of images value to be set here
echo "<form method=post action=addimgck.php enctype='multipart/form-data'>
<input type=\"text\" value=\"".$max_no_img."\" name=\"max_no_img\" id=\"max_no_img\" />";
echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>";
for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td>Images $i</td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}?>
<a href='#' onclick='increment();'>attach more files</a>
<?php
echo "<tr><td colspan=2 align=center><input type=submit value='Add Image'></td></tr>";
echo "</form> </table>";
?>
vibhaJ 126 Master Poster

JS code runs on client side.
If you will give href on "attach more files" that means page is changed. And you can not have count of click.

you can add file element dynamically using JS.
Below code will give number of click without href.

<script type="text/javascript">
var max_no_img = 0;
function increment(){
max_no_img++;
alert('max_no_img : '+max_no_img);
return max_no_img;
}
</script>

<?
$max_no_img=2; // Maximum number of images value to be set here
echo "<form method=post action=addimgck.php enctype='multipart/form-data'>";
echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>";
for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td>Images $i</td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}?>
<a href='#' onclick='increment();'>attach more files</a>
<?php
echo "<tr><td colspan=2 align=center><input type=submit value='Add Image'></td></tr>";
echo "</form> </table>";
?>
vibhaJ 126 Master Poster

1) add new field as sendEmailAlert.make a simple php page where you check if difference between expired_date and current date is greater than 15 and sendEmailAlert is zero.

2) if is is greater than 15 then send a email to that username about expiration and make sendEmailAlert field to one.

3) once you have php page ready place that php code in cronjob of server.
Cronjob is a scheduler which will execute your php page by itself in background.
Based on your argument php execution will be repeated that frequently.
e.g. you can specify to run php page daily, or weekly, or monthly based on your requirement.

vibhaJ 126 Master Poster

Okay...mark thread as solved.

vibhaJ 126 Master Poster

get it..
Here problem is with UL LI.
Try this:

<?php
include 'config.php';
$page="";
$sql="select * from cms where sub_page='$page' order by pid";
$result = mysql_query($sql);
echo mysql_error();
while($row = mysql_fetch_row($result))
 {
echo "<li class='pureCssMenui0'><a class='pureCssMenui0' href=content.php?a=$row[0]><span>$row[1]</span></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->"; 
$spage=$row[1];
$sq="SELECT * 
FROM cms
WHERE sub_page =  '$spage'
ORDER BY pid ";
$res = mysql_query($sq);
echo mysql_error();
echo "<ul class='pureCssMenum'>";
while($dropdown = mysql_fetch_row($res))
 {
  echo "<li class='pureCssMenui0'><a class='pureCssMenui' href=content.php?a=$dropdown[0]>$dropdown[1]</a></li>";
 }
 echo "</ul>";
 }
?>
vibhaJ 126 Master Poster
$qry = "UPDATE Staff SET FirstName = '$fname', LastName = '$lname', Login = '$login', Password = '".md5($password)."' WHERE LastName = '$lname' AND FirstName = '$fname'";
$result = @mysql_query($qry);

I thing there is blank space before Password = ' and ".md5
This causes issue.

vibhaJ 126 Master Poster

Check this code.

<?

function  timeAfter($timestamp, $granularity=2, $format='Y-m-d H:i:s'){

        $difference = $timestamp - time();
       
        if($difference < 0) return '0 seconds ago';             // if difference is lower than zero check server offset
        elseif($difference < 864000){                                   // if difference is over 10 days show normal time form
       
                $periods = array('week' => 604800,'day' => 86400,'hr' => 3600,'min' => 60,'sec' => 1);
                $output = '';
                foreach($periods as $key => $value){
               
                        if($difference >= $value){
                       
                                $time = round($difference / $value);
                                $difference %= $value;
                               
                                $output .= ($output ? ' ' : '').$time.' ';
                                $output .= (($time > 1 && $key == 'day') ? $key.'s' : $key);
                               
                                $granularity--;
                        }
                        if($granularity == 0) break;
                }
                return ($output ? $output : '0 seconds').' after';
        }
        else return date($format, $timestamp);
}

$ts = strtotime('2010-07-15 7:00:00');
echo timeAfter($ts,4);
exit;

?>
vibhaJ 126 Master Poster

echo $sq; and run that query in sql window.
See what you are getting for each page.

vibhaJ 126 Master Poster

use any good jquery gallery.
check this : Jquery Lists

Once you download script and demo is working in you pc,
replace static images to dynamic images.

Dynamic images will comes from select query results.

vibhaJ 126 Master Poster

Its simple as you do code for insert same thing should be there for update.
Like insert query here you will have update query.

<html>
<head>
<title>Eastern Mediterranean University-Student`s ID</title>
</head>
<body>
<h3>Edit Student</h3>

<?php
$num=$_POST['num'];


@ $db = new mysqli('localhost', 'root', 'ilyas1987', 'dau');
if (mysqli_connect_errno()) {
	echo 'Error: Could not connect to database. Please try again.';
	exit;
}

//-------------- update is clicked ----------------
if(isset($_REQUEST['edit']))
{
	$id = $_REQUEST['id'];
	$name = $_REQUEST['name'];
	$surname = $_REQUEST['surname'];
	$department = $_REQUEST['department'];
	$cpa = $_REQUEST['cpa'];
	
	$q="update students set 
		name = '".$name."',
		surname = '".$surname."',
		department = '".$department."',
		cpa = '".$cpa."'
		where id = ".$id;
	mysql_query($q);
	
	header('Location:succupdate.php');
	exit;
	
}

$query = "select * from students where num='$num'";
$result = $db->query($query);
$row = $result->fetch_assoc();
echo $query;

echo "<tr>

<form method='post' action='sonuc.php' >
<input type='hidden' name='num' value='$num'>
	<b>ID:</b><br>
	<input type='text' name='id' value='".$row['id']."' size='10'>
	<br>	
	<b>Name:</b><br>
	<input type='text' name='name' value='".$row['name']."' size='10'>
	<br>
	<b>Surname:</b><br>
	<input type='text' name='surname' value='".$row['surname']."' size='10'>
	<br>
	<b>Department:</b><br>
	<input type='text' name='department' value='".$row['department']."' size='10'>
	<br>
	<b>GPA:</b><br>
	<input type='text' name='cpa' value='".$row['cpa']."' size='10'>
	<br>
	<br>
	<input type='submit' name='edit' value='Save'><br>
	</form>
	</tr><br />\n";
$result->free();
$db->close();
?>
</body>
</html>
vibhaJ 126 Master Poster

echo your login select query and try to debug it.
md5 is just for encryption there might be some issue in coding.

vibhaJ 126 Master Poster

try some different charset for HTML.

<meta http-equiv="Content-Type" content="text/html; charset=ISO 8859-1" />
vibhaJ 126 Master Poster
$query5="INSERT INTO $clean_title (recnum,lname,fname,first,credit) VALUES ('$record_number1','$last_name','$first_name','$new','$credit')";
mysql_query($query5) or die(mysql_error());

there is no php code to execute query in your given code.
same for $query4.

vibhaJ 126 Master Poster

Try this :

<?php
$new = htmlspecialchars("'The <font> tag is awesome'", ENT_QUOTES);
echo $new; 
?>
vibhaJ 126 Master Poster

Try this code.

<?php
while($rows=mysql_fetch_array($result))
{
	$style = '';
	if($rows['designation']=="Teamleader")
		$style = 'style="color:#0000FF;"';
	if($rows['designation']=="Manager")
		$style = 'style="color:#cc0000;"';
	
echo "<option value=".$rows['username']." ".$style.">".$rows['username']."</option>";
}
?>
vibhaJ 126 Master Poster

this is same like if-else, but very useful in coding.

(condition)?'go to here if condition is true':'go to here if condition is false'

See below example.

$a=5;
$signOfA = ($a>0)?'positive':'negative';
echo $a.' is '.$signOfA;

$a=-5;
$signOfA = ($a>0)?'positive':'negative';
echo $a.' is '.$signOfA;

Hope you get it. ;)

vibhaJ 126 Master Poster

I think you want to display default.jpg if user have not avtar image. right?
Use below code, here directly included with ternary operator of if else .
Now no need to write extra if condition.

$display .= "<tr id=\"item_" . $row['id'] . "\">"
		  ." <td><img src=\"avatars/thumbs/".((is_null($avatar))?('default.jpg'):($avatar))."\"class=\"thumb\" alt=\"Avatar\" /><br/>" . $uname . "</td>"
		  ." <td>" . $email . "<br/><br/><br/><a href=\"user_profile.php?view_profile=$uname\">See agents profile here</a></td>"
		  ." <td>" . $time . "</td>"
		  ." </tr>\n";
vibhaJ 126 Master Poster

Here you have echo displayUsers(); meance whatever will be return from that function will be echoed.
Your whole function is concating $display and returning it.
But in if statement you have directly make echo.

//THIS IF STATEMENT DISPLAYS WHAT I NEED PERFECTLY
		  if (is_null($avatar)) { echo "<img src=\"avatars/thumbs/default.jpg\"class=\"thumb\" alt=\"Avatar\" />"; } else { echo "<img
			  src=\"avatars/thumbs/$avatar\"class=\"thumb\"alt=\"Avatar\" />";}  
//END-THIS IF STATEMENT DISPLAYS WHAT I NEED PERFECTLY

It should be something like this,

//THIS IF STATEMENT DISPLAYS WHAT I NEED PERFECTLY
		  if (is_null($avatar)) { $display .=  "<img src=\"avatars/thumbs/default.jpg\"class=\"thumb\" alt=\"Avatar\" />"; } else { $display .=  "<img
			  src=\"avatars/thumbs/$avatar\"class=\"thumb\"alt=\"Avatar\" />";}  
//END-THIS IF STATEMENT DISPLAYS WHAT I NEED PERFECTLY

So, might be this is bug,
concate avtar image coding with some variable and then return it.

Let me know if it works.