Can you use a button to call an PHP function from an external file?

  • Thread starter Thread starter Kitkatfox
  • Start date Start date
K

Kitkatfox

Guest
Here's what i'm thinking (but this doesn't work for me);

<form action="external.php?func=changeCredit" method="post">
Purchase: <input type="text" name="newcredit" />
<input type="submit" value="Buy" />
</form>
 
That will work, as long as your PHP file extracts the "func" value from the URL (i.e. $POST variable).
And calls "eval()" I believe.
And of course if the "changeCredit" function is external from the "external.php" file, that file will have to be included (or required).

http://us.php.net/manual/en/function.eval.php
 
Back
Top