-
Mar 16th, 2015, 02:08 PM
#1
Thread Starter
Hyperactive Member
ASPX files and PHP
Hello
I have a basic Web site project in VB.NET (Visual Studio 2013 Express for Web), and was wondering if it would be possible to use PHP as the code to process the Web site's email contact form. That is, PHP would be part of a myContactForm.aspx Web page and, if so, are Windows servers acceptable to PHP? Do Windows servers and PHP like one another?
For some reason I have in my mind the idea that ASP/ASP.NET = Windows servers, while PHP = Unix servers.
Thank you for clarifying.
Steve
-
Mar 17th, 2015, 03:44 AM
#2
Re: ASPX files and PHP
While ASP.Net was/is restricted to Windows Servers (the new version of ASP.Net ( .Net Core) will be cross platform) PHP can be used on Windows / Linux and Mac.
I would be interested to know how you are going to call PHP from a .Net application though? I have heard of it being done the other way round (using .Net libraries in PHP) but i understand its not the easiest thing in the world.
What i don't understand is why you would want to for a Contact form? its just as easy to write one in .Net as PHP
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 17th, 2015, 04:13 AM
#3
Thread Starter
Hyperactive Member
Re: ASPX files and PHP
Many thanks for your reply.
This suggests that it can be done - if I have understood things correctly:
http://code.tutsplus.com/articles/as...pers--net-8526
but I didn't really want to get in that deep.
To answer your question is that I already have the PhP code and form interface apart from the curiosity as to whether it was technically possible. As you point out, and as I have since come to understand it, Windows servers can process PhP code so that's one little problem sorted out.
I suppose I am not sure if you can use PhP in a Web page with an ASPX file extension, such as a Web contact form page, or whether you can have index.aspx, about.aspx, artgallery.aspx, contact.php, all in the one ASP.NET project.
Thank you for your reply.
-
Mar 17th, 2015, 03:12 PM
#4
Re: ASPX files and PHP
You can simply install the php extension for iis (http://php.iis.net/) and put your PHP file in your website
-
Mar 17th, 2015, 04:37 PM
#5
Thread Starter
Hyperactive Member
Re: ASPX files and PHP
Great! I'll download it now.
Can I ask, is the PhP code kept in its PhP file format as in contact.php or does it take on an aspx format as in contact.aspx?
Thanks again!
-
Mar 18th, 2015, 03:23 PM
#6
Re: ASPX files and PHP
The PHP file should have a PHP extension. The IIS manager needs to know how the handle a request, .aspx are handled by the asp.net engine, PHP file are handled by the PHP engine.
-
Mar 18th, 2015, 03:46 PM
#7
Thread Starter
Hyperactive Member
Re: ASPX files and PHP
Hello Lightening
Thanks again for your reply.
I have now installed PhP 5.3.28.
The download invited me to install 'VC11 x86 Non Thread Safe (2015-Feb-19 01:45:25)'. I haven't done so yet as I do not know what it will do or won't do, and would be grateful for any advice.
Earlier, I did as you suggested and saved the contact form as contact.php. In my other ASPX files, I have a link to contact.php in the menu, but when I clicked to visit that page, I got a 'Page not Available' message.
Maybe I haven't installed PhP 5.3.28 correctly, but I followed all the onscreen instructions.
Thanks again for your time.
Steve
-
Mar 18th, 2015, 07:29 PM
#8
Re: ASPX files and PHP
if your aspx files work like they should then what you need to do is, after intallsing PHP, from the IIS manager, you need to set it up so that the php extension gets run through the PHP filter. What instructions DID you follow?
-tg
-
Mar 18th, 2015, 08:03 PM
#9
Thread Starter
Hyperactive Member
Re: ASPX files and PHP
Hello tg
While downloading PhP, I got this:
From what you say, I should try to reinstall it. Would I just use that same link (http://php.iis.net/) in post #4?
-
Mar 18th, 2015, 08:19 PM
#10
Re: ASPX files and PHP
Honestly, I wouldn't know, I don't use PHP on IIS. I usually use Apache server, but then I don't run ASP.
If I had to guess, you need to look why that first component failed... My guess is that's the piece that integrates with IIS, allowing it to use PHP.
-tg
-
Mar 19th, 2015, 03:40 AM
#11
Re: ASPX files and PHP
I bet you spend more time trying to get both PHP and ASP.Net working together under IIS then if you just re-wrote you contact form in ASP.Net.
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 19th, 2015, 09:17 AM
#12
Thread Starter
Hyperactive Member
Re: ASPX files and PHP
I have done that now, NeedSomeAnswers, at least partly - just getting some errors in the aspx.vb file. Are you able to help out?
At the same time, I am curious as to whether they can work together.
-
Mar 19th, 2015, 09:23 AM
#13
Re: ASPX files and PHP
They probably can but IIS is a right pain in the rear to configure, and probably even more so to get it configured for both asp.net and php, hence my comment
I have done that now, NeedSomeAnswers, at least partly - just getting some errors in the aspx.vb file. Are you able to help out?
Of course post your code and i will try and help, as will others here!!
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 19th, 2015, 09:30 AM
#14
Re: ASPX files and PHP
Originally Posted by SteveHi
I have done that now, NeedSomeAnswers, at least partly - just getting some errors in the aspx.vb file. Are you able to help out?
At the same time, I am curious as to whether they can work together.
Originally Posted by NeedSomeAnswers
They probably can but IIS is a right pain in the rear to configure, and probably even more so to get it configured for both asp.net and php, hence my comment
Of course post your code and i will try and help, as will others here!!
In a different thread... in a different thread... it's a different issue from the one at hand.
-tg
-
Mar 19th, 2015, 09:56 AM
#15
Re: ASPX files and PHP
In a different thread... in a different thread... it's a different issue from the one at hand.
Yes TG is right post a new thread for this as it is a different question. Most of us look at the latest posts list so we will see it.
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 19th, 2015, 10:02 AM
#16
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|