Page 1 of 1
Converting asp to php successfully
Posted: Thu May 19, 2005 6:01 am
by Hammer136
Hi
I have a problem with trying to convert asp to php. Ive been working on it for ages but i have loads of syntax problems and other errors. I dont want to put the code up as its in multiple files and consists of thousands of lines. I am only 14 and hardly know asp. If anyone is willing to help me convert the files can you please reply and i will send you the files.
Thank you.
Hammer
Posted: Thu May 19, 2005 6:42 am
by John Cartwright
Yay google:
http://asp2php.mikekohn.net/download.php
OR
Post some code, and well do this the old fashion way

Posted: Thu May 19, 2005 6:47 am
by Hammer136
Ive done that and its done a reasonable job but i still get loads of errors, and i would post up the code but there are 40 files and it would take ages. Can i send you the files and you look at them. And if possible write down in a text document where i need to change things.
Thanks
Hammer
Posted: Thu May 19, 2005 6:50 am
by John Cartwright
There is no way anyone is going to correct all the parse errors on all 40 files.
Post 1-2 files on some form of hosting with the .phps extension so its nice and highlighted.
Posted: Thu May 19, 2005 6:55 am
by Hammer136
Um i would if i could get some posting. Thanx neway
Posted: Thu May 19, 2005 6:57 am
by Hammer136
Can you look at this then and tell me whats wrong with it:
Code: Select all
<?php
@ $Language=$VBScript ?>
option explicit;
function pgtitle {
return "Contact";
}
function pgheader {
return "Contact";
}
function mainbit {
echo 'Want to speak to Tom, suggest something, offer a service or something like that? Then email <a href="mailto:tom@plantarion.com">tom@plantarion.com</a><br><br>';
echo 'Want to point out a bug or suggest a fix for one? Then email <a href="mailto:bugs@plantarion.com">bugs@plantarion.com</a><br><br>';
echo 'Want to report a cheating or abuseful person? Then email <a href="mailto:abuse@plantarion.com">abuse@plantarion.com</a><br><br>';
echo 'Want to contribute code and stuff to Plantarion? Then email <a href="mailto:contribute@plantarion.com">contribute@plantarion.com</a><br><br>';
}
include "incngplayout.php"; ?>
Thanx
Posted: Thu May 19, 2005 7:08 am
by Weirdan
Remove the lines 2 through 5, all should be ok then.
Posted: Thu May 19, 2005 7:16 am
by Hammer136
Nope im now getting another code problem.
Parse error: syntax error, unexpected T_RETURN, expecting '&' or T_VARIABLE in C:\Documents and Settings\KCHardy\Local Settings\Temp\dzp3A.tmp on line 5
Thanks for all the help
Posted: Thu May 19, 2005 7:56 am
by Weirdan
ah... I see. PHP requires parenthesis after the function name:
Code: Select all
// valid
function something() {
// blah...
}
// invalid
function something {
// blah
}
Posted: Thu May 19, 2005 8:05 am
by Hammer136
Thanx-that and another tweak ogt the page up and working
Now onto another problem i cant seem to spot the error in this
Code: Select all
<HTML>
<HEAD>
<Title>Auth Error</title>
<style type="text/css">
<!--
.d { font-family: Verdana; font-size: xx-small; }
-->
</style>
</HEAD>
<BODY bgcolor="#006600" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff">
<br><p align=center><font class=d>
<?
echo "<b>Authorization Error</b><br><br>";
if (request("r") == "nc") {
echo "You are not authorized to view this page.<br>";
echo "Maybe your browser is soooo old it thinks a cookie is a tasty treat, in which case you should maybe update.<br>Maybe you havent got cookies enabled, in which case you cannot play Plantarion as we use cookies.<br>Maybe you didnt access any pages for a while and your cookie expired, in which case you should <a href=http://www.plantarion.com target=_top>log back in</a>.<br>Maybe your system time is set in the future, in which case you should set it right then try and <a href=http://www.plantarion.com target=_top>log back in</a>, you tart.<br>Maybe you just entered http://www.plantarion.com/autherror.asp?r=nc into your brower, wierdo.";
} else if request("r") = "nu" or request("r") = "wp" then;
echo "Wrong username or password.";
}
?>
</BODY>
</HTML>
Any help appreciated
Posted: Thu May 19, 2005 8:26 am
by Weirdan
Code: Select all
} elseif($_REQUESTї'r'] == 'nu' || $_REQUESTї'r'] == 'wp') {
echo "e;Wrong username or password."e;;
}