Converting asp to php successfully

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Converting asp to php successfully

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Yay google: http://asp2php.mikekohn.net/download.php

OR

Post some code, and well do this the old fashion way ;)
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Post by Hammer136 »

Um i would if i could get some posting. Thanx neway
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Remove the lines 2 through 5, all should be ok then.
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

ah... I see. PHP requires parenthesis after the function name:

Code: Select all

// valid
function something() {
  // blah...
}

// invalid
function something {
  // blah
}
Hammer136
Forum Commoner
Posts: 29
Joined: Sat Mar 19, 2005 12:18 pm

Post 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
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Code: Select all

} elseif($_REQUEST&#1111;'r'] == 'nu' || $_REQUEST&#1111;'r'] == 'wp') {
    echo &quote;Wrong username or password.&quote;;
}
Post Reply