Can't read php on server -


i trying read php file on server, in android.

sorry shot english because foreigner..

   <html>      <head>       <title>aaa</title>     <meta http-equiv="content-type" content="text" charset="utf-8">     </head>     <body>      <?php         $link_id = mysql_connect('localhost','root','');         mysql_select_db('aaaa',$link_id);          $res = mysql_query("insert ppt_member value ('$id','$password','$name','$email','$address','$sex','$age')",$link_id);      ?> 

this php code.

when run application,

07-22 01:41:32.505: w/response(1195): <html> 07-22 01:41:32.505: w/response(1195):  <head> 07-22 01:41:32.505: w/response(1195):   <title>aaa</title> 07-22 01:41:32.505: w/response(1195): <meta http-equiv="content-type" content="text" charset="utf-8"> 07-22 01:41:32.505: w/response(1195): </head> 07-22 01:41:32.505: w/response(1195): <body> 07-22 01:41:32.505: w/response(1195):  

can read until html code, can't read php code.

what should do?

on server runs php, *.php files executed server when requested. php executed on server before http response sent client. means php code never visible client. you'll have use ftp download files in order see code.

you can make results visible echoing them or printing them such in:

<?php         $link_id = mysql_connect('localhost','root','');         mysql_select_db('aaaa',$link_id);          $res = mysql_query("insert ppt_member value ('$id','$password','$name','$email','$address','$sex','$age')",$link_id);          echo ($res ? 'insert success' : 'insert failed'); // here     ?> 

which print 'insert success' if query successful , 'insert failed' otherwise..


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -