I obtained a PHP chat app written in javasript. I want to incorporate it in an ASP.net site I am working on. I dont even know where to begin. Can someone just outline the steps to take from here. I am familiar with asp.net but have never integrated it with PHP before.
The asp.net site has a master page with a contentholder that runs all pages. There is a main folder then four subfolders App_Code, App_Data, bin, and images.
PHP and ASP
I obtained a PHP chat app written in javasript.
Sorry, but that makes no sense. php is php, javascript is javascript.
Well all the files are PHP files but the script language="JavaScript"
code warrior:
Wouldn't it be easier to just find a chat app that is developed in ASP.Net?
I can't give you a URL, but I have seen lots of them as I have searched for various other ASP.Net apps.
I would try a Google search: "ASP.Net Chat"
I doubt php script will integrate into a single NET page, or vice-versa, but the same server can certainly host both php and asp and NET in the same website. There are excellent commercial hosts that can provide combined hosting like this.
Well all the files are PHP files but the script language="JavaScript"
Sorry, but that still doesn't make allot of sense. Php isn't like asp where it can be written in several languages. Php is written in php, thats it.
More than likely the chat you have found uses both php and javascript, ,aybe even in an Ajax type combination. Im not sure how exactly .NET works, but php needs to be run inside of files with the .php extension. You can however change your server to interpret any extension as php, but changing this to let .aspx files be run as php would surely break the rest of your application.
Basicaly, I think your going to need to make this a stand alone php page, or, do as other have suggested and try and find a chat written in .NET.
Maybe there is a .net chat app out there, but definitely not one you dont have to pay for. Anyway I wasnt sure at first until I picked up a PHP for summies book. Its a PHP site allright just has some javacript in there as well. The problem is I intalled PHP on my computer (automatic). changed cgi property to = 0 in the php.ini in /windows as instructed to do in the book. I set up a test page with the code below but the problem is I see the "html line" and I see the "php line" but I dont see the table. I have no clue what I did wrong.
What code below?
perhasp the file only contains javascript and the file is php.
sorry, here is the code
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line</p>
<?php echo “<p>This is a PHP line</p>”; phpinfo(); ?>
</body>
</html>
And what exactly do you see when viewd in a broswer? Post the view source if possible.
<code>
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line</p>
<?php echo “<p>This is a PHP line</p>”; phpinfo(); ?>
</body>
</html>
</code>
This is the output in the browser
This is an HTML line
This is a PHP line
”; phpinfo(); ?>
This is the source code
<html><head>
<title>PHP Test</title></head>
<body>
<p>This is an HTML line</p>
This is a PHP line<p></p>”; phpinfo(); ?>
</body></html>
that a bit odd. Try just this in the file...
<?php
phpinfo();
?>
I get nothing on the page.
The code gives me nothing on the page
<?php
phpinfo();
?>
Does that mean it is not installed properly?
Forgive me if this is too obvious, but does the page filename end in .php?
Yep. If PHP were installed, you would NEVER see any '<?PHP' source when vieweing it in a browser.
Did you make sure that the page you were testing this on had a .php extension?
EDIT: Blasted second page! I always forget to see if there's a second page! Ignore the duplication of Doug's post above :x
I know I can't integrate PHP and ASP in one site but can I have both ASP.NET and PHP installed on the same computer? They would both be running on the same localhost server. Is there a problem with that because I dont understand why I am having such a hard time installing PHP and getting it to run in my computer.
can I have both ASP.NET and PHP installed on the same computer?
Yes you should be able to have them running on the same server, side by side. I dont know much at all about IIS or windows as I use apache / linux, otherwise I'd like to think I could be of more assistance.
What steps did you take to install php, and what steps did you take to let IIS recognise and process the .php extension? There is sure to be someone here who can help.
For IIS, I've always installed the php4isapi.dll SAPI module and then registered the .php extension to be handled by that.