| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Mar 2005
Posts: 36
![]() | Embed PHP in an ASP page...possible? Ok, here's the deal. At work I was asked to take ownership of the updates to a website written in ASP.net with an MSAccess (puke) backend. I, however, don't know ASP.net. Simple updates have been easy enough, but have recently been asked by the client to add a form that will need to write to the database and then return an amount. ????: NamePros.com http://www.namepros.com/programming/167145-embed-php-in-asp-page-possible.html I know PHP pretty well, and would be able to complete this task much quicker if I can use PHP. Is it possible for me to just embed the PHP code for this within an ASP page (that hence would not have a .php extension)? I would just try it out myself but this is a home project and I am currently at work and need to give my boss an answer by the end of the day. I have been unable to find anything about embedding php code in an asp page on google. Thanks in advance. |
| |
| | #2 (permalink) |
| Pro Coder & Designer Join Date: Apr 2005 Location: Netherlands
Posts: 967
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ASP and PHP dont work together well. I dont think its possible. So you need to rewrite the database and pages in to php or learn ASP for dummies real real fast!
__________________ aween web development |
| |
| | #3 (permalink) |
| Senior Member Join Date: Mar 2004
Posts: 1,402
![]() ![]() ![]() | I heard rumours once that you could use the language= setting in a <script> tag to get PHP to execute in an ASP page like you can with PerlScript. But I have never seen it in action and it does not work on any of my windows boxes that have PHP installed. If your familiar with SQL you can learn everything you need to about using an Access database through ADO in 30 minutes. That's probably the best way to go, If you're really dead set on using PHP you can always do the database pages in PHP and stick them in a frame/layer/iframe/whatever on your ASP page. |
| |
| | #4 (permalink) |
| NamePros Member Join Date: Feb 2006 Location: Online
Posts: 118
![]() ![]() | Blahblah and such. ASP.net is nothing like the classic scripting language ASP. Whilst ASP and PHP are much alike ASP.NET (or VB.NET if you like) and PHP is like apples and oranges. Parsing of PHP (and ASP for that matter) is based on extensions (php or asp) regged within the webservers' settings (apache or IIS). So writing code in VB.NET and putting <?php?> tags in it is just erhm... Wishful thinking, to say the least ![]() I'm sorry but you've got to make up your mind about what language you're going to develop in |
| |
| | #5 (permalink) | ||||
| Senior Member Join Date: Mar 2004
Posts: 1,402
![]() ![]() ![]() |
| ||||
| |
| | #6 (permalink) |
| NamePros Regular Join Date: Jul 2005
Posts: 595
![]() ![]() | Do this... it should work.... make the php page you want to display in the asp page, use the code below to include into the file into the asp page. PHP Code: |
| |
| | #7 (permalink) | ||||
| NamePros Regular Join Date: Jul 2005 Location: Vancouver
Posts: 533
![]() ![]() ![]() |
Didnt he say he didnt want to have .php file? | ||||
| |
| | #8 (permalink) | ||||
| Senior Member Join Date: Mar 2004
Posts: 1,402
![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=167145 One thing he could do is create an ASP wrapper for a PHP page using XMLHTTP or something of the sort. The user would access an ASP page. The ASP page would POST/GET the relevant data to the PHP page and output the results to the user. A lot more work than a 30 minute crash course in ASP, but it would allow him to code in PHP and give the appearance of it being ASP. | ||||
| |
| | THREAD STARTER #9 (permalink) |
| NamePros Member Join Date: Mar 2005
Posts: 36
![]() | Yeah I'll likely just end up using ASP if embedding the PHP is going to be a big deal, was just looking for that as a time-saver over learning ASP. Here's a question though, can I have multiple pages on the same website connect to the same database in different programming languages? For instance, if most of the website is written in ASP and pulls info from the database, can I make a .php page on the same website that writes to and reads from that same database?
__________________ Looking forward to the Gears of War 3 Beta! |
| |
| | #10 (permalink) |
| NamePros Regular Join Date: Aug 2005
Posts: 315
![]() | I just added a Iframe when I needed to use PHP in an asp page. It worked but it still requires a php extention page. http://seohelp.info/webspeedtest.asp No way otherwize, trust me I tried.
__________________ |
| |
| | #11 (permalink) | ||||
| Senior Member Join Date: Mar 2004
Posts: 1,402
![]() ![]() ![]() |
| ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP or ASP | raju79 | Web Design Reviews | 8 | 12-14-2005 08:38 AM |
| NEW : Google AdSense(TM) Online Standard Terms and Conditions | Mark | Google Adsense | 3 | 11-04-2005 01:37 PM |
| Good Article: An SEO Checklist | Ferman | Search Engines | 2 | 05-28-2005 11:51 AM |