rickya100 commented: Thanks for the quick reply. Solved +1
Give thousand chances for your enemy to become your friend, But don't give single chance for your friend to become your enemy.....
hello see this code:
it will print 200 as 200.00
<script language="javascript">
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
// alert(s);
return s;
}
</script>
or you can fill td with one color and increment that td width...
i have implemented one small example for this...
<?
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> …
hello..
Are you asking about general function or php functions??
okay,
Generally functions are used to re usability of some piece of code.Means if you write some code in your function , then you can call that function where ever you want ...you just call that function instead of re-writing the piece of code...
the use of function is same in any language...
http://www.w3schools.com is the best site for beginner of php...
And try coding and post your errors , you will get solved them here....
All The Best..
Shanti.
hello all..
Tel me how to create a site with different languages, if user select particular language, then all the content will be displayed in that language...
How to do it???
or
Any predefined free software available on the internet...
Any resources or information would be appreciated....
Thanks..
Shanti.
did your problem got solved???
Indian.....AndraPradesh..
Save the variables in a session...
Then, check for the session, if it is present, reload the session vars into the form.
or
check this:
http://www.daniweb.com/forums/thread78707.html
http://www.usenet-forums.com/php-general/44005-form-retain-info-back.html
This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.
means...
ob_start() just turns on output buffering. It means the web server doesn't start sending output to the browser until the page is complete and it's a big performance enhancer.
try this way...
$r=mysql_query("SELECT assignment.Candidate, assignment.Chaplain, assignment.Reader, assignment.Id, tbl_user.Id, tbl_user.name_pre, tbl_user.name_first, tbl_user.name_last
FROM assignment, tbl_user
WHERE assignment.Id=tbl_user.Id
ORDER BY assignment.Candidate ASC");
$result=mysql_fetch_array($r);
echo $result['name_pre'].$result['first'].$result['last'];
use session_start only once..
means use at your page which is having the above code which you have posted above..
remove session_start(); line from your function.php page..
and also use ob_start(); after your session_start(); line....
hello..
i like your way of asking only logic not code...i really appreciate it...
See, if you have so many questions in your site...the you have to create database table for all of those..
if you have a question like:
How much do you like this article...
1.Excellent 2.Good 3.Average 4. Bad
Means in my way the table look like...
table name: tbl_polling
fields: id,question,option1,option2,option3,option4,curdate
then in php code:
you just create a form and question with 4 options with radio buttons..
when user clicks the submit button, then you can update the particular option by incrementing that field by 1..
In this way you can calculate average of particular option and show it at front end...
you can insert particular question by you own or at admin control panel..you can insert many question which you want to put at front end..
If you have any queries on this..Let me know...
thank you...
shanti.
and also try these lines and tel me what you got there:
echo $r="SELECT * FROM `accounts` WHERE `name` = '" . $username . "'";
$result = mysql_query($r);
hello..
As some one and me already said...please use proper english..other wise nobody can try to read your thread....
i also...
please post your reply with good english again..
i will definatly get you the information..
could you please post some more of your code..
but i oni cn c apartment name, room no, email n quntity in da db so hw da admin cn noe wt food the user order.....now i wan all da info enter in db so tat admin cn all da info n deliver da food.
For this , you already have all the information ordered in your database...Them you just make an admin control panel part,where admin can see all the orders and provide with an option delivered or rejected..At the admin part also you can get all the ordered information by select query..try..and tel me if any errors....
1 user cnt make another order if he make there will an error sign
For this check with your database table with apartment no,room no and email with today's date,if the have already entered in database ,then indicate "you have already ordered" message...
means that will be something like this:
$r=mysql_query("select * from buy where apartmentno='".$_POST['apnotext']."' and rno='".$_POST['rno']."' and email='".$_POST['email']."'");
$count=mysql_num_rows($r);
if($count>0)
{
$msg="you have already ordered";
}
else
{// write your insert query...
}
us
sin
use
bus
gender
there are so many resources over the internet with code..
.try to make search on google..
here are some links:
http://www.osresources.com/6_1_en.html
http://labs.silverorange.com/archive/2003/september/simplecsstabs
http://www.dynamicdrive.com/style/csslibrary/item/css-tabs-menu/
http://www.cssplay.com/
this is my code...
i can't get what i want to try:
please help me:
<?php
if($_SERVER['REQUEST_METHOD']=='POST' ){
header('Content-type: image/jpeg');
$tube = imagecreatefromgif("themes/New Folder/imgb3.gif");
$gold = imagecreatefromjpeg("images/myimage.jpg");
//$code = imagecreatefromgif("images/ICMcode.gif");
imagecopy($tube, $gold, 75, 50, 0, 0, 75, 100);
//imagecopymerge($tube, $gold, 200, 15, 0, 0, 200, 200, 100);
//imagecopymerge($tube, $gold, 135, 15, 0, 0, 200, 200, 100);
//imagecopymerge($tube, $code, 100, 10, 0, 0, 200, 200, 30);
//imagecopymerge($tube, $code, 200, 10, 0, 0, 200, 200, 30);
//imagecopymerge($tube, $code, 150, 10, 0, 0, 200, 200, 100);
imagejpeg($tube);echo $tube;
imagedestroy($tube);
imagedestroy($gold);
imagedestroy($code);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript">
/*
INFORMATION:
============
Copyright 2001 by CodeFoot.com
Free for all users, but leave in this notice
For IE4.X and later; degrades gracefully.
INSTRUCTIONS:
=============
Step One:
---------
Place this script in the head of the page.
Set the six dimensioning variables where
shown in the script (below).
Step Two:
---------
In the body, give each image a unique name
and attach the functions as shown:
<img src="someimage.jpg"name="imageOne"width="100" height="100"onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
<img src="anotherimage.jpg"
name="imageTwo"
width="100" height="100"
onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
Any number of images may be used; however,
all should usually be the same default size.
Step Three:
-----------
Add the iBeReady variable to an onload event
in the body tag:
<body onload="iBeReady=true;">
*/
// THE SCRIPT:
// ===========
// sets the default size of the image(s)
defaultXsize = 100;
defaultYsize = 100;
// sets the minimum size of the image(s)
minimumXsize = 50;
minimumYsize = 50;
// sets the maximum size …
Legendary words by Charlie Chaplin:
' Life laughs at you when you are unhappy. Life smiles at you when you are happy. But, Life salutes you when you make others Happy.'
please get me some information...
please.....
today,im going to research on a topic dynamic image manipulation...means merging of two images with text based on the end users dragged position...
hope i will complete my task today only...
thanks for all the above for give continuation to my thread..
thanks ,
shanti.
hello check for these to know about SEO:
http://www.fendigital.com/html/how_is_seo_done_.html
http://lifehacker.com/software/seo/getting-to-done-seo-made-easy-138429.php
yes...in every page which are come after login ,in those pages you have to check for user sessions like
if(empty($_SESSION['username']))
{
header('location:index.php');
}
...then in your logout page you just clear out your sessions or cookies...
like:
session_unregister('username');
session_destroy();
hello,,
In img tag, the src is to have an image source like mylogo.gif etc...you can't pass an php page name..if you want to make that image clickable then,put it in to anchor tag or put onClick method on that image tag....
or
write your line like this way:
<a href="image_resize.php?image=<?=$arr['picture']?>&max_width=200&max_height=120"><img src="<?=$arr['picture']?>" width="200" height="120"> </a>
check it all.
thank you...
"All the right things are not possible always...All the possible things are not right always..Be true to both your mind and heart, you will never in wrong!!"
Hello all....
Good Evening...
Here i am creating a thread,
Where you can,
Post what new thing ,you are going to learn today or what new thing ,you learned today....
And also you can post a brief description of that thing and also links about it,or any if you have....That thing may be a program you done,or what you have get by browsing google, any research,or a concept, or a problem, or a application, or a technology, or a good site you have visited, or a good thing you faced today, or anything ......
Then , all of us know what others learn daily....
If we like it, we also do learn that..
Hope it will be use full to all....
Get Start now->->->
Today I read a pdf which is about AJAX...
But i can't attach it here...
and i have visited this site:
http://www.ajax.org/
Thank you all...
shanti...
coffeeeeee......
i think you can't get the java script function values by this way: $_GET[v].
if you want to send javascript values to php try this way:
function showhide1(x)
{
d.action="yourpage.php?v="+x;
d.submit();
}
And the you can get the function value by $_GET;
then pass it to N() ...
this is my complete code:
please have a look and try to solve my problem...please...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript">
/*
INFORMATION:
============
Copyright 2001 by CodeFoot.com
Free for all users, but leave in this notice
For IE4.X and later; degrades gracefully.
INSTRUCTIONS:
=============
Step One:
---------
Place this script in the head of the page.
Set the six dimensioning variables where
shown in the script (below).
Step Two:
---------
In the body, give each image a unique name
and attach the functions as shown:
<img src="someimage.jpg"name="imageOne"width="100" height="100"onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
<img src="anotherimage.jpg"
name="imageTwo"
width="100" height="100"
onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
Any number of images may be used; however,
all should usually be the same default size.
Step Three:
-----------
Add the iBeReady variable to an onload event
in the body tag:
<body onload="iBeReady=true;">
*/
// THE SCRIPT:
// ===========
// sets the default size of the image(s)
defaultXsize = 100;
defaultYsize = 100;
// sets the minimum size of the image(s)
minimumXsize = 50;
minimumYsize = 50;
// sets the maximum size of the image(s)
maximumXsize = 250;
maximumYsize = 250;
// Do not edit below this line.
// ----------------------------
iBeReady = false;
function dragResizeImage(dragEvent,which){
alert(which);
if (iBeReady){
posX = eval("document."+which+".offsetLeft");
posY = eval("document."+which+".offsetTop");
newXsize = dragEvent.x;
newYsize = dragEvent.y;
newXsize = newXsize - posX;
newYsize = newYsize - posY;
if (newXsize >= maximumXsize) newXsize = maximumXsize;
if (newYsize >= maximumYsize) newYsize = maximumYsize;
if (newXsize <= minimumXsize) newXsize = minimumXsize;
if (newYsize <= minimumYsize) newYsize = …
hello,
can anybody help me on this please?????
hello i have changed your code,its works fine now..
<!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 language="javascript">
function validate_form( )
{
var d=document.search_form;
if (d.keyword.value=="")
{
alert ( "Please type in a keyword." );
return false;
}
if (d.cat_id.selectedIndex==0)
{
alert ( "Please select an industry." );
return false;
}
if (d.place.value=="")
{
alert ( "Please type in a zipcode or city and state." );
return false;
}
return valid;
}
</script>
</head>
<body>
<div>
<table>
<FORM name="search_form" ACTION='jobsearch.php' method='POST' onSubmit="return validate_form();" >
<tr><td>keyword:</td><td >
<INPUT TYPE='TEXT' NAME='keyword'></td>
<td>Industry:</td><td >
<select name="cat_id">
<option value="">---select one---</option>
<option value="1">Accounting</option>
<option value="2">Administration</option>
<option value="3">Automation</option>
<option value="4">Banking</option>
<option value="5">Biotech</option>
<option value="6">Bussiness</option>
<option value="7">Construction</option>
<option value="8">Construction</option>
<option value="9">Consulting</option>
</select></td></tr>
<tr><td>city and state or zipcode: </td><td >
<INPUT TYPE='TEXT' NAME='place'></td></tr>
<tr ><td colspan="2"><input type="submit" value="Search"></td></tr>
</form>
</table>
</div>
</body>
</html>
To get into love with someone......
Javascript cannot connect to a database, but you can make a request to a server-side page which does so using javascript (known as AJAX).
or check this for reference:
http://michaelsync.net/2006/06/14/javascript-working-with-database
http://www.daniweb.com/forums/thread84847.html
if your thread got solved...
make it solved ....always...
check these urls:
http://www.phptutorial.info/
http://www.beginnersphp.co.uk/
http://www.homeandlearn.co.uk/php/php.html
Both are best...
but php is simple to learn and open source...I also chose php...
desc is a keyword,
so change that name to any like desc1...
and try...
Hello Every Body
I Am Using PHP AND JAVASCRIPT
i am using two images on my page
at run time
1. first i drag one image on another
2. after that i write some text using a prompt box which is written on the dragged image at run time
3. Now at run time i want to save this final image which looks like above file
can any one Help Me
hello all...
At my project , need for creating cards online..In detail , i have provided the users with some back grounds,images and text...then user make a card by selecting the backgrounds,images, resizing them,entering text into that final image...
To do this , my completed work is : i made all images draggable,resizable and merging of all...
but when i merge all these , the final output comes with the original images not dragged images...
and also i want to know the position where user placed the small image on background image..
please post me any resource....
thank you,
shanti
Good Morning Teacher!!!!!!