检测表单何时来自灯箱或直接来自页面

I had created a light box

<a href="customer.php?lightbox[width]=396&lightbox[height]=250&lightbox[modal]=true&box=1"
     class="lightbox" id="flier">Add Customer
</a>

I just want to find out, the form is posted from lightbox or directly through customer.php.

If it is from lightbox, it will reopen the lightbox until close is manually clicked.

You could set a hidden form field in the form inside of the light box like this

<input type="hidden" name="modal" value="set" />

Then when the page reloads, use some PHP to see if that field is set:

<? if(isset($_POST['modal'])): ?>

<script type="text/javascript">
    $("#add-customer").someEventToOpenYourModal();
</script>

<? endif; ?>