Solved

Working with Mysql-dateformat

Posted on 2004-08-13
36
342 Views
Last Modified: 2013-12-12
On a form several dates can be filled in wich will be inserted into a Mysql-database (after pressing the submit-button). Now it seems (i never worked with Mysql before) that it stores the date in the yyyy-mm-dd format.

I want the form to hold the date in a dd-mm-yyyy format (when loading data into a form) and to be able to fill in a date like dd-mm-yyyy and still get it stored correctly. Anyone got an easy solution to this?

The form now looks like this:
<tr><td>Closing date:</td><td><input type="text" name="d_hd_close" size=14 maxlength=14 /></td></tr>
0
Comment
Question by:mOTiVe
  • 16
  • 12
  • 5
  • +2
36 Comments
 
LVL 26

Assisted Solution

by:ushastry
ushastry earned 80 total points
Comment Utility
Hi,

Before the INSERT query, say u have dd-mm-yyyy format then u have to convert it..


$dateOld = explode("-",$date);
$year = $dateOld[2];
$month = $dateOld[1];
$day = $dateOld[0];

$dateMySQL = $year."-".$month."-".$day;

When displaying, say u have yyyy-mm-dd format then u have to convert it..

$dateOld = explode("-",$date);
$year = $dateOld[0];
$month = $dateOld[1];
$day = $dateOld[2];



$dateForm   = $day."-".$month."-".$year;


Hope this Helps!
0
 
LVL 26

Expert Comment

by:ushastry
Comment Utility
Even directly from the table itself while querying you can set the appropriate date format..

SELECT DATE_FORMAT(dateField,'%d-%m-%Y') from table
0
 

Author Comment

by:mOTiVe
Comment Utility
I'm rather fond of the second option with it being short, but does it work with INSERT-queries aswell?

First option makes format-checking easy..

On to the test-court!
0
 
LVL 26

Expert Comment

by:ushastry
Comment Utility
Hi..

I don't think so mOTiVe.. I got to go now.. I'll check it 2row & will let you know..

0
 
LVL 27

Assisted Solution

by:Diablo84
Diablo84 earned 20 total points
Comment Utility
mOTiVe, have you considered using a timestamp instead, it is a much more convienient method of both storing and formatting the date.

when you insert a row just use the mysql  NOW() function

eg. INSERT INTO tablename (field) VALUES (NOW())

then use the php date function to format it when you pull it out of the database, eg, supposing the variable $var contained the timestamp

$var = date("d-m-Y",$var);
echo $var;

more info on the date function: http://www.php.net/manual/en/function.date.php
0
 

Author Comment

by:mOTiVe
Comment Utility
@Diablo84: If i use the timestamp i get dates like 2021-12-20 in my database instead of 21-12-2002. It is a form i am talking about and i am not letting my users fill in a form with 'yyyy-mm-dd'.

Also from what i read the % isn't optional anymore (%d-%m-%Y)
0
 
LVL 27

Expert Comment

by:Diablo84
Comment Utility
>>  If i use the timestamp i get dates like 2021-12-20 in my database instead of 21-12-2002.

That is probably because your table field is in date format and it would need to be in int format eg int(15)

you could still let a user enter a date in human friendly form and then convert it to a timestamp using strtotime function
0
 

Author Comment

by:mOTiVe
Comment Utility
That would pose some problems with the reporting end of it all.. but i will check it out and report back here to you all on monday. Got a weekend to attend to now! :D
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
i can give you a script like the following if you want.

1. Get the input from the form as dd-mm-yyyy (with validation)
2. Change it as yyyy-mm-dd format using a function and store it in DB.
3. While retrieving, change the format of yyyy-mm-dd to dd-mm-yyyy using a function.  (You can write the function in a common PHP file to avoid redundancy.)

because normally DB allows yyyy-mm-dd format and the above functions will neither affect your code or DB fields.
0
 

Author Comment

by:mOTiVe
Comment Utility
That would be great, if you could. Is it a php-script or javascript? It smells like clientside-scripting ;). I can't depend on clientside scripting for this to work (or i could get wrong dates from folks who do not allow javascript 'to happen')

Still i am always curious to see it (even if it is clientside)
0
 
LVL 32

Accepted Solution

by:
ldbkutty earned 180 total points
Comment Utility
This is a simple example code:

<?php
      
// Returns Date in dd-mm-yyyy OR in yyyy-mm-dd format depending upon the input $date_field.

function dateFormat($date_field)
{
   $date_parts = explode('-', $date_field);
   $date = $date_parts[2] . "-" . $date_parts[1] . "-" . $date_parts[0];
   return $date;
}

// Validate and input the Query.

if(isset($_POST['submit'])) {
 
   // Your DB connection here.

   if(trim($_POST['datefield']) == '')  {
        echo "<font color='RED'><b> Date field cannot be empty </b></font>";
   }
 
   else if(!ereg("^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$",$_POST["datefield"])){
         echo "<font color='RED'><b> Please provide date in the dd-mm-yyyy format </b></font>";
   }

  else {

        $formattedDate = dateFormat($_POST['datefield']);       
        $query = "INSERT INTO tablename(date_column) VALUES('".$formattedDate."')";

        mysql_query($query) or die("Insert Query Error : " .mysql_error());
        echo " $query  -- Execute Successfully";
  }

}

?>

<html>
<body>

<form action="chumma.php" action="POST">
Date: <input type="text" name="datefield" value="<?php echo isset($_POST['datefield']) ? $_POST['datefield'] : ''; ?>" >
<br><br> <input type="submit" name="submit" value="Submit">
</form>

</body>
</html>

Hope you get an idea. :-)
0
 

Author Comment

by:mOTiVe
Comment Utility
Sorry my weekend took so long! :P

[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4} will check if the numbers are in a wide range, e.g. 99-99-9999 will be accepted. Isn't there a check for (max 31)-(max 12)-(around 2000) (last bit optional).

----

$formattedDate = dateFormat($_POST['datefield']);

Can i use:
$datefield = dateFormat($_POST['datefield']);

instead so there's no need for additional variables? The date has to be formatted no matter what.

I will go look'n'see what this does..
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
>> Can i use:
>> $datefield = dateFormat($_POST['datefield']);

Yes, you can.

>> Isn't there a check for (max 31)-(max 12)-(around 2000) (last bit optional).

http://www.smartwebby.com/DHTML/date_validation.asp

I think its not that difficult to change the JS code part to PHP.
0
 

Author Comment

by:mOTiVe
Comment Utility
(upped the points a bit since i keep asking for more :P)

there might be an error somewhere.. when i tried this out all i get is a link in IE with all the data but nothing is done with it.

I tried three dates (none, faulty and a good one).. all three have the same result.

Also tried renaming the button wich is used (has the value=Versturen since it's all in dutch).. didn't work

Also tried using _REQUEST instead of _POST since filling variables (like $a = $_POST['a']; didnt work but $a = $_REQUEST['a'] did) but also to no avail..

Any suggestions?
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
i will get back to you in some hours..now i have some other works...meanwhile, could you please give me the code you have now.
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
>> when i tried this out all i get is a link in IE with all the data but nothing is done with it.
do you mean you get a blank page(?) with my PHP code or what?
0
 

Author Comment

by:mOTiVe
Comment Utility
Just got one step ahead.. the form wasn't loading since the bit:

if(isset($_POST['submit'])) {

had to be like:

if(isset($submit')) {

apparently submit is no part of the _POST but it gets it's own variable..

I get this error now:

Parse error: parse error, expecting `','' or `')'' in /var/www/html/pehapehen.php on line 84

wich holds (line 84):
  if(trim($_REQUEST['d_datum_aanmaak']) == '')  {

getting weird on me now..
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
parse error in line 84 means the error might be in between lines 80 till 86. Please post that part.

>> apparently submit is no part of the _POST but it gets it's own variable..
'submit' is a part of the form and hence be accessed as $_POST['submit'] also.

I think it would better if you could show me your code(as far as it is not too long !).
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mOTiVe
Comment Utility
This bit comes after i declared myself some 50 orso variables. I edited out the query and db/password since one is a bit long and the other is a bit private :D..

// Validate and input the Query.

if(isset($Versturen')) {
 
   // Your DB connection here.
   $host = "localhost";
   $username = "root";
   $password = "*************";
   $database = "*****";

   $server = mysql_connect($host, $username, $password) or die(mysql_error());
   $connection = mysql_select_db($database, $server);

   // Input controle
   if(trim($_REQUEST['d_datum_aanmaak']) == '' )  {
        echo "<font color='RED'><b> Date field cannot be empty </b></font>";
   }
 
   else if(!ereg("^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$",$_REQUEST["d_datum_aanmaak"])) {
         echo "<font color='RED'><b> Please provide date in the dd-mm-yyyy format </b></font>";
   }

  else {

        $df_datum_aanmaak = dateFormat($_REQUEST['d_datum_aanmaak']);      
        $query = (edited out but it works);
       
        mysql_query($query) or die("Insert Query Error : " .mysql_error());
        echo " $query  -- Execute Successfully";

        $d_vlw_dossiernr = mysql_insert_id();

        echo "Opgeslagen onder nummer: $d_vlw_dossiernr";
       
        mysql_close($server);

  }

}
0
 

Author Comment

by:mOTiVe
Comment Utility
After editing like this:

   $d_datum_aanmaak = trim($d_datum_aanmaak)
   if($d_datum_aanmaak == '') {

It still gives an error on the line (wich now has a different number) with if($d_datum_aanmaak == '') {

Note that it is a ' ' and not a " but the php-parser seems not to notice this?
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
>> if(isset($Versturen')) {

should be:

if(isset($Versturen)) {

or:

if(isset($_POST['Versturen'])) {
0
 

Author Comment

by:mOTiVe
Comment Utility
Edited that, but still get the same error.

After i marked out the check on (date not '') completely and having it only check for (date numeric) i get the error on that line. Something is messed up so it seems..
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
I dont think i understand your problem exactly. :-(
I still dont know what is your lines from 80 till 86.
0
 

Author Comment

by:mOTiVe
Comment Utility
80.   // Select the database now
81.   $connection = mysql_select_db($database, $server);
82.
83.   // Input controle
84.   $df_datum_aanmaak = trim($d_datum_aanmaak)
85.   if($d_datum_aanmaak == "") {
86.        echo "<font color='RED'><b> Date field cannot be empty </b></font>";
87.   }
88.  
89.   if(!ereg("^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$",$_REQUEST["d_datum_aanmaak"])) {
90.         echo "<font color='RED'><b> Please provide date in the dd-mm-yyyy format </b></font>";
91.   }

I dowloaded Zend-Studio (trial) for it's debugging capabilities. It gives me the following error on line 85:

Parsing error: <filename> line 85 - parse error, unexpected T_IF
0
 

Author Comment

by:mOTiVe
Comment Utility
Also would like to point out that this if-statement is nested in the "if(isset($Versturen))" if-statement.

Anyone with ideas of why this is illegal?
0
 
LVL 2

Expert Comment

by:sangeetha
Comment Utility
>> $df_datum_aanmaak = trim($d_datum_aanmaak)
should be:
$df_datum_aanmaak = trim($d_datum_aanmaak);
0
 

Author Comment

by:mOTiVe
Comment Utility
i used df (f stands for formatted) to check whether the error came from using variables the way i did. The parse-error is not related to this..
0
 

Author Comment

by:mOTiVe
Comment Utility
Changed "my" code again.. this time doing the if-statements first, after that. I don't get the error anymore, but the screen stays white (nothing happens).

Here's the full code if anyone wants to check it:

<?
//variabelen inlezen
$d_vlw_dossiernr = $_REQUEST['d_vlw_dossiernr'];
$d_dossiernr_hudi = $_REQUEST['d_dossiernr_hudi'];
$d_datum_aanmaak = $_REQUEST['d_datum_aanmaak'];
$d_datum_hudi = $_REQUEST['d_datum_hudi'];
$hereniging = $_REQUEST['hereniging'];
$toestemming = $_REQUEST['toestemming'];
$d_groepid = $_REQUEST['d_groepid'];
$d_contact1 = $_REQUEST['d_contact1'];
$d_contact2 = $_REQUEST['d_contact2'];
$d_contact1_tel = $_REQUEST['d_contact1_tel'];
$d_contact2_tel = $_REQUEST['d_contact2_tel'];
$d_contact_nood = $_REQUEST['d_contact_nood'];
$d_familienaam = $_REQUEST['d_familienaam'];
$d_voornamen = $_REQUEST['d_voornamen'];
$d_nationaliteit = $_REQUEST['d_nationaliteit'];
$d_gebdatum = $_REQUEST['d_gebdatum'];
$d_geslacht = $_REQUEST['d_geslacht'];
$d_ind_dossiernr = $_REQUEST['d_ind_dossiernr'];
$d_status = $_REQUEST['d_status'];
$d_uitreiking = $_REQUEST['d_uitreiking'];
$d_huisvesting = $_REQUEST['d_huisvesting'];
$d_telnr = $_REQUEST['d_telnr'];
$d_inkomen = $_REQUEST['d_inkomen'];
$d_ink_spec_type = $_REQUEST['d_ink_spec_type'];
$d_ink_spec_anders = $_REQUEST['d_ink_spec_anders'];
$d_familieid = $_REQUEST['d_familieid'];
$d_spec_med = $_REQUEST['d_spec_med'];
$d_spec_med_toe = $_REQUEST['d_spec_med_toe'];
$d_advies_hd = $_REQUEST['d_advies_hd'];
$d_advies_hd_vraag = $_REQUEST['d_advies_hd_vraag'];
$d_advies_hd_toe = $_REQUEST['d_advies_hd_toe'];
$d_ind_advies = $_REQUEST['d_ind_advies'];
$d_plaats_mvv = $_REQUEST['d_plaats_mvv'];
$d_opm_mvv = $_REQUEST['d_opm_mvv'];
$d_pp_reis = $_REQUEST['d_pp_reis'];
$d_pp_plaats = $_REQUEST['d_pp_plaats'];
$d_pp_uitgifte = $_REQUEST['d_pp_uitgifte'];
$d_pp_geldig = $_REQUEST['d_pp_geldig'];
$d_laissez = $_REQUEST['d_laissez'];
$d_vfam_plaats = $_REQUEST['d_vfam_plaats'];
$d_vfam_adres = $_REQUEST['d_vfam_adres'];
$d_vfam_tel = $_REQUEST['d_vfam_tel'];
$d_vfam_vliegveld = $_REQUEST['d_vfam_vliegveld'];
$d_vfam_land = $_REQUEST['d_vfam_land'];
$d_hd_garant = $_REQUEST['d_hd_garant'];
$d_hd_hoogte = $_REQUEST['d_hd_hoogte'];
$d_hd_vervalt = $_REQUEST['d_hd_vervalt'];
$d_hd_regio = $_REQUEST['d_hd_regio'];
$d_hd_afwijz_type = $_REQUEST['d_hd_afwijz_type'];
$d_hd_afwijz_anders = $_REQUEST['d_hd_afwijz_anders'];
$d_hd_reisverslag = $_REQUEST['d_hd_reisverslag'];
$d_hd_aankomst = $_REQUEST['d_hd_aankomst'];
$d_hd_betaal = $_REQUEST['d_hd_betaal'];
$d_hd_bedrag = $_REQUEST['d_hd_bedrag'];
$d_hd_sluiten = $_REQUEST['d_hd_sluiten'];


// Returns Date in dd-mm-yyyy OR in yyyy-mm-dd format depending upon the input $date_field.
function dateFormat($date_field)
{
   $date_parts = explode('-', $date_field);
   $date = $date_parts[2] . "-" . $date_parts[1] . "-" . $date_parts[0];
   return $date;
}

// Validate and input the Query.
if(isset($_REQUEST['Versturen'])) {

   // Input controle
   if(trim($d_datum_aanmaak == "")) {
        echo "<font color='RED'><b> Date field cannot be empty </b></font>";
   }
     
   if(!ereg("^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$",$_REQUEST["d_datum_aanmaak"])) {
         echo "<font color='RED'><b> Please provide date in the dd-mm-yyyy format </b></font>";
   }
  else {

        // Your DB connection here.
        $host = "localhost";
        $username = "root";
        $password = "importantnottotell";
        $database = "Groepenfonds";
        $server = mysql_connect($host, $username, $password) or die(mysql_error());
        $connection = mysql_select_db($database, $server);

        $df_datum_aanmaak = dateFormat($_REQUEST['d_datum_aanmaak']);      
        $query = "INSERT INTO <really long query>)";
       
        mysql_query($query) or die("Insert Query Error : " .mysql_error());
        echo " $query  -- Execute Successfully";
        $d_vlw_dossiernr = mysql_insert_id();
        echo "Opgeslagen onder nummer: $d_vlw_dossiernr";
        mysql_close($server);
  }
}
?>
0
 
LVL 26

Assisted Solution

by:ushastry
ushastry earned 80 total points
Comment Utility
Hi,

Check whether Versturen is set or not..

<?
//variabelen inlezen
$d_vlw_dossiernr = $_REQUEST['d_vlw_dossiernr'];
$d_dossiernr_hudi = $_REQUEST['d_dossiernr_hudi'];
$d_datum_aanmaak = $_REQUEST['d_datum_aanmaak'];
$d_datum_hudi = $_REQUEST['d_datum_hudi'];
$hereniging = $_REQUEST['hereniging'];
$toestemming = $_REQUEST['toestemming'];
$d_groepid = $_REQUEST['d_groepid'];
$d_contact1 = $_REQUEST['d_contact1'];
$d_contact2 = $_REQUEST['d_contact2'];
$d_contact1_tel = $_REQUEST['d_contact1_tel'];
$d_contact2_tel = $_REQUEST['d_contact2_tel'];
$d_contact_nood = $_REQUEST['d_contact_nood'];
$d_familienaam = $_REQUEST['d_familienaam'];
$d_voornamen = $_REQUEST['d_voornamen'];
$d_nationaliteit = $_REQUEST['d_nationaliteit'];
$d_gebdatum = $_REQUEST['d_gebdatum'];
$d_geslacht = $_REQUEST['d_geslacht'];
$d_ind_dossiernr = $_REQUEST['d_ind_dossiernr'];
$d_status = $_REQUEST['d_status'];
$d_uitreiking = $_REQUEST['d_uitreiking'];
$d_huisvesting = $_REQUEST['d_huisvesting'];
$d_telnr = $_REQUEST['d_telnr'];
$d_inkomen = $_REQUEST['d_inkomen'];
$d_ink_spec_type = $_REQUEST['d_ink_spec_type'];
$d_ink_spec_anders = $_REQUEST['d_ink_spec_anders'];
$d_familieid = $_REQUEST['d_familieid'];
$d_spec_med = $_REQUEST['d_spec_med'];
$d_spec_med_toe = $_REQUEST['d_spec_med_toe'];
$d_advies_hd = $_REQUEST['d_advies_hd'];
$d_advies_hd_vraag = $_REQUEST['d_advies_hd_vraag'];
$d_advies_hd_toe = $_REQUEST['d_advies_hd_toe'];
$d_ind_advies = $_REQUEST['d_ind_advies'];
$d_plaats_mvv = $_REQUEST['d_plaats_mvv'];
$d_opm_mvv = $_REQUEST['d_opm_mvv'];
$d_pp_reis = $_REQUEST['d_pp_reis'];
$d_pp_plaats = $_REQUEST['d_pp_plaats'];
$d_pp_uitgifte = $_REQUEST['d_pp_uitgifte'];
$d_pp_geldig = $_REQUEST['d_pp_geldig'];
$d_laissez = $_REQUEST['d_laissez'];
$d_vfam_plaats = $_REQUEST['d_vfam_plaats'];
$d_vfam_adres = $_REQUEST['d_vfam_adres'];
$d_vfam_tel = $_REQUEST['d_vfam_tel'];
$d_vfam_vliegveld = $_REQUEST['d_vfam_vliegveld'];
$d_vfam_land = $_REQUEST['d_vfam_land'];
$d_hd_garant = $_REQUEST['d_hd_garant'];
$d_hd_hoogte = $_REQUEST['d_hd_hoogte'];
$d_hd_vervalt = $_REQUEST['d_hd_vervalt'];
$d_hd_regio = $_REQUEST['d_hd_regio'];
$d_hd_afwijz_type = $_REQUEST['d_hd_afwijz_type'];
$d_hd_afwijz_anders = $_REQUEST['d_hd_afwijz_anders'];
$d_hd_reisverslag = $_REQUEST['d_hd_reisverslag'];
$d_hd_aankomst = $_REQUEST['d_hd_aankomst'];
$d_hd_betaal = $_REQUEST['d_hd_betaal'];
$d_hd_bedrag = $_REQUEST['d_hd_bedrag'];
$d_hd_sluiten = $_REQUEST['d_hd_sluiten'];


// Returns Date in dd-mm-yyyy OR in yyyy-mm-dd format depending upon the input $date_field.
function dateFormat($date_field)
{
   $date_parts = explode('-', $date_field);
   $date = $date_parts[2] . "-" . $date_parts[1] . "-" . $date_parts[0];
   return $date;
}

// Validate and input the Query.
if(isset($_REQUEST['Versturen']))
{

    // Input controle
    if(trim($d_datum_aanmaak == ""))
    {
        echo "<font color='RED'><b> Date field cannot be empty </b></font>";
    }

    if(!ereg("^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{4}$",$_REQUEST["d_datum_aanmaak"]))
    {
         echo "<font color='RED'><b> Please provide date in the dd-mm-yyyy format </b></font>";
    }
    else {

            // Your DB connection here.
            $host = "localhost";
            $username = "root";
            $password = "importantnottotell";
            $database = "Groepenfonds";
            $server = mysql_connect($host, $username, $password) or die(mysql_error());
            $connection = mysql_select_db($database, $server);

            $df_datum_aanmaak = dateFormat($_REQUEST['d_datum_aanmaak']);
            $query = "INSERT INTO <really long query>)";

            mysql_query($query) or die("Insert Query Error : " .mysql_error());
            echo " $query  -- Execute Successfully";
            $d_vlw_dossiernr = mysql_insert_id();
            echo "Opgeslagen onder nummer: $d_vlw_dossiernr";
            mysql_close($server);
    }
}else{
    print "Versturen NOT SET";
}
?>
0
 

Author Comment

by:mOTiVe
Comment Utility
Smart.. "Versturen" is not set, yet the form wich is filled in contains the following:

   <tr><td colspan="2" align="center"><input type="submit" Value="Versturen" /></td></tr>

When the button is pressed Versturen should be set imho.
0
 
LVL 32

Assisted Solution

by:ldbkutty
ldbkutty earned 180 total points
Comment Utility
>> "Versturen" is not set, yet the form wich is filled in contains the following:

Then it should be like:

<tr><td colspan="2" align="center"><input type="submit" name="Versturen" Value="Versturen" /></td></tr>

or value = "imho" depending upon display of "Versturen".

Note: Only the 'name' parameter in the form will be passed and that 'name' carries its 'value'.
------

If you want to display 'Versturen' but you want its value to be 'imho', then you can have 'hidden' input type. Like:

<tr><td colspan="2" align="center"><input type="submit" Value="Versturen" /></td></tr>
 <input type="hidden" name="Versturen" value="imho" />
0
 
LVL 26

Expert Comment

by:ushastry
Comment Utility
Also if you wann try this..

>>When the button is pressed Versturen should be set imho
Call this funstion..so that when button is pressed the value will be set ..

<script LANGUAGE="JavaScript">
function setval(val)
{
           document.formNameGoesHere.Versturen.value = val;
<!--         Add this line if you want to submit that form after setting value..
           formNameGoesHere.submit();  -->
}
</script>

<tr><td colspan="2" align="center"><input type="submit"  name="Versturen" value="" onclick="setval('imho');"></td></tr>


Hope this helps!
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
Your:

<tr><td colspan="2" align="center"><input type="submit" Value="Versturen" /></td></tr>

will not be passed since there's no 'name' associated for the 'Versturen' value.
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
ushatry,

i think it should be:

<tr><td colspan="2" align="center"><input type="submit"  name="Versturen" value="Versturen" onclick="setval('imho');"></td></tr>

But i thought hidden type is simpler than JS.
0
 

Author Comment

by:mOTiVe
Comment Utility
Silly.. thought i named it but i just gave it a value.. :P

The date-format also works (that's the idea what started this mess!)
I got some more questions but will make new threads for that.

btw: imho stands for "in my humble opinion". I wasn't setting a variable with it.. just thought "it should be set in my humble opinion" :D

Thanks all who participated. I splitted points, giving most to ldbkutty..
0
 
LVL 32

Expert Comment

by:ldbkutty
Comment Utility
>> btw: imho stands for "in my humble opinion". I wasn't setting a variable with it.. just thought "it should be set in my humble opinion"

:-)

Thanks for the points.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now