Cita:
Iniciado por by_antun
<?php
$resultado= mysql_query ("SELECT fecha_cotizacion FROM cotizacion");
$result = mysql_result($resultado);
$fecha = date("Y-m-d");
if ($fecha > $result)
{
echo "Favor modificar cotizacion";
header("location:cotizacion.php");
else
{
header("location:welcome.php");
}
?>
Eso es php, en javascript lo podrías hacer de este modo:
Código PHP:
Ver original<script type="text/javascript">
var current_date = new Date();
var full_mysql_date = "<?php echo $mi_fecha_de_la_base; ?>";
var mysqldate_parts = full_mysql_date.split("-");
var mysqldate = new Date(mysqldate_parts[0], mysqldate_parts[1] - 1, mysqldate_parts[2]);
if(current_date >= mysqldate){
window.location.href = 'archivo.php';
}else{
alert('mensaje');
}
</script>