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

 

Link to comment
Share on other sites

Ok, I have put my files in the following folder

C:\wamp\www\StockControl

 

Im using internet explorer but I guess now I don't know how to point my browser to this folder because it's still opening them as text documents

 

Thanks

 

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.