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
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?

 

Link to comment
Share on other sites

Alright...after adding the phpinfo() to the file...and accessing with Firefox, it now works on both Firefox and IE...

 

I guess it is good that I don't have the problem anymore, but I wish I knew what the problem was...

 

Thanks for your time.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.