mysql - PHP script not executing upon HTML Form 'Submission' -
i building website form in html want gather information users, , store in mysql. however, when submit form after entering information, php script not executed. displays php script in raw form. in browser, downloads php file.
at first, lead believe issue mysql, php, apache configuration, after following this step step, still cannot execute php script.
my form's header looks so:
<form id="form-settings" method="post" action="file.php">
file.php being script want execute upon submission.
here php script:
<?php error_reporting(e_all); $link = mysql_connect("localhost","username","password"); if (!$link) { die('not connected : ' . mysql_error()); } mysql_select_db("mysql", $link) or die("unable select database"); $var1=$_post['var1']; $var2=$_post['var2']; $var3=$_post['var3']; $var4=$_post['var4']; $var5=$_post['var5']; $query = "insert table values ('','$var1','$var2','$var3','$var4','$var5')"; mysql_query($query); mysql_close($link); ?>
i can execute php files terminal fine. can query mysql table , enter info it, when try run via html form, doesn't work. vars values pulled form html form. advice appreciated. obviously, php not being recognized, issue arise from?
(i post comment, can't because i've got little karma...)
have @ logfiles, error log files. in /var/log/apache2 or something. see if there wrong?
is phpinfo()-script in same directory other script? accessing script same hostname? (127.0.0.1 vs. localhost, example?)
Comments
Post a Comment