Link to home
Start Free TrialLog in
Avatar of Chris Andrews
Chris AndrewsFlag for United States of America

asked on

Need php snippet converted to asp.net

I deliver content to other websites through a small php snippet.  I have other webmasters put this on their site:

<?
//code for the Clock
$rqst=$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"];
$url="http://www.mysite.com/data/wwc.php?rqst=".$rqst;
@readfile($url);
?>

I have request from users that would like to have that in asp.net #C code.  Can you convert it?

Also (I don't know anything about asp.net other than it's server side for windows), does asp.net #C work on any asp.net host, or does the #C mean it only works on asp.net #C hosts? Probably a stupid question, but I just don't know these things...

Thanks for any help,  Chris
ASKER CERTIFIED SOLUTION
Avatar of BrianMM
BrianMM
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
answer to above is generally yes :)
Hi Chris
I don't do PHP and you don't do asp.net.
However this is only a few lines of code I'm sure we can work this out.
Can you convert your code to an algorithm in plain English and then I'll write it in asp.net for you.
 
Avatar of Chris Andrews

ASKER

Hi,

Thank you all very much, sorry I didn't get back to this thread yesterday, been dealing with a sick 6 year old.

BrianMM, thank you, what I need to do, if possible (I don't know what's possible in asp.net), is have it shorter, so it's just one thing someone can easily take and cut and paste into their html (I'm trying to keep it insanely simple for them).  If having a function like that is what needs to be done though, I'll manage.

daveamour, basically all I need to do is get the url of the page the script is on (this will be $rqst).

Then fetch and display the contents of the file:  http://www.mysite.com/data/wwc.php?rqst=www.theURLdisplayingTheContent.com

The contents of the file will be a table with the tool or data in it.

For example, the file would be something like this (we can use this as a test):

http://www.sure-start.com/test.php?rqst=requestingURL.com

and someone should be able to fetch this file with asp.net and display it on their page.




I'm afraid thats as short as it will be in .NET, they need to include that function somewhere and then they can call it where needed. The call itself is a one-liner... but unfortinatley the code required to replicate what PHP does is as above!
BrianMM,

Thank you, sorry it took me so long to get back and try this out and assign points, been sick as a dog with the flu.

Thank you for the help!  

Chris
were you going oink? :)
Just about!