/    Sign up×
Community /Pin to ProfileBookmark

Open/save .php file when clicked?

Just trying to make a user registration page. First of all, I am using WAMP. But I dont think thats the problem. Second, my localhost works, and I even made a stupid Hello World test php file and that worked. So here’s the problem.

After I enter information for the text fields in the registration form, i click submit and a box pops up asking me to open or save the PHP file. Why is it asking me this, why wouldnt it just run the dedicated PHP script?

Here’s the form in the HTML page…

<form action=”register.php” method=”post”>
<div align=”right”>Pick a Username:
<input type=”text” name=”username” size=”50″>
<br>
Pick a Password:
<input type=”password” name=”password” size=”50″>
<br>
Your Email:
<input type=”text” name=”email” size=”50″>
<br>
Age (#):
<input type=”text” name=”age” size=”50″>
<br>
Zipcode (5 digits):
<input type=”text” name=”zipcode” size=”50″>
<br>
Gender:
<select name=”sex” size=”1″>
<option>Male</option>
<option>Female</option>
</select>
<br><br>
</div><p>
<div align=”center”>Registering with us is completely free. With registering with us, you agree and abide by the Privacy Policy and
Rules outlined when using the features of this site such as postings on message boards. </div>
<p align=”center”>
<input name=”submit” type=”submit” value=”Sign Up”>
</form>

any ideas? i even made a sign in script (as if there really was a user that could log in) and that does the same thing.

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 26.2006 — Does your web host actually support PHP? (It sounds like it considers .php to be an unknown file type, so is just serving up the source code file rather than parsing/compiling it and outputting the result.)
Copy linkTweet thisAlerts:
@ecolodgeauthorAug 27.2006 — well im just testing it on my own computer right now. also using firefox as my browser.
Copy linkTweet thisAlerts:
@netbuddyAug 27.2006 — if your testing on your computer then that would be the expected result because your not viewing the file via a web browser using the http protocol.

I would suggest that you grab one of the many hundreds of webservers that are free and install php and go for the tripple and mySql also.

Then you simply view your web pages with a web browser on http://127.0.0.1 or http://localhost
Copy linkTweet thisAlerts:
@chesemonkylomaAug 28.2006 — He said he was using WAMP... that's the combination of windows, apache, mysql, and php. You have to use http://localhost, not file://C: in your browser, also make sure that WAMPServer is running.
Copy linkTweet thisAlerts:
@chesemonkylomaAug 28.2006 — You also need to make sure the files are in the localhost directory, which is most likely C:/wamp/www/
Copy linkTweet thisAlerts:
@ecolodgeauthorAug 28.2006 — thanks for the continuing help. normaly i would post these problems on WAMP board but there are like 4 people there.

Now, yes all the services are running. And yes all my files are being stored in c:/WAMP/www folder.

If I type http://localhost/whatever.php it will run that script. For instance, I made the infamous "Hello World" test and it worked. I think WAMP is running correctly.

right now, the html code points to the file "register.php"

I changed that to http://localhost/register.php and an error message comes up. I even doubled checked with IE to no avail. I know its going to be something stupid. I keep thinking since I'm testing it on my computer, that the html coding needs to be different since it's "localhost"? It's like I can type it into the address bar, but whenever HTML is introduced it doesnt know what to do.

I dont know, I really dont think this should be this difficult. I like the continuing support though, maybe we can fix this!
Copy linkTweet thisAlerts:
@ecolodgeauthorAug 28.2006 — HEY HEY! figured it out.

WAMP can either be offline or online. I switched it to online (didnt think I needed to do this since I thought I was working offline anyways).

It works now.... but the HTML coding needs to work like this...

http://localhost/register.php

won't work otherwise. Now, one more quick question. When I want to go "live" and transfer my files to the online server..... what changes do I need to make in my code so the online server will know what to do? Can I still use localhost? or is that only on my machine?

THANKS!
Copy linkTweet thisAlerts:
@netbuddyAug 28.2006 — You will need to use the IP address that is assigned to your computer by the ISP that you use to connect to the internet with.

If you use relative addressing, that is the '/register.php' portion of the address, the '/' indicating the root, the rest the path to the folder or file to serve.

If you still have server issues, you could look online for another server like I originally suggested, your not the first person I have heard of with WAMP issues, theirs far easier systems to implement that an Apache system which IME is always problematic and the number of servers that I come across with issues all tend to be Apache installs, I have yet to come across an other server other than Apache with serving issues.
×

Success!

Help @ecolodge spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...