Page 1 of 1

Calling php file from outside of action tag

Posted: Sat Dec 19, 2009 1:13 am
by indian98476
I want to call a .php file for the html form but it should not be mentioned in the action tag
eg: <form name="f1" method="post" action="test.php">

now, i want this action tag to be empty but still call the same test.php file from some other place....is it possible?

Re: Calling php file from outside of action tag

Posted: Sat Dec 19, 2009 2:14 am
by requinix
If you include the PHP file you want in the PHP file mentioned in the form's action, it'll work.

So

Code: Select all

<form name="f1" method="post" action="visible.php">
visible.php

Code: Select all

<?php include "hidden.php"; ?>
hidden.php

Code: Select all

<?php
 
// whatever you want

Re: Calling php file from outside of action tag

Posted: Sat Dec 19, 2009 2:21 am
by indian98476
isn't it now like a call to one file after another? i was looking for something like placing it in the same html form....

Re: Calling php file from outside of action tag

Posted: Sat Dec 19, 2009 2:23 am
by indian98476
or maybe anywhere else in the php also....i know your method works well....but i am looking for these other alternatives...a guy just popped up this question 2 me and it was like 'oh! i never thot of it this way'