Javascript Question

Form is returning value 1 on submit

I have some contents and table in my form. On submitting, when i echo the post value coming from form, it's showing value "1" against each entered value.

I am surprised that why it's all happening.?
Even i have commented out all of my css and java-script linked libraries/files, still it's returning 1.

Help me!

html

<div id="page-wrap">
<form method="post" action="save_view.php">

<textarea id="header">INVOICE</textarea>

<div id="identity">



<div>


<img id="image" src="images/logo_1.png" alt="logo" />
</div>

</div>


<div style="clear:both"></div>

<div id="customer">
<table id="meta">
<tr>
<td class="meta-head">Invoice #</td>
<td>
<input name="Invoice" type="text"/>

</td>
</tr>


<tr>
<td class="meta-head">Customer Name</td>
<td>
<input name="cname" type="text"/>

</td>
</tr>

<tr>

<td class="meta-head">Paid Date</td>
<td>
<input name="pdate" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Sales Person</td>
<td>
<input name="sperson" type="text"/>

</td>
</tr>

</table>

</div>
<input name="submit" type="submit" value="Submit"/>

</form>


save_view.php

if(isset($_POST['submit']))
{
echo $invoice = isset($_POST['Invoice']);
die();
}

Answer

isset returns a boolean.

if(isset($_POST['submit']))
{
    $invoice = isset($_POST['Invoice']) ? ;$_POST['Invoice'] : '';
    echo ($invoice);
    die();
}
Comments