Jump to content

IE trying to download .php file


ShadwSrch

Recommended Posts

I am new to .php...

 

I have a form that I am using (really just experimenting with)...

<form method="post" action="updatedatabase.php" />
...some text boxes 
<input type="sumit" value="Submit" />

 

The updatedatabase.php file is layed out like this:

<?php
some code
?>

 

I don't have any other elements in it.

 

When I click the submit button, IE tries to download updatedatabase.php.

 

I copied the code from a tutorial somewhere, but I can't seem to remember where I got it...I can post the code if needed, but I didn't think it was relevant to the behavior...

 

Any Ideas why this is happening?

Link to comment
https://forums.phpfreaks.com/topic/154569-ie-trying-to-download-php-file/
Share on other sites

turns out the code is

<?php phpinfo(); ?>

...and not "php_info"

 

Mine returns the following:

PHP Version 5.2.6-1+lenny2

 

followed by the rest...

 

In case it helps, here are the 2 files:

teamentry.php:

<html>

<head>
<title>Update Database</title>
</head>

<body>
  <form method="post" action="updateteam.php">
        <label for="txtName">Name:</label>
        <input type="text" size="25" name="Name" id="txtName"/>
        <br />
        <label for="txtGrad">GradYear:</label>
        <input type="text" size="4" name="GradYear" id="txtGrad"/>
        <label for="txtTeam">Team:</label>
        <input type="text" size="4" name="Team" id="txtTeam"/>
        <br />
        <input type="submit" value="Add Record"/>
  </form>
<?php phpinfo(); ?>
</body>

</html>

 

updateteam.php:

<?php
$Name = $_POST['Name'];
$GradYear = $_POST['GradYear'];
$Team = $_POST['Team'];

mysql_connect("localhost","php","phpMySQ1") or die ('Error: ' . mysql_error());
mysql_select_db ("php_test");

$query="INSERT INTO teaminfo (id, name, grad, team) VALUES ('NULL','".$Name."', '".$GradYear."', '".$Team."')";

mysql_query($query) or die ('Error updating database');

echo "Database Updated With: " .$Name. " ," . $GradYear;

?>

 

any other ideas?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.