Shanti C 106 Posting Virtuoso

use this:

if(empty($_GET))
{
//code
}
Shanti C 106 Posting Virtuoso

put this

<img src="downArrow.gif">

in

<a href...></a>

and then use onclick function.....

Shanti C 106 Posting Virtuoso

hello...

Actually the $currentFile gives you the whole path of your file ,something like web/mysite/index.php
These two lines

#
$parts = Explode('/', $currentFile);
#
$pagename=$parts[count($parts) - 1];

to get out the pagename from the whole path...
Instead of this two lines code you can simply use this:

basename( $_SERVER["PHP_SELF"]);

Enjoy....

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

hello servis...
the following function will get your page name:

$currentFile = $_SERVER["PHP_SELF"];
$parts = Explode('/', $currentFile);
$pagename=$parts[count($parts) - 1];
echo $pagename;

And then, compare your required page name with $page name by using if condition, then make your table get highlighted...
by this:

<? if($pagename=="index.php"){?>
		 <li><a href="index.php" title="css menus" class="current" >Home</a></li>
		<? } else {?>
		 <li><a href="index.php" title="css menus" >Home</a></li>
		 <? }?>

Hope this will help you for something...

Shanti C 106 Posting Virtuoso

www.w3schools.com is ever best for beginners....
And all the best to you for your programming...

Shanti C 106 Posting Virtuoso

Please use code tags...

Shanti C 106 Posting Virtuoso

yaa...
Java is java..
i agree with you...

Shanti C 106 Posting Virtuoso

Thank Shanti. Can u explain how can i use hidden variable in php.

see this example:

b>TicTacToe</b><br>
Enter Move X.<br>
<pre>
<form action="tictactoe.php" method="GET">
<input type="text" name="move" size=2>
  0|x|2    <br>
  _|_|_    <br>
  3|4|o    <br>
  _|_|_    <br>
  6|7|8    <br>
</pre>
<input type="hidden" name="board" value="0x234o678">
</form>
Shanti C 106 Posting Virtuoso

solved???

make this thread solved......

Shanti C 106 Posting Virtuoso

yes
like this:

window.location.href='updateReg.php?idValue='+idValue+'&idValue2='+idValue2;
Shanti C 106 Posting Virtuoso

How? LOL

see Marksolved link at top and bottom of this thread, then click on that...

Shanti C 106 Posting Virtuoso

welcome....:)

Shanti C 106 Posting Virtuoso

i have modified your code..
and its working now:

<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="1234"; // Mysql password
$db_name="opulent_online1"; // Database name
$tbl_name="users"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
if($_SERVER['REQUEST_METHOD']=='POST')
{
if(isset($_POST['check_compare']))
{
$sql = "DELETE FROM $tbl_name WHERE find_in_set(uid,'".$_POST['check_compare']."')";
$result = mysql_query($sql);
}
}

$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>
<?
// Check if delete button active, start this



?>
<script>
function comparision(){
		d=document.form1;
		var total="";
		if(!d.c.length){
			if(d.c.checked) {
				d.check_compare.value=d.check_compare.value+d.c.value+',';
				return true;
			} else {
				alert("Please select check Box");
				return false;
			}		
		}
		for(var i=0; i < d.c.length; i++){
			if(d.c[i].checked) {
				total +=d.c[i].value + "\n";
				d.check_compare.value=d.check_compare.value+d.c[i].value+',';
			}
		}
		if(d.check_compare.value=="") {
		 alert("Please select atleast one check Box");
		 return false;
		}
	}
</script>
<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="deleterows.php"onSubmit="return comparision()">
		<input type="hidden" name="check_compare">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td colspan="4" bgcolor="#FFFFFF"><strong>Delete multiple rows in mysql</strong> </td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF">#</td>
<td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF">
<input type="checkbox" name="c" value="<?=$rows['uid'];?>" id="c"/>
</td>
<td bgcolor="#FFFFFF"><? echo $rows['uid']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['name']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['utype']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['uemail']; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" align="center" bgcolor="#FFFFFF">
  
 <input name="compbutton" type="submit" class="Button" value="Compare" /></td>
</tr>

</table>
</form>
</td>
</tr>
</table>
Shanti C 106 Posting Virtuoso

or check this attatchment...

Shanti C 106 Posting Virtuoso

hello try this code once:

$photo= imagecreatefromjpeg($image_file);
$fotoW = imagesx($photo);
$fotoH = imagesy($photo);

$photoFrame = imagecreatetruecolor(600,338);

$logoImage = imagecreatefrompng('logo.png');
imagecopyresampled($photoFrame, $photo, 0, 0, 0, 0, 600, 338, $fotoW, $fotoH);


$logoW = imagesx($logoImage); 
$logoH = imagesy($logoImage); 

imagecopy($photoFrame, $logoImage, 0, 0, 0, 0, $logoW, $logoH);

imagejpeg($photoFrame, '', 100);
Shanti C 106 Posting Virtuoso

ok.......

Shanti C 106 Posting Virtuoso

i don't get what you said..
Make me clear...

Shanti C 106 Posting Virtuoso

some thing goes like that....

<table width="30%" border="0" background="some.gif">
  <tr>
    <td colspan="2" ><? echo $row['name'];?></td>
  </tr>
  <tr>
    <td colspan="2"><? echo $row['identity'];?></td>
  </tr>
  <tr>
    <td ><img src="<?=$row['identity'];?>" /></td>
	<td><? echo $row['posts'];?></td>
  </tr>
</table>
Shanti C 106 Posting Virtuoso

hello nikesh...

that image having a back ground image is same for all...
and the text (name,posts,solved threads) will coming from database and also an image of ours(avatar)...
i think nothing hard to do this....

nikesh.yadav commented: nice helper, great hardworker ..... you are +1
Shanti C 106 Posting Virtuoso

i think you can't use a php variable in a html file...
If you want send some value from php file to html file, then put it in hidden variable at php file , and send it to html file..

Shanti C 106 Posting Virtuoso

For web development , dotNet is the best.....
Java is heavily used throughout the industry. It is now open source so does not depend on Sun alone anymore.
Advantage of Java is that it can run anywhere while Microsoft stuff only runs on MS systems.

Shanti C 106 Posting Virtuoso

then make your thread solved....

Shanti C 106 Posting Virtuoso

all your code is perfect...
have you specified correct email id....
have you checked your email....
try it again....

Shanti C 106 Posting Virtuoso

have you tested your code at local or ftp????

Shanti C 106 Posting Virtuoso

Thank you very much for your help.

I managed to solve the problem my self.

tel me what your mistake????

Shanti C 106 Posting Virtuoso

please confirm that name(what you typed) is same as name in database....
or post your needed code...

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

echo $name;
tell me what it prints....

Shanti C 106 Posting Virtuoso

just echo this query like..

echo $result="update turf_table set number=(number+1) where name='.$name.'";
exit;

and copy and paste that query at your database..
tel me what you got there....

or post your table structure...

Shanti C 106 Posting Virtuoso

yes....

Shanti C 106 Posting Virtuoso

then write qury like:

$result="update turf_table set number=(number+1) where id='.$name.'";
Shanti C 106 Posting Virtuoso

you want add 1 to number or update number field with 1

Shanti C 106 Posting Virtuoso

i don't understand what do you want???

Shanti C 106 Posting Virtuoso

i think you are not complete with your posts.....

Please provide your thread clearly...

Shanti C 106 Posting Virtuoso

hello..
your 65th line should be:

<xml version="1.0" encoding="ISO-8859-1" >
Shanti C 106 Posting Virtuoso

simply... praveen's thought is correct...
And also check your style sheet attachment href=""...

Shanti C 106 Posting Virtuoso

sorryy....
not action "" filed...
im saying about your href="" field...

You sholud use either this:href="<?php echo PATH_CSS; ?>
or this: href="main.css"

not both...

Shanti C 106 Posting Virtuoso

i mean, action="" field takes two css file paths...

Shanti C 106 Posting Virtuoso

i think this line should not have two css paths..

<link rel="stylesheet" type="text/css" href="<?php echo PATH_CSS; ?>main.css" />
Shanti C 106 Posting Virtuoso

hello...have you checked it???
have you got solved your problem...???

Shanti C 106 Posting Virtuoso

here page means....

Shanti C 106 Posting Virtuoso

if your problem is solved...then make this thread as solved...then others will see for it...

Shanti C 106 Posting Virtuoso

see this, i have modified your code..
it is working fine now...
and i have write some more piece of code where they have needed to come out from errors..

<<!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">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="description" content="Small Corporation" />
	<meta name="keywords" content="small, corporation" />
	<link rel="stylesheet" href="style.css" type="text/css" />
    <style type="text/css">
<!--
.style4 {color: #FFFFFF}

.style5 {color: #2D5181}
-->
    </style>
</head>
<body>

	<div id="contentcourse">
	  <div id="header"></div>
  <ul id="menu">
			<li><a class="current" href="index.php">Home</a></li>
			<li><a href="aboutus.php">About Us</a></li>
			<li><a href="courses.php">Courses</a></li>
			<li><a href="demo_registration.php">Demo Class Registration</a></li>
			<li><a href="faq.php">FAQ's</a></li>
			<li><a href="order.php">How To Order</a></li>
			<li><a href="payment.php">Payment Options</a></li>
			<li><a href="enquiry.php">Enquiry</a></li>
<li><a href="contact.php">Contact Us</a></li>
            
	  </ul>
		
	  <div id="course">
			<div id="title">
			  <h3>Sub Courses</h3>
			</div>
	<br/>
			  
	          <?php 
		include("conn.php");
		if(!empty($_GET['course']))
		  {
			echo $course=$_GET['course'];
			}else
			$course='';
	  $query=("select course,subcourse from course WHERE course='".$course."'") or die(mysql_error());
	   $ress1=mysql_query($query);	
	  while($rows=mysql_fetch_array($ress1))
	   {
	   $subcourse= $rows['subcourse'];
	    ?>
			     <font color="#666666"> <a href="course.php?course=<?php echo $course ;?>&subcourse=<?php echo $subcourse ;?>" >    
               <?php 
	   echo $subcourse;
	   echo "<br>"; 
	   ?>
	               </a></font>
			  <?php
	   }?>
		      
          <?php if(!empty($_GET['course']))
		  { $course=$_GET['course'];
		  }
		  if(!empty($_GET['subcourse']))
		  {
	   $subcourse= $_GET['subcourse'];
	}
	else $subcourse='';
	
	   $ress2=mysql_query("select * from course where  subcourse='".$subcourse."'") or die(mysql_error());
	    
		while($rows=mysql_fetch_array($ress2))
	   {
	   $subcourse= $rows['subcourse'];
	    $fee= $rows['fee'];
		 $content= $rows['content'];
				 	
		
	    ?><br />
	
	<table width="85%" border="1" bordercolor="#CCCCCC">
      <tr >
        <td width="14%" height="40" ><strong>Course:</strong></td>
        <td width="86%"  ><?php echo $subcourse; ?></td>
      </tr>
      <tr>
        <td height="39"><strong>Fee:</strong></td>
        <td><?php echo $fee; ?></td>
      </tr>
      <tr>
        <td height="210"><strong>Discription:</strong></td>
        <td><textarea rows="13" cols="50"><?php echo $content; ?></textarea>
        </td>
      </tr>
    </table>
     <?php } ?>
	<p>&nbsp; </p>
	  </div>
		<div id="title1">
          <h3 class="style5">Courses Offered</h3>
      </div>
		<div id="sidemenu">
		  
           <p>
             <?php
          $ress=mysql_query("select  DISTINCT course …
Shanti C 106 Posting Virtuoso

so, you didn't get any data in $_GET;
tel me ,from where you are getting this variable..
or post needed code...

Shanti C 106 Posting Virtuoso

hello kishor..
echo this line and tel me wat u got:
echo $course=$_GET;
and also echo this statement:

echo $r="select * from course where course='".$course."'";
Shanti C 106 Posting Virtuoso

this line should be like this:

$query=("select * from course where course='".$course."'") or die(mysql_error());
Shanti C 106 Posting Virtuoso

i think you have to add one more column like month the you will calculate hours per month by using group by month column...

Shanti C 106 Posting Virtuoso

hello see this example will help you:
t1 table having 4 columns like year,month,day,points...
year month day points
2000 01 01 1
2000 01 20 3
2000 01 02 5
2000 02 23 10

then here im calculting total point per month...
here is the query:

SELECT year,
MONTH , sum( points ) AS points
FROM t1
GROUP BY year,
MONTH

it will print:
year month points
2000 01 8
2000 02 15

Shanti C 106 Posting Virtuoso

hello vssp...
there is a function called SUM in mysql to calculate total of any numerical column...and if you want to calculate per month,then use limit by 30 days...or created_date < last day of month...
see this link for your reference:
http://www.tizag.com/mysqlTutorial/mysqlsum.php