Hi,
If i try to post a form (which is placed on two different pages with the same action-page), the strings return null in IE but not in Firefox.
Do you know why?
Printable View
Hi,
If i try to post a form (which is placed on two different pages with the same action-page), the strings return null in IE but not in Firefox.
Do you know why?
post your code
Page a:
Page b:HTML Code:<form name='form2' method='post' action='addlog.php'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' width='33%'>Dato</td>
<td width='33%' align='center'>Aktivitet</td>
<td width='33%' align='center'>Varighed (timer)</td>
</tr>
<tr>
<td align='center'><input name='dato' type='textfield' size='22' value='<?php echo "".$date_array['mday']."/".$date_array['mon']."-".$date_array['year'].""; ?>'></td>
<td width='33%' align='center'><input name='aktivitet' type='textfield' size='22'></td>
<td width='33%' align='center'><input name='varighed' type='textfield' size='22'></td>
</tr>
<tr>
<td colspan='3' align='right'><input type='submit' name='Submit2' value='Tilføj'></td>
</tr>
</table>
<p align='right'> </p>
</form>
processing page:HTML Code:<form name='form2' method='post' action='addlog.php'>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td align='center' width='33%'>Dato</td>
<td width='33%' align='center'>Aktivitet</td>
<td width='33%' align='center'>Varighed (timer)</td>
</tr>
<tr>
<td align='center'><input name='dato' type='text' size='22' value='<?php echo "".$date_array['mday']."/".$date_array['mon']."-".$date_array['year'].""; ?>'></td>
<td width='33%' align='center'><input name='aktivitet' type='text' size='22'></td>
<td width='33%' align='center'><input name='varighed' type='text' size='22'></td>
</tr>
<tr>
<td colspan='3' align='right'><input type='submit' name='Submit2' value='Tilføj'></td>
</tr>
</table>
<p align='right'> </p>
</form>
PHP Code:<?php
include('isuser.php');
include('config.php');
// connect to the mysql database server.
mysql_connect ($dbhost, $dbusername, $dbuserpass);
mysql_select_db($dbname) or die("Cannot select database");
$tdato = $_POST["dato"];
$taktivitet = $_POST["aktivitet"];
$tvarighed = $_POST["varighed"];
$username = $_SESSION["s_username"];
if(!isset($tdato)|!isset($taktivitet)|!isset($tvarighed)) {
echo "
<script language='javascript' type='text/javascript'>
alert('Du har ikke udfyldt alle felter!');
top.location.replace('logbog.php');
</script>
<noscript>
<META HTTP-EQUIV='REFRESH' CONTENT='0;logbog.php'>
</noscript>";
}else{
$query="INSERT INTO $username (`dato` , `aktivitet` , `varighed` )
VALUES ('$tdato', '$taktivitet', '$tvarighed')";
mysql_query($query) or die(mysql_error());
echo "<META HTTP-EQUIV='REFRESH' CONTENT='0;logbog.php'>";
}
?>
type="textfield" doesn't exist. You need to use type="text"
I have tried that
You're all backwards. Use single quotes for strings in PHP and double quotes for attributes in HTML.
And why do you give the form a name? (I honestly don't know what that does)
Gee, penagate...didn't think that worked...
It works like a charm right now - thanks!