Page point a button call PHP function can be implemented, how to solve

Source: Internet
Author: User
Page point a button call PHP function can be implemented?
Just learned PHP, do not understand anything.

Can I click a button on the PHP page to invoke the PHP function? The worth parameter value entered in the text of this page is used in the function.

Thank you!



------Solution--------------------
Ajax
------Solution--------------------
Ajax, but just started to learn PHP no need to complicate, so as not to combat confidence
------Solution--------------------
The client calls the server-side function, Ajax the best way!
------Solution--------------------
discuss
Ajax, but just started to learn PHP no need to complicate, so as not to combat confidence

------Solution--------------------
Add me qq:117434596.
------Solution--------------------
You should be more specific about your problems, perhaps not necessarily using a button to invoke PHP functions to solve your problem.
------Solution--------------------
Simple, with an OnClick event to deal with Ah! function to use the text in this page to enter the worth parameter value? Are you going to handle the content that gets the user input submitted? As simple as that, $_get,$_post, depending on your needs, and with an onclick event, for example:
PHP Code
After the commit, you can call the corresponding function processing such as submit to this page functions check () {$temp =$_get ("Component name");//Process omitted}
------Solution--------------------
Explore
The function I want to implement is the point button to send the message.

And then the content on the page is going to be passed to this message function,

function SendMail ($to, $from, $SUBJ, $msg, $Location, $StartTime, $EndTime) This is the mail function.

PHP codefunction sendmeeting ()
{$conn = @mysql_connect ("localhost", "root", "") Ordie ("データベース connected エラー"), if ($conn) mysql_select_db ("Business", $conn); $ Sql= "Select Mailadd from the staff where Mailadd<>[email protected] '"; $ResultMailAdd =mysql_query ($SQL); $from = "[ Email protected] "; while ($mailAdd =mysql_fetch_array ($RESULTMAILADD));
{
SendMail ($mailAdd [' Mailadd '], $from, $_post["Subject"],$_post["Body"],$_post["Location"],$_post["StartTime"],$_ post["EndTime"]);
}mysql_close ($conn);
}

This is the function that sends the message, this function calls the above function, and the parameter uses the content of the page and the database

Can you do it without a button? Thanks for pointing.

------Solution--------------------
OK
You're using AJAX technology.

------Solution--------------------
Click the button to send mail?

Then you write your e-mail function into a php file, click the button to invoke the PHP file, it is not OK. I don't have to onclick,ajax anything.

------Solution--------------------
Explore
The function I want to implement is the point button to send the message.

And then the content on the page is going to be passed to this message function,

function SendMail ($to, $from, $SUBJ, $msg, $Location, $StartTime, $EndTime) This is the mail function.

PHP codefunction sendmeeting ()
{$conn = @mysql_connect ("localhost", "root", "") Ordie ("データベース connected エラー"), if ($conn) mysql_select_db ("Business", $conn); $ Sql= "Select Mailadd from the staff where Mailadd<>[email protected] '"; $ResultMailAdd =mysql_query ($SQL); $from = "[ Email protected] "; while ($mailAdd =mysql_fetch_array ($RESULTMAILADD));
{
SendMail ($mailAdd [' Mailadd '], $from, $_post["Subject"],$_post["Body"],$_post["Location"],$_post["StartTime"],$_ post["EndTime"]);
}mysql_close ($conn);
}

This is the function that sends the message, this function calls the above function, and the parameter uses the content of the page and the database

Can you do it without a button? Thanks for pointing.

------Solution--------------------
discuss
15 floor of the saying this is not what the client server side? Really do not understand, hehe

------Solution--------------------
Too simple, of course, PHP can be implemented, HTML to write a form form to submit a input:text is (with JS better)
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.