Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-09-2009, 04:41 AM PHP onclick
Novice Talker

Posts: 5
Name: vipul
Trades: 0
Hi guys..
I have just started learnin php..
I wanted to know how can u call a function on a Button click in php..
I guess it is not possible
What is the solution for that

Thanks
vipulkelkar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2009, 05:11 AM Re: PHP onclick
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
There isn't one. PHP is a server side code and only runs when pages are requested by the browser.

So your "button" has to request a page to "run" the function.

It can be done using "AJAX" but given that you are asking this question, your programming knowledge and skills are nowhere near being capable of that currently.

You either need to learn a lot more or hire a developer who does know enough.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2009, 08:39 PM Re: PHP onclick
moatist's Avatar
Skilled Talker

Posts: 64
Trades: 0
This would work in some circumstances: (not as an onclick)

PHP Code:

<form name="form" method="post">
   <input name="button" type="submit" value="button" />
</form>

<?php
$button 
$_POST['button'];
if(isset(
$button)){
  
// call PHP function
}
?>
__________________
Think in code; Dream in digital.

<?php if($helpfull == true){ $talkupation++; } ?>

Last edited by moatist; 08-10-2009 at 08:45 PM..
moatist is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP onclick
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11711 seconds with 12 queries