Jump to content

Executing php files with WampServer-Urgent


Recommended Posts

Im a novice and I want to develop a small Web based database system and so I have installed Wampserver. I have written my html forms and php files using notepad. The html form is suppossed to load a php file but apperantly instead of executing the php file, the php file is being downloaded as a document as opposed to running it. Here is my code.

 

 

CreateAccount.php

<?Php

include('ServerAndDbConnect.php');

$First_Name = $_POST["firstName"];

$Last_Name = $_POST["lastName"];

etc

 

ServerAndDbConnect.php

<?php

$hostName = "localhost"; // Host name

$dbName = "StockControl"; // Database name

$userName = "root"; // Mysql username.

$password = ""; // Mysql password

mysql_connect("$hostName","$userName","$password") or die ("Can't log in

either username or password is incorrect");

mysql_select_db("$dbName") or die ("Failed to open database or database doesn't

exist");

?>

 

When I hit the submit button on my form it is supposed to run "CreateAccount.php" but instead opens it in text form. Is there special folder am supposed to place the files or what. Please take me thru step by step

 

Thankyou

HMRC

 

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.