Calling php file from outside of action tag

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
indian98476
Forum Commoner
Posts: 78
Joined: Tue Dec 15, 2009 3:24 am

Calling php file from outside of action tag

Post 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?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Calling php file from outside of action tag

Post 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
indian98476
Forum Commoner
Posts: 78
Joined: Tue Dec 15, 2009 3:24 am

Re: Calling php file from outside of action tag

Post 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....
indian98476
Forum Commoner
Posts: 78
Joined: Tue Dec 15, 2009 3:24 am

Re: Calling php file from outside of action tag

Post 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'
Post Reply