douewei1665 2016-12-31 08:40
浏览 46

PHP联系表单链接到api,电子邮件也被发送到邮件ID

I have an issue with PHP form which is coded as follows

<?php
include "conn.php";
?>
<!DOCTYPE html>
<html>
<head>

    <title>Redbrick</title>
    <meta name="description" content="">
    <link rel="shortcut icon" href="images/favicon.ico" />
    <?php include "js-css.php"; ?>
    <meta charset="UTF-8">
    <script>
    var deleteid = 0;
    function deletefunc(del)
        {
            deleteid = del;
            $( "#deletedialog" ).dialog( "open" );
        }
        function deletethis()
            {
            $.post("delete.php?tab=careers", {deleteid : deleteid},
            function(data) {
                $('#deldiv').show();
                }
                ); 
         }
    </script>
</head>
<body>
<section id="main-content">   


 <section id="content">
  <div class="centered">
      <div class="grid-1">
           <div class="title-grid"><span>Enquiry</span><span style="float:right;text-decoration:none;"><a href="careers-inner.php?type=add" style="color:#fff !important;">Enquiry Listings</a></span></div>
           <div class="content-gird">
           <div class="alert red hideit" style="display:none;" id="deldiv"><a class="close" onclick ="location.reload();">Close</a></div>
           <?php 
                global $con;
$prod_qry = mysqli_query($con,"select * from signup order by id");
           ?>
                <table class="display" id="example">
                <thead>
                    <tr>
                        <th class="th_chexbox"><input type="checkbox" name="set" onclick="setChecked(this)" /></th>
                        <th class="th_title">Fullname</th>
                        <th class="th_status">Email</th>
                        <th class="th_action">phone </th>
                        <th class="th_action">city </th>
                        <th class="th_action">enquiry </th>
                    </tr>
                </thead>
                <tbody>
                <?php while ($prod = mysqli_fetch_array($prod_qry)) { ?>
                    <tr class="item">
                        <td><input type="checkbox" name="id[]" value="1" /></td>
                        <td class="subject"><a href="careersdetails-inner.php?type=view&id=<?= $prod['id']; ?>"><?= $prod['fullname']; ?></a></td>
                        <td><?= $prod['email']; ?></td>
                        <td><?= $prod['phone']; ?></td>
                        <td><?= $prod['city']; ?></td>
                        <td><a href="../<?= $prod['cvpath']; ?>" target="_blank"><?= $prod['needs']; ?></a></td>

                    </tr>
                    <?php } ?>
                </tbody>
            </table>
            <div class="clear"> </div>
           </div>
           </div>
<!--       Table Ends -->

       </div><!--end center-->  
 </section>  <!--end content-->   
<!-- Form -->
    <div id="deletedialog" title="Upload Images" style="display:none">
        <div id='preview'></div>
                <h1>Delete</h1> 
                                <div>
                                Do you really want To Delete this? This cannot be undone!
                                </div>
                </div>
<!-- Form -->
<div class="empty"></div>
</section>   <!--end main-content-->     


</body>
</html>

Now, the issue is, this code has been coded by previous developer and my client wishes me to handle the project but I am a newbie with PHP forms being integrated in SQL and the mail being sent to the client with details of customers

Futhermore, the clients wishes to integrate this contact form along with some property managements software which uses api and the property management company has given the following information along with code to integrate

Getting Started

  • Web service deployment

Web service name is PostEnquiry It is deployed on server 114.143.217.246:85 from where any application can consume the web service deployed on it.

  • Sample application

http:// 114.143.217.246:85/HighriseAPI/Enquiry_Service.asmx?op=Enquiry_Method

Picture Here

Implementing the web service

Add reference of web service reference in your application. Below is the sample code to consume web service, assuming validation is being done before calling save method of web service. (Please see comments for better understanding)

Dim id As Integer
\* Create Instance of a web service *\
Dim objPostEnquiry As New PostEnquiryToERP.PostEnquiryToERP

\* Create Instance of an Enquiry object *\
       Dim objEnquiry As New PostEnquiryToERP.Enquiry

\* Set properties of an Enquiry object *\
       objEnquiry.EnquiryName = txtName.Text.Trim
       objEnquiry.ContactNo = txtContact.Text.Trim
       objEnquiry.EmailId = txtEmail.Text.Trim
       objEnquiry.Address = txtAddress.Text.Trim 
       objEnquiry.City = txtCity.Text.Trim
       objEnquiry.Zip = txtZip.Text.Trim
       objEnquiry.State = txtState.Text.Trim
       objEnquiry.Country = txtCountry.Text.Trim
       objEnquiry.Remark = txtRemark.Text.Trim
       objEnquiry.EnquiryType = txtEnqType.Text.Trim
       objEnquiry.Project = txtProject.Text.Trim


\* Invoke Save method of web service and pass Enquiry object as an argument*\
       id = objPostEnquiry.InsertEnquiry(objEnquiry)

\* If id>0 then assume that record saved successfully *\

If id > 0 Then
        lblMessage.Text = "Record Saved Successfully"
       End If

On completion of code “objPostEnquiry.InsertEnquiry(objEnquiry)” new enquiry will generate in ERP and return the enquiry number in ERP, else you will get the exception as string.

I have tried all possibilities and searched entire google but found no solutions, please help me with the same

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值