i have following form for date
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<form name="form1" method="post" action="date.php">
<label>Date:
<select name="day" id="day">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</label>
-
<label>
<select name="month" id="month">
<option value="1">Jan</option>
<option value="2">Feb</option>
<option value="3">Mar</option>
<option value="4">Apr</option>
<option value="5">May</option>
</select>
</label>
-
<label>
<select name="year" id="year">
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
</select>
</label>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit">
</label>
</p>
</form>
</body>
</html>
and here is the php page
Code: <?php
$day = $_POST["day"];
$month = $_POST["month"];
$year = $_POST["year"];
$date = date($day." ".$month." ".$year);
//$date = date("Y m d");
echo $date;
$db = mysql_connect("localhost");
mysql_select_db("test", $db);
$query = "insert into date
(
date
)
values
(
'".$date."'
)";
//echo $query;
$result = mysql_query($query) or die(mysql_error());
echo "your date is added";
?>
when i select any date from form and press submit button it adds only this 0000-00-00 to my table. i want date to be inserted to my table not 0s. how can i solve this problem
Get keys and values from an array
Hellow,I have an array $Data with keys and values. With a foreach I can display all the values:foreach($Data as $var){ echo $var;}but I also want to display al the keys... how can i do that?
Script not running properly
Hello EveryoneThis is a basic script for posting to a database. I'm not sure why it doesn't work. Can anyone tell me why?Code: [Select]<?phprequire('config.php');if(isset($_GET['id']) == TRUE
Help pulling in 'id' with "read more" link
I'm trying to create snippets of my articles in the cms I'm creating, and then have them redirect to to a single page entry of the article. Right now my snippets and "read more" links are
Help on code output
My CODE:Code: [Select] echo "<phone>".$line["phone"]."</phone>"; echo
BackButton Behaviour in AJAX
I have an ASPX Page AJAX Enabled!The page has a gridView and a DDL for filtering on it. The Gridview has links on its items. The behaviour I am running into is:If I filter a criteria from DDL and then
Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for their post count goes up 1.
Multiple submit forms inside a mysql array page
Hi all,Im having trouble to get the beneath script to work the thing i can't seem to get workin is the following.The page requests the data from a mysql table using mysql array so there are mutliple
convert PHP array to Javascript array
I have a page that gets a request sent from AJAX, and I am trying to convert a PHP array to a javascript array. is this possible? I tried with Json_encode but it doesn't seem to work. is there
get the country of visitor and display content based on that
Hello all,I have seen that Google analytics can tell you where a visitor is coming from and I want to do something similar. But I would like to add the functionality of redirecting a user based on his
Hyperlink is adding an extra gap to variable
Hi, here's my problem..I have a php generated page with a hyperlink which opens in a new windowecho "<tr><td><a