HELP! Convert to Classic ASP?

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
digoxy
Forum Newbie
Posts: 3
Joined: Mon Dec 06, 2010 2:55 pm

HELP! Convert to Classic ASP?

Post by digoxy »

Can anyone please convert this to classic ASP please? I would surely appreciate it. as it is, I know nothing about PHP, this, I wish I could do as easily as some of you guru's. :)

Code: Select all

<?php
$GAME_VERSION = 1; //Please use int only: 1,2,3,4)
$platform = $_POST['platform'];
$clientsversion = $_POST['clientsversion'];
if($platform=='WindowsEditor' || $platform=='WindowsPlayer'){
$downlink= 'http://www.MYWEBSITE.com/LatestWindowsUpdate.zip';
}else if($platform='OSXEditor' || $platform='OSXPlayer' ){
$downlink= 'http://www.MYWEBSITE.com/LatestMacUpdate.zip';
}else{
echo 'Invalidplatform!';
exit();
}/
/Format:VERSION#FORCEUPDATE#DOWNLOADLINK#DISABLEDLI
//Version: version info // Forceupdate: Leave this to 0 (ALWAYS update)
//DownloadLink; the link to the .zip for this platform
//DisabledLink: Used when i.e. the patcher would need to be updated.
// Asks the user to visit this link with explanation. Leave this blank otherwise!
echo "$GAME_VERSION#0#$downlink##";
?>



User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: HELP! Convert to Classic ASP?

Post by AbraCadaver »

I don't have any way to test it, and it's been a long time for me with vb, but here's my stab at it:

Code: Select all

<%
GAME_VERSION = 1 ' Please use int only: 1,2,3,4
platform = Request.Form("platform")
clientsversion = Request.Form("clientsversion")

if platform = "WindowsEditor" Or platform = "WindowsPlayer" then
  downlink = "http://www.MYWEBSITE.com/LatestWindowsUpdate.zip"
else if platform = "OSXEditor" or platform = "OSXPlayer" then
  downlink = "http://www.MYWEBSITE.com/LatestMacUpdate.zip"
else
  Response.Write("Invalidplatform!")
  Response.End
end if
' Format:VERSION#FORCEUPDATE#DOWNLOADLINK#DISABLEDLI
' Version: version info
' Forceupdate: Leave this to 0 (ALWAYS update)
' DownloadLink; the link to the .zip for this platform
' DisabledLink: Used when i.e. the patcher would need to be updated.
' Asks the user to visit this link with explanation. Leave this blank otherwise!
Response.Write(GAME_VERSION & "#0#" & downlink & "##")
%>
This is sloppy but it is just a translation of the sloppy PHP :-) Also notice that clientversion is never used.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
digoxy
Forum Newbie
Posts: 3
Joined: Mon Dec 06, 2010 2:55 pm

Re: HELP! Convert to Classic ASP?

Post by digoxy »

Thank you for the quick reply, I will test this as soon as I get a few minutes! will check back as soon as I can..
digoxy
Forum Newbie
Posts: 3
Joined: Mon Dec 06, 2010 2:55 pm

Re: HELP! Convert to Classic ASP?

Post by digoxy »

It worked fine! Thank you. I only had to add one end if!

The clientversion is future, its a work in progress from what I understand. But, I should be able to debug it now if I get more php, I can refer back to this to see what you did! :)

Very much appreciated.
Post Reply