i have get you with my code....
its working...
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso
i have get you with my code....
its working...
please provide your database table....
first try in mysql with delete opration like:
DELETE FROM autoalto_mail where mail_id=25
use the mail_id which is in your table....
if its work ,then notify me...
you didn't mention any id to delete :
<a href="contractor_mail_delete_action.php"><b>Delete</b></a>
and print this: echo $_GET; in your contractor_mail_delete_action.php page .
sunee..
plz go through this attachment...
<?
mysql_connect('localhost','root','1234');
mysql_select_db('mydb');
if($_SERVER['REQUEST_METHOD']=='POST')
{
echo $_POST['rate'];
$t="insert into vote_table(`rate`,`status`) values('".$_POST['rate']."','1')";
$r=mysql_query($t);
$msg="Thank you for your vote...";
}
?>
<!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 name="form1" action="" method="post">
<table width="70%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CC0099"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td>Please rate it : </td>
</tr>
<tr>
<td>How is this Gift Artical... </td>
</tr>
<tr>
<td align="center"><? if(!empty($msg))echo $msg;?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><img src="images/stillimage-medium.gif" border="1" /></td>
</tr>
<tr>
<td bgcolor="#CC0099"></td>
</tr>
<tr>
<td align="center">Your Rate:
<div align="center">
1
<input name="rate" type="radio" value="1" />
2
<input name="rate" type="radio" value="2" />
3
<input name="rate" type="radio" value="3" />
4
<input name="rate" type="radio" value="4" />
5
<input name="rate" type="radio" value="5" />
</div></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" value="Rate!!" /></td>
</tr>
<tr>
<td align="center"><label></label></td>
</tr>
<tr>
<td bgcolor="#CC0099"></td>
</tr>
<tr>
<td align="center">Rating Results: </td>
</tr>
<tr>
<td align="center">
<?
$y="select rate from vote_table where status=1 and rate=1;";
$p=mysql_query($y);
$n=mysql_num_rows($p);
$a=0;
while($row=mysql_fetch_assoc($p))
{
$i=$row['rate'];
$a=$a+$i;
}
$avg=$a/100;
$r=$avg*100;
?>
1 ->
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF0033" width="<?=$r?>"> </td>
<td > </td>
</tr>
</table>
<?
$y2="select rate from vote_table where status=1 and rate=2";
$p2=mysql_query($y2);
$n2=mysql_num_rows($p2);
$a2=0;
while($row2=mysql_fetch_assoc($p2))
{
$i2=$row2['rate'];
$a2=$a2+$i2;
}
$avg2=$a2/100;
$r2=$avg2*100;
?>
2 ->
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF0033" width="<?=$r2?>"> </td>
<td > </td>
</tr>
</table>
<?
$y3="select rate from vote_table where status=1 and rate=3";
$p3=mysql_query($y3);
$n3=mysql_num_rows($p3);
$a3=0;
while($row3=mysql_fetch_assoc($p3))
{
$i3=$row['rate'];
$a3=$a3+$i3;
}
$avg3=$a3/100;
$r3=$avg3*100;
?>
3 ->
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF0033" width="<?=$r3?>"> </td>
<td > </td>
</tr>
</table>
<?
$y4="select rate from vote_table where status=1 and rate=4";
$p4=mysql_query($y4);
$n4=mysql_num_rows($p4);
$a4=0;
while($row4=mysql_fetch_assoc($p4))
{
$i4=$row4['rate'];
$a4=$a4+$i4;
}
$avg4=$a4/100;
$r4=$avg4*100;
?>
4 ->
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF0033" width="<?=$r4?>"> </td>
<td > </td>
</tr>
</table>
<?
$y5="select rate from vote_table where status=1 and rate=5";
$p5=mysql_query($y5);
$n5=mysql_num_rows($p5);
$a5=0;
while($row5=mysql_fetch_assoc($p5))
{
$i5=$row5['rate'];
$a5=$a5+$i5;
}
$avg5=$a5/100;
$r5=$avg5*100;
?>
5->
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FF0033" width="<?=$r5?>"> </td>
<td > </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
you just copy and paste the examples from w3schools and any other and then run then in IE or firefox,then you will get the output...
and try to edit the code in which way you want...
read the materials about html and css...
www.w3schools.com is best for begginners...
SELECT * FROM table WHERE date_col<curdate() and date>DATE_ADD(CURDATE(), INTERVAL -1 DAY)
change your code to:
$result = mysql_query("SELECT * FROM autoalto_mail where mail_id='".$_REQUEST['mail_id']."'" );
then check your database connections and table name and column names...
And put echo before your query and execute it
in your mysql...
or send your entire code with database....
You must write $_request as $_REQUEST..
so the code is:
$result = mysql_query("SELECT * FROM autoalto_mail where mail_id='".$_REQUEST[$a]."'" );
The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.
try in this way:
$result = mysql_query("SELECT * FROM autoalto_mail where mail_id='".$_request[$a]."'" );
k praveen...tel me if any error occurs...
Try this..
it works fine:
<?
mysql_connect('localhost','root','1234');
mysql_select_db('banjarahills');
if($_SERVER['REQUEST_METHOD']=='POST'){
print_r($_POST);
$n=$_POST['name'];
$m=$_POST['message'];
}
if(isset($_POST['submit']))
{
$message=$_POST['message'];
$name=$_POST['name'];
if(strlen($message)<1)
{
print "You did not type amessage."; //no name entered
}
else if(strlen($name)<1)
{
print "You did not type name."; //no post entered
}
else
{
$thedate=date("U"); //get unix timestamp
$displaytime=date("F j, Y, g:i a");
//we now strip HTML injections
$message=strip_tags($message);
$name=strip_tags($name);
$insertpost="INSERT INTO shout (message,name) values('$message','$name')";
mysql_query($insertpost) or die("Could not insert post");
} }
$res="select * from shout";
$res1=mysql_query($res);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script language="javascript">
function toggle_it(itemID){
// Toggle visibility between none and inline
if ((document.getElementById(itemID).style.display == 'none'))
{
document.getElementById(itemID).style.display = 'inline';
} else {
document.getElementById(itemID).style.display = 'none';
}
}
</script>
<body>
<form action="" name="form1" method="post">
<table width="981" height="57" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="155"><a href="#" onClick="toggle_it('prl')">shoutbox</a></td>
<td width="826">
<marquee direction="left">
<?
if(isset($_POST['submit']))
{
while($res2=mysql_fetch_array($res1))
{
?>
<?=$res2['message'];?>:<?=$res2['name'];?><? }}?></marquee>
</td>
</tr>
<table width="291" id="prl" style="display:none">
<tr>
<td width="95">message</td>
<td width="196"><input name="message" type="text" id="message" ></td>
</tr>
<tr>
<td>name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="submit"></td>
</tr>
</table>
</table>
</form>
</body>
</html>
Try this..
it works fine:
<?
mysql_connect('localhost','root','1234');
mysql_select_db('banjarahills');
if($_SERVER['REQUEST_METHOD']=='POST'){
print_r($_POST);
$n=$_POST['name'];
$m=$_POST['message'];
}
if(isset($_POST['submit']))
{
$message=$_POST['message'];
$name=$_POST['name'];
if(strlen($message)<1)
{
print "You did not type amessage."; //no name entered
}
else if(strlen($name)<1)
{
print "You did not type name."; //no post entered
}
else
{
$thedate=date("U"); //get unix timestamp
$displaytime=date("F j, Y, g:i a");
//we now strip HTML injections
$message=strip_tags($message);
$name=strip_tags($name);
$insertpost="INSERT INTO shout (message,name) values('$message','$name')";
mysql_query($insertpost) or die("Could not insert post");
} }
$res="select * from shout";
$res1=mysql_query($res);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<script language="javascript">
function toggle_it(itemID){
// Toggle visibility between none and inline
if ((document.getElementById(itemID).style.display == 'none'))
{
document.getElementById(itemID).style.display = 'inline';
} else {
document.getElementById(itemID).style.display = 'none';
}
}
</script>
<body>
<form action="" name="form1" method="post">
<table width="981" height="57" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="155"><a href="#" onClick="toggle_it('prl')">shoutbox</a></td>
<td width="826">
<marquee direction="left">
<?
if(isset($_POST['submit']))
{
while($res2=mysql_fetch_array($res1))
{
?>
<?=$res2['message'];?>:<?=$res2['name'];?><? }}?></marquee>
</td>
</tr>
<table width="291" id="prl" style="display:none">
<tr>
<td width="95">message</td>
<td width="196"><input name="message" type="text" id="message" ></td>
</tr>
<tr>
<td>name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="submit"></td>
</tr>
</table>
</table>
</form>
</body>
</html>
see this attachment, and change that according to your desire...
Echo your insert query and tel me where the error was placed..
give me your table also...
hey sunee...
check this url..
this may help u...
http://kevinsmithdesigns.com/blog/2008/03/04/simple-5-star-rating-system-phpmysql/
hi,
can u please tell me how to try keith editor...
You have to place that editor folder in your virtual directory and try it...its working...
other wise copy and paste the code and place all js files in your directory...
Check this path in your local:
http://localhost/web/editor/fckeditor/_samples/html/sample09.html
This is one type of rating...
If you like it...use this attachment...
hey suneee....
Can you clearly explain your thread?its better...
other wise nobody will reply you...
The attachments which posted by keith are very good...
It very gud job done by keith...
Please cut and paste the editor which is i have written in iframe.php...and place that folder editors in your working directory...and check at line 386 in iframe.php, i have placed a hidden variable..use $_POST in your sql query...
its easy to do...
let me know if any error occurs...
And i do again reattach the editor...
hi lydia...
check this attachment....
welcome...
if u got solution make this thread as solved,then other will search solved threads....
How could I pass this value to the javascripts for validation.
Use this format..
StartDate.setFullYear(StartDateSt);
StartDate.setFullYear(StartDateSt[0],StartDateSt[1],StartDateSt[2]);
The format which i have posted earily is for php...sorry...
Check this manual for reference:
http://www.w3schools.com/js/js_obj_date.asp
I have tried every solution you have given me, Shanti. It's not working. The program isn't generating any error. I think this has got something to do with the format, the javascript is getting the dates. The format it would be recieving dates would be of sort yyyy/mm/dd. That is why it can't compare the dates. Please tell me some solution so that I could compare them in this format.
Helloo,
By this code convert your date to which format you want:
$dp=$_POST['date'];
$dp1=explode("/",$dp);
$dp2=$dp1[2]."-".$dp1[0]."-".$dp1[1];
In the last line change format according to your application....
Check your system date format with database date format...means yy-mm-dd like this...
Tel me what error you got...
Your update query should be like this:
$qur= "update tbl_circular set `date`='".$date."', `headline`='".$headline."', `description`='".$des."' where headline like '%".$head."%'";
$update1=mysql_query($update) or die("Could not Update");
Post if error occures...
Hello..
i have posted another two ways which i have posted...
try to implement with those also...
then tel me where will be the error...
always mark thread as solved, when you get solution, as it will help others if they are searching for a solution.
if (Date.parse(fromDate) > Date.parse(toDate)) {
alert("Invalid Date Range!\nStart Date cannot be after End Date!")
return false;
}
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<meta name="Content-Style-Type" content="text/css">
<title>Example</title>
<script type="text/javascript">
<!--
function check (f) {
var start = new Date (f.start.value);
var end = new Date (f.end.value);
start.setDate (start.getDate() + 28);
if (end >= start) {alert (); return false}
}
// -->
</script>
<style type="text/css">
<!--
fieldset {padding:1ex; width:10em}
label {display:block; margin:1em 0}
input {display:block}
button {display:block; margin:auto}
-->
</style>
</head>
<body>
<form action="some-script.pl" onsubmit="return check (this)">
<fieldset>
<legend>Dates</legend>
<label>Start Date<input name="start" onchange="this.value = new Date (this.value).toDateString()" type="text"></label>
<label>End Date<input name="end" onchange="this.value = new Date (this.value).toDateString()" type="text"></label>
<button type="submit">Submit</button>
</fieldset>
</form>
</body>
</html>
or simply
function dt()
{
var ch=Date.parse("06/19/2008");
var currentdt=new Date;
if(ch>Date.parse(currentdt))
{
alert("Date is greater.");
}
else
{
alert("Date is less");
}
}
Fine...
And make this thread as solved...
if($_GET['stat']==1){$p=1;$m=5;}
else{$p=0;$m=6;}
$q="update yourtable set status='".$p."' where id='".$_GET['id']."' ";
mysql_query($q);
this is to display status:
if($row['status']==0)
{
$i="In-Active";
$j=1;
}
else
{
$i="Active";
$j=2;
}
This is where your status link in your page:
<td align="center"class="style13" ><a href="managepage.php?id=<?=$row['id']?>&stat=<? echo $j?>" > <? echo $i?></a> </td>
First you have contact with paypal payment gate way..
Then they will provide with some variables..
Then nothing to do:
We just send them(to paypal) with user card number and amount and some vars if required..
Then they will send back our request with info..
then you will indicate that info to your end user...
Simple..
but first you should contact the paypal payment gateway..
Thanks..
Use color formats are decent.
Make correct alignments.
Use your english professionally..
Make decent font in your css file.
I think this color is nice and professional:#6F6754.
Make your hyperlinks without line by using css.
Sure every page in your site is with same alignment.
Use good buttons with decent color.
Dont place too much images in your site.
Use medium size for your default font.
Set page properties to 0.
ALL THE BEST.
The Code above is not in the correct meaning:
Means:
The php script will execute first...
So if($_POST == "services") ,this line is selected by user,
so u will get this error:
Notice: Undefined variable: result in E:\web\forumsnetwork\frontend\saneg.php on line 7
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\web\forumsnetwork\frontend\saneg.php on line 7
Notice: Undefined index: category in E:\web\forumsnetwork\frontend\saneg.php on line 14
error
Notice: Undefined index: category in E:\web\forumsnetwork\frontend\saneg.php on line 28
error
So,first you have to decide what you are trying to do..
Tel me what is your task has to do..
Thanks.
I think you % symbol is giving you that error..
Yes,Nav's answer is damn right...
Better to provide many accounts from one computer...
And try sessions also,if you want to store more user data like nick name etc...
Thnks..
Check these attachments..
These are very usefull for you..
The dropdown works on both php and ajax..
Check out..
Thank
Shanti
Hello kavitha try this...
<?
/...database connections...
if(!empty($_GET['delid'])){
mysql_query("delete from category WHERE id='".$_GET['delid']."'");
header("location:samepage.php?msg=del");
}
?>
//This is in your designing table...
<td height="22" align="center" ><a href="javascript:del('<? echo $frow['id'];?>')">Delete</a> </td>
//and this can be anyware in your page
<script language="javascript">
var d = document.frmmngmall;
function del(x)
{
if(confirm("You want to delete this record"))
{
d.action="samepage.php?delid="+x;
d.submit();
}
return;
}
</script>
<? /...database connections... if(!empty($_GET['delid'])){ mysql_query("delete from category WHERE id='".$_GET['delid']."'"); if(!empty($_GET['start'])) { header("location:add_subcategory.php?msg=del&start=".$_GET['start'].""); }else{ header("location:samepage.php?msg=del"); } } ?> //This is in your designing table... <td height="22" align="center" ><a href="javascript<b></b>:del('<? echo $frow['id'];?>')">Delete</a> </td> //and this can be anyware in your page <script language="javascript"> var d = document.frmmngmall; function del(x) { if(confirm("You want to delete this record")) { d.action="samepage.php?delid="+x; d.submit(); } return; } </script>
And your a href must be in form tag...
This is working finely...try this...
Thanks.
Shanti
Hello kavitha try this...
<?
/...database connections...
if(!empty($_GET['delid'])){
mysql_query("delete from category WHERE id='".$_GET['delid']."'");
if(!empty($_GET['start']))
{
header("location:add_subcategory.php?msg=del&start=".$_GET['start']."");
}else{
header("location:samepage.php?msg=del");
}
}
?>
//This is in your designing table...
<td height="22" align="center" ><a href="javascript:del('<? echo $frow['id'];?>')">Delete</a> </td>
//and this can be anyware in your page
<script language="javascript">
var d = document.frmmngmall;
function del(x)
{
if(confirm("You want to delete this record"))
{
d.action="samepage.php?delid="+x;
d.submit();
}
return;
}
</script>
And your a href must be in form tag...
This is working finely...try this...
Thanks.
Shanti