Refer Click Here
for array sorting .
Use a for loop to iterate the array elements and create hexadecimal color value for display.
karthik_ppts commented: useful post +5
Refer Click Here
for array sorting .
Use a for loop to iterate the array elements and create hexadecimal color value for display.
Checkout the form.php Page.
Line no 20 should be
if(document.frm.userNameTxt.value=='')
Like that you have check for every if condition.It should be like
document.formname.fieldname.value
id attribute for all input fields are missing.
Replace like this.
<input type="text" value="" name ="nameTxt" id="name" />
Check out the spelling of kategori and id'.It should be match with table field name.
Change is as
}
}</form>
?>
</body></html>
to
}
}
?>
</form>
</body></html>
Where r u calling class functions?Can you post entire code?
Do u want to check the register no in member table before inserting it into student table?
Hopes this may help you
<!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=utf-8" />
<title>Untitled Document</title>
<script>
function name_dis()
{
var str=document.f.t1.value;
var lett=str.charAt(0);
document.f.t2.value=lett;
}
</script>
</head>
<body>
<form id="form1" name="f" method="post" action="">
<label>
<input type="text" name="t1" id="t1" onkeyup="name_dis()"/>
</label>
<p>
<label>
<input type="text" name="t2" id="t2" />
</label>
</p>
</form>
</body>
</html>
Check Out the condition instead of || you have put |
empty($BusDesc) == TRUE | empty($WelcomeMsg) == TRUE
Try this Query
SELECT date( date_time_field )
FROM DATA WHERE DATE( date_time_field) = DATE( NOW( ) )
Try this script..
<head>
<script>
function windowCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>
<body>
<a href="#" onclick="windowCenter('pop_up_window_center.html', 'POPUP',400,400);">OPEN POPUP</a>
</body>
Where r u using session variables?in PHP right?
Post your errors.
Then it is easy to find out solution.
Change your code as,
<?PHP
session_start();
//use mysql query
$username="xxxx";
if ($username)
{
setcookie('mycookie',$username, time()+3600);
}
include 'dbconnect.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to site</title>
<link href="container.css" rel="stylesheet" type="text/css" />
<link href="format.css" rel="stylesheet" type="text/css" />
<script src="myjs.js" type="text/javascript"></script>
<body>
<?PHP
include 'header.html';
?>
<div class="maincontainer"><h1>Welcome to the site<a href="nextpage.php"> Click here to continue </a></h1></div>
<?PHP
?>
</body>
</html>
setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Cookies must be sent before any output from your script .This requires that you place calls to this function prior to any output, including <html> and <head> tags as well as any whitespace.
Print your insert query after line no 19.
echo $sql;
Copy and paste it into phpmyadmin(or the query analyser u r using).
Execute the query and check out the errors.
Also modify
mysql_query($sql) or die ('Something went wrong with submitting your information <br>'.mysql_error);
Please mark your thread as solved.
Try this code
<script type="text/javascript">
if (document.getElementById('other').checked = true) {
document.getElementById('whatever').style.visibility = "visible";
} else {
document.getElementById('whatever').style.visibility = "hidden";
}
</script>
<input name="pVital[]" type="checkbox" id="pVital[]" value="I & O" checked="<?php if (in_array('I & O', $pvitals)) echo "checked"; else echo "unchecked"; ?>" />I & O<br/>
<input <?php if (in_array('Daily Weight', $pvitals)) echo "checked"; else echo "unchecked"; ?> name="pVital[]" type="checkbox" id="pVital[]" value="Daily Weight" />Daily Weight<br/>
<input <?php if (in_array('Foley Catheter', $pvitals)) echo "checked"; else echo "unchecked"; ?> name="pVital[]" type="checkbox" id="pVital[]" value="Foley Catheter" />Foley Catheter<br/>
<input <?php if (in_array('other', $pvitals)) echo "checked"; else echo "unchecked"; ?> name="pVital[]" type="checkbox" id="other" value="other" />Other<br/>
<input name="pVital[]" type="text" id="whatever" <?php if (in_array('other', $pvitals)) { ?> style="visibility: visible;" <?php } else { ?> style="visibility:hidden" <?php } ?> value="<?php if (in_array('other', $pvitals)) echo end($pvitals); ?>">
What you want ?
Want to pass any variables to redirecting page?
Use the following lines of code to check ur database connection
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
echo "Connected";
}
$sel=mysql_select_db("employdb1");
if (!$sel)
{
die('Could not Select: ' . mysql_error());
}
else
{
echo "Selected";
}
Run this file first and find out whether it is running properly or not
Using PHP I dnt have any idea.
Try this code It using Java script
<!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>
function check()
{
var len=document.f.ck.length;
var ck=document.f.ck;
var l=0;
for(var i=0;i<len;i++)
{
if(ck[i].checked==true)
{
l++;
}
if(l>3)
{
ck[i].checked = false ;
}
}
}
</script>
</head>
<body>
<form id="form1" name="f" method="post" action="">
<p>
<input name="ck" type="checkbox" id="ck" value="checkbox" onclick="check()"/>
PHP</p>
<p>
<input name="ck" type="checkbox" id="ck" value="checkbox" onclick="check()"/>
JSP</p>
<p>
<input name="ck" type="checkbox" id="ck" value="checkbox" onclick="check()"/>
JAVA</p>
<p>
<input name="ck" type="checkbox" id="ck" value="checkbox" onclick="check()"/>
CSS</p>
<p>
<input name="ck" type="checkbox" id="ck" value="checkbox" onclick="check()" />
HTML</p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
</body>
</html>
Try this..
<?php
$myarray=array(0=>"a,1",1=>"b,2",2=>"a,2");
$a=implode(",",$myarray);
$a=explode(",",$a);
$b=array();
$k=0;
for($i=0;$i<sizeof($a);$i++)
{
if($i%2==0)
{
$b[$k]=$a[$i];
$k++;
}
}
$c=array_unique ( $b);
print_r($c);
?>
What r u storing on array?post the array values..
U just find out whether your MYSQL server is running or not.
Go to control panel,Administrative Tools,then click Services.There u can find out the MYSQL service.You can start or restart it.After that run the project.
Also put a closing brace '}' on line no 47
The problem is with ur included pages.
It the missing of closing braces on functions or loops.
Checkout the included pages.
T think it is the missing of double quotes/single quote.The code u posted have no errors.I executed after commenting the 2 function calls.If u can post entire code