weixin_33716557 2014-12-03 15:44 采纳率: 0%
浏览 64

AJAX调用远程文件

this is my poll code i'm getting data in Mysql

<form role="form" action="graduating_students_preview.php" method="post">
  <h3 class="style"> Student Performa</h3>



      <p>Department:</p>

        <select name="depart" required class="depart form-control btn-primary" >     
           <option value="">Department </option>
            <option value="computer science">Computer Science</option>
           <option value="zoology">Zoology</option>

  </select>

 <p>Degree</p>

  <select name="degree" class="degree form-control btn-primary" required > 
    <option value=""> Degree </option>
     <option value="computer science">Computer Science</option>
      <option value="chemistry">Chemistry</option>
       <option value="BBA">BBA</option>                          
  </select>


  <p>Semester</p>
 <select class="form-control btn-primary" name="semester" required>
  <option value="">semester</option>
       <option value="1st">FIRST (01)</option>
       <option value="2nd">SECOND (02)</option>
      <option value="3rd">THIRD (03)</option>
         <option value="4th">FOURTH (04)</option>
         <option value="05">FIFTH (05)</option>
        <option value="06">SIX (06)</option>
      <option value="07">SEVEN(07)</option>
       <option value="08">EIGHT (08)</option>
  </select></td>


       <p>Study Year</p>
  <select class="form-control btn-primary" name="study_year" required>
  <option value="" style="font-size:8px;">Select_year </option>
  <option value="2014" label="2014">2014</option>
  <option value="2013" label="2013">2013</option>
  <option value="2012" label="2012">2012</option>
  <option value="2011" label="2011">2011</option>
  <option value="2010" label="2010">2010</option>
  </select>


  <p>Faculty</p>

      <select name="faculty" class="faculty form-control btn-primary" required>
         <option value="">Faculty</option>
         <option value="science">Science</option>
         <option value="Arts geg">Arts</option>
         </select><br/>


         <div class="container">

      <p style="font-weight:bold">1. The work in the Program is too Heavy and induces a lot of 
     pressure</p>
        <div class="radio">
          <label><input type= "radio"  name = "q1" value="very satisfied">very satisfied</label>
        </div>
         <div class="radio">
          <label><input type= "radio"  name= "q1" value="satisfied">satisfied</label>
        </div>
         <div class="radio">
          <label><input type= "radio"  name="q1" value="uncertain">uncertain</label>
        </div>

and this is my PHP code

$db_name="performa";  // your database name  
$con=mysql_connect("$host", "$username", "$password")or die("cannot connect"); //mysql connection  
mysql_select_db("$db_name")or die("can not select DB"); //select your database 
error_reporting(E_ALL ^ E_NOTICE); 
$depart = $_POST['depart'];  
$degree = $_POST['degree'];  
$semester = $_POST['semester']; 
$study_year = $_POST['study_year'];
$faculty = $_POST['faculty'];
$query = "INSERT INTO performa1 (depart,degree,semester,study_year,faculty) VALUES ('$depart', '$degree', '$semester', '$study_year', '$faculty')";  
mysql_query($query) or die('Query "' . $query . '" failed: ' . mysql_error());  
// name, email and address are fields of your fields; test your table. $name, $email and $address are values collected from the form  
?>  

this is working fine in website but i want to use it in intel xdk and intel xdk dont support PHP/Mysql but we can do it with AJAX with JQUERY call PHP file i'm trying to do it but i dont know how to do it correctly so can anyone tell me where to place PHP file and how to do it with AJAX or different procedure i just want to get the data into database
Thanks

  • 写回答

2条回答 默认 最新

  • weixin_33724046 2014-12-04 07:15
    关注

    You can't run PHP or MySQL on most phones or tablets, so it doesn't make sense for a development kit targeting them to "support" them.

    Write your server side code as a separate project. Then put the URL to an instance of that in your mobile app.

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程