Results 1 to 16 of 16

Thread: ASPX files and PHP

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    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

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    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



  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    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.

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    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
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    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!

  6. #6
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    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.
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    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

  8. #8
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: ASPX files and PHP

    Hello tg

    While downloading PhP, I got this:

    Name:  PhP_manager.jpg
Views: 117
Size:  25.8 KB

    From what you say, I should try to reinstall it. Would I just use that same link (http://php.iis.net/) in post #4?

  10. #10
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  11. #11
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    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



  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    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.

  13. #13
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    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



  14. #14
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    Re: ASPX files and PHP

    Quote Originally Posted by SteveHi View Post
    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.
    Quote Originally Posted by NeedSomeAnswers View Post
    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  15. #15
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    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



  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: ASPX files and PHP

    OK, thanks, I will do!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width