using Form with PHP - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > PHP » using Form with PHP


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 07-13-2006   #1 (permalink)
shavei7
Senior Member
 
shavei7's Avatar
 
Join Date: Jul 2006
Location: Redmond, WA
Posts: 1,064
Default using Form with PHP

hey all..
this is what i'm trying to do..
i have a login page (login.php)
i want that when you click the SUBMIT button, it goes to a function instead of a php page...

this is LOGIN.php

<?php
<form name="form_login">
<input type="submit" onClick="document.form_login.action='TEST.php';doc ument.form_login.TEST();">
</form>
?>


this is TEST.php

<?php function TEST() {
echo 'TEST TEST TEST TEST';
} ?>


is what i'm trying to do possible? i know i'm missing something in the code...
shavei7 is offline   Reply With Quote


Old 07-14-2006   #2 (permalink)
imehesz
Senior Member
 
imehesz's Avatar
 
Join Date: Jul 2006
Age: 30
Posts: 258
Default

try this:


PHP Code:
<form name="form_login">
<
input type="submit" onClick="location.href='TEST.php';">
</
form
__________________
--
iM
imehesz is offline   Reply With Quote

Old 07-15-2006   #3 (permalink)
shavei7
Senior Member
 
shavei7's Avatar
 
Join Date: Jul 2006
Location: Redmond, WA
Posts: 1,064
Default Re: using Form with PHP

what i want is that it will call the function not the page.

i'm going to put common functions in a single php file (in this case i'll call it TEST.php). and this specific form will only need to run the TEST() function from TeST.php will contains several other functions... any ideas??
shavei7 is offline   Reply With Quote

Old 07-20-2006   #4 (permalink)
imehesz
Senior Member
 
imehesz's Avatar
 
Join Date: Jul 2006
Age: 30
Posts: 258
Default Re: using Form with PHP

back at ya,

ok, now i know what you'd like to do however:
"It is not possible to directly call a php function from JavaScript"

why can't you just call a .php file instead?
__________________
--
iM
imehesz is offline   Reply With Quote

Old 07-30-2006   #5 (permalink)
shavei7
Senior Member
 
shavei7's Avatar
 
Join Date: Jul 2006
Location: Redmond, WA
Posts: 1,064
Default Re: using Form with PHP

i found a way to work around this hehehe thanks anyways! :)
shavei7 is offline   Reply With Quote

Old 08-02-2006   #6 (permalink)
Ankita
Member
 
Join Date: Jul 2006
Age: 25
Posts: 53
Default Re: using Form with PHP

Try
$p =& $_POST;
instead of using function write code with in if condition
if($p['name of button'])
{
}
Ankita is offline   Reply With Quote

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What Business Form do you use? LLC, INC, etc? jason Affiliate Marketing 2 07-29-2006 10:22 PM
. Retrieving files form database justin ASP 0 07-27-2006 04:59 PM
Additions to the New Post Form - PLEASE USE IT natalie Graphics & Multimedia 0 07-05-2006 05:45 PM


footer left
All times are GMT. The time now is 09:23 PM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Electricity Suppliers | Free Advertising | Myspace Layouts | Loans | Equity Release

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49