Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP from ASP convertion

Status
Not open for further replies.

josefo123

IS-IT--Management
Sep 30, 2005
10
0
0
AR
Hi!
I need to migrate a small website page from ASP to PHP.
THe problem I have is that I dont know anything of PHP.
I downloaded ASP2PHP tool in order to convert the website page. It will convert it but it wont show a thing when I execute it.
I use mysql.
The original page looks like this:

What am I doing wrong?

Here is the code:
Code:
<? // asp2php (vbscript) converted
?>

<? 
//'sqlstm="SELECT * FROM efemerides where mes="&varmonth&" and dia=" &varday''&" and anofecha="&varYear
//'set efem = Server.CreateObject("ADODB.Recordset")
//'efem.ActiveConnection = MM_frasedeldia_STRING
//'efem.Source = sqlstm
//'efem.CursorType = 0
//'efem.CursorLocation = 2
//'efem.LockType = 3
//'efem.Open()
//'efem_numRows = 0
?>
<? 
$varDate=time()();
$varDay=$DatePart["d"][$varDate];
$varMonth=$DatePart["m"][$varDate];
$varYear=$DatePart["yyyy"][$varDate];

$Repeat1__numRows=-1;
$Repeat1__index=0;
$rsRespuestas_numRows=$rsRespuestas_numRows+$Repeat1__numRows;
?>

<? 
$varDate=time();
$varDay=$DatePart["d"][$varDate];
$varMonth=$DatePart["m"][$varDate];
$varYear=$DatePart["yyyy"][$varDate];
$MM_efemeridesyoroscopo_STRING="DRIVER={MySQL ODBC 3.51 Driver};SERVER=[URL unfurl="true"]www.horoscopodeldia.com.ar;DATABASE=xxxxx;USER=xxxxx;PASSWORD=xxxxxx;OPTION=3;";[/URL]
$sqlstm="SELECT * FROM horoscopo where dia=".$varDay." and mes=".$varMonth." and ano=".$varYear'."'";
// $horoscopo is of type "ADODB.Recordset"

echo $MM_efemeridesyoroscopo_STRING;
echo $sqlstm;
echo 0;
echo 2;
echo 3;
$rs=mysql_query();
$horoscopo_numRows=0;
?>
<? 
$HLooper1__numRows=12;
$HLooper1__index=0;
$horoscopo_numRows=$horoscopo_numRows+$HLooper1__numRows;
?>
<? 
$Repeat2__numRows=4;
$Repeat2__index=0;
$mensajes_numRows=$mensajes_numRows+$Repeat2_numRows;
?>
<? 

?>


<html>
<head>
<title>Consulta tu horoscopo todos los dias - <? 
echo time(); ?></title>
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="distribution" CONTENT="global">
<META NAME="resource-type" CONTENT="Document">
<META HTTP-EQUIV="Pragma" CONTENT="cache">
<META NAME="Revisit" CONTENT="3 days">
<meta name="language" content="es,sp,spanish,español">
<meta name="robots" content="index,follow">
<META NAME="DESCRIPTION" CONTENT="Comunidad Astrológica orientada a la reunion de astrologos, pone un punto de encuentro para todos los fanaticos y entusiastas de esta ciencia junto a la del tarot.">
<META NAME="KEYWORDS" CONTENT="astrologia, astros, planetas, mercurio, venus, tierra, marte, jupiter, saturno, urano, neptuno, pluton, cartas natales, carteas astrales, astral, carta, revolucion solar, anual, sexo, compatibilidad de signos, signos y el sexo, horoscopos sexuales, foros">
<META NAME="rating" CONTENT="General">
<META NAME="distribution" CONTENT="Global">
<META NAME="expires" CONTENT="never">
<META NAME="author" CONTENT="GrupoFN Soluciones Informaticas">
<META NAME="publisher" CONTENT="[URL unfurl="true"]www.astrodestino.com.ar">[/URL]
<style type="text/css">
<!--

.unnamed1 {  font-size: xx-small; background-color: #FFFFFF}

-->
</style>
<script language="JavaScript">
<!--



<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
//-->
</script>
<link href="sinsubrayar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="todoblanco.css" type="text/css">
<STYLE TYPE="text/css">
H1 {font-family: Verdana,Tahoma,Arial,Helvetica,Times New Roman; font-size: 12pt; color: black}
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<div align="center">
  <div align="center"><b><font size="4"><h1>AstroDestino - La Comunidad Astrol&oacute;gica</h1></font></b><br>
    Hor&oacute;scopos para Hoy<br>
    <div align='center'><script type="text/javascript"><!--
google_ad_client = "pub-0275194294622220";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="";
google_page_url = document.location;
//--></script></div>
<script type="text/javascript"

  src="[URL unfurl="true"]http://pagead2.googlesyndication.com/pagead/show_ads.js">[/URL]
</script>
    <b></b> 
    <? if (!($horoscopo==0) || !($horoscopo_BOF==1))
{
?>
    <table cellpadding="1" cellspacing="1">
      <? 
  $startrw=0;
  $endrw=$HLooper1__index;
  $numberColumns=2;
  $numrows=6;
  while((($numrows!=0) && (!($horoscopo==0))))
  {

    $startrw=$endrw+1;
    $endrw=$endrw+$numberColumns;
?>
      <tr align="center" valign="top"> 
        <? 
    while((($startrw<=$endrw) && (!($horoscopo==0))))
    {

      $txt=.$Item["texto"].$Value;
?>
        <td> 
          <table width="285" border="1" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0">
            <tr> 
              <td bgcolor="#E1E8FF" bordercolor="#3399FF"><font size="2"><b><font face="Arial, Helvetica, sans-serif" size="1"><?       echo (.$Item["signo"].$Value); ?> (<?       echo $varday; ?>/<?       echo $varmonth; ?>/<?       echo $varyear; ?>)</font></b></font></td>
            </tr>
            <tr> 
              <td bordercolor="#999999"><font size="2"><img src="../graficos/horoscopos/<?       echo (.$Item["signo"].$Value); ?>.gif" width="30" height="30" align="left" alt="<?       echo $txt; ?>"><font size="1" face="Arial, Helvetica, sans-serif"><?       echo $txt; ?></font></font></td>
            </tr>
          
          </table>
        </td>
        <? 
      $startrw=$startrw+1;
      $horoscopo=mysql_fetch_array($horoscopo_query);
      $horoscopo_BOF=0;

    } 
?>
      </tr>
      <? 
    $numrows=$numrows-1;
  } 
?>
    </table>
 
Is this the first PHP script you've ever run on this system?[ul][li]If not, would I be correct to assume that other PHP scripts ran okay?[/li][li]If so, what happens when you run a script that consists entirely of:

<?php
phpinfo();
?>

?
[/li][/ul]

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
You server Error's are probably turned off that is whay you get nothing. I copied your page and ran it, and got several errors.

PHP ERROR said:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Documents and Settings\thundercracker\public_html\scripttesting\algo34.php on line 42

etc... I'm trying to fix them. but every time I fix one it pops another one up.

By the way I see alot of spanish in there. Hablas Español??


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Basically it has quite a lot of sysntax errors, probably poor translation on the part of the application.

I've managed to fix most of the errors but now since I don{t have your data base or your seup, it pops up with a connection problem. So you will have to test it and see if it works. here is the repaired code.

Code:
<? // asp2php (vbscript) converted
?>

<?
//'sqlstm="SELECT * FROM efemerides where mes="&varmonth&" and dia=" &varday''&" and anofecha="&varYear
//'set efem = Server.CreateObject("ADODB.Recordset")
//'efem.ActiveConnection = MM_frasedeldia_STRING
//'efem.Source = sqlstm
//'efem.CursorType = 0
//'efem.CursorLocation = 2
//'efem.LockType = 3
//'efem.Open()
//'efem_numRows = 0
?>
<?
$varDate=time();
$varDay=$DatePart["d"][$varDate];
$varMonth=$DatePart["m"][$varDate];
$varYear=$DatePart["yyyy"][$varDate];

$Repeat1__numRows=-1;
$Repeat1__index=0;
$rsRespuestas_numRows=$rsRespuestas_numRows+$Repeat1__numRows;
?>

<?
$varDate=time();
$varDay=$DatePart["d"][$varDate];
$varMonth=$DatePart["m"][$varDate];
$varYear=$DatePart["yyyy"][$varDate];
$MM_efemeridesyoroscopo_STRING="DRIVER={MySQL ODBC 3.51 Driver};SERVER=[URL unfurl="true"]www.horoscopodeldia.com.ar;DATABASE=xxxxx;USER=xxxxx;PASSWORD=xxxxxx;OPTION=3;";[/URL]
$sqlstm="SELECT * FROM horoscopo where dia=".$varDay." and mes=".$varMonth." and ano=".$varYear;
// $horoscopo is of type "ADODB.Recordset"

echo $MM_efemeridesyoroscopo_STRING;
echo $sqlstm;
echo 0;
echo 2;
echo 3;
$rs=mysql_query($sqlstm);
$horoscopo_numRows=0;
?>
<?
$HLooper1__numRows=12;
$HLooper1__index=0;
$horoscopo_numRows=$horoscopo_numRows+$HLooper1__numRows;
?>
<?
$Repeat2__numRows=4;
$Repeat2__index=0;
$mensajes_numRows=$mensajes_numRows+$Repeat2_numRows;
?>
<?

?>


<html>
<head>
<title>Consulta tu horoscopo todos los dias - <?
echo time(); ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="distribution" CONTENT="global">
<META NAME="resource-type" CONTENT="Document">
<META HTTP-EQUIV="Pragma" CONTENT="cache">
<META NAME="Revisit" CONTENT="3 days">
<meta name="language" content="es,sp,spanish,español">
<meta name="robots" content="index,follow">
<META NAME="DESCRIPTION" CONTENT="Comunidad Astrológica orientada a la reunion de astrologos, pone un punto de encuentro para todos los fanaticos y entusiastas de esta ciencia junto a la del tarot.">
<META NAME="KEYWORDS" CONTENT="astrologia, astros, planetas, mercurio, venus, tierra, marte, jupiter, saturno, urano, neptuno, pluton, cartas natales, carteas astrales, astral, carta, revolucion solar, anual, sexo, compatibilidad de signos, signos y el sexo, horoscopos sexuales, foros">
<META NAME="rating" CONTENT="General">
<META NAME="distribution" CONTENT="Global">
<META NAME="expires" CONTENT="never">
<META NAME="author" CONTENT="GrupoFN Soluciones Informaticas">
<META NAME="publisher" CONTENT="[URL unfurl="true"]www.astrodestino.com.ar">[/URL]
<style type="text/css">
<!--

.unnamed1 {  font-size: xx-small; background-color: #FFFFFF}

-->
</style>
<script language="JavaScript">
<!--



<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
//-->
</script>
<link href="sinsubrayar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="todoblanco.css" type="text/css">
<STYLE TYPE="text/css">
H1 {font-family: Verdana,Tahoma,Arial,Helvetica,Times New Roman; font-size: 12pt; color: black}
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<div align="center">
  <div align="center"><b><font size="4"><h1>AstroDestino - La Comunidad Astrol&oacute;gica</h1></font></b><br>
    Hor&oacute;scopos para Hoy<br>
    <div align='center'><script type="text/javascript"><!--
google_ad_client = "pub-0275194294622220";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="";
google_page_url = document.location;
//--></script></div>
<script type="text/javascript"

  src="[URL unfurl="true"]http://pagead2.googlesyndication.com/pagead/show_ads.js">[/URL]
</script>
    <b></b>
    <? if (!($horoscopo==0) || !($horoscopo_BOF==1))
{
?>
    <table cellpadding="1" cellspacing="1">
      <?
  $startrw=0;
  $endrw=$HLooper1__index;
  $numberColumns=2;
  $numrows=6;
  while((($numrows!=0) && (!($horoscopo==0))))
  {

    $startrw=$endrw+1;
    $endrw=$endrw+$numberColumns;
?>
      <tr align="center" valign="top">
        <?
    while((($startrw<=$endrw) && (!($horoscopo==0))))
    {

      $txt.=$Item["texto"].$Value;
?>
        <td>
          <table width="285" border="1" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0">
            <tr>
              <td bgcolor="#E1E8FF" bordercolor="#3399FF"><font size="2"><b><font face="Arial, Helvetica, sans-serif" size="1"><?       echo ($Item["signo"].$Value); ?> (<?       echo $varday; ?>/<?       echo $varmonth; ?>/<?       echo $varyear; ?>)</font></b></font></td>
            </tr>
            <tr>
              <td bordercolor="#999999"><font size="2"><img src="../graficos/horoscopos/<?       echo ($Item["signo"].$Value); ?>.gif" width="30" height="30" align="left" alt=" <?       echo $txt; ?>"><font size="1" face="Arial, Helvetica, sans-serif"><?       echo $txt; ?></font></font></td>
            </tr>

          </table>
        </td>
        <?
      $startrw=$startrw+1;
      $horoscopo=mysql_fetch_array($horoscopo_query);
      $horoscopo_BOF=0;

    }
?>
      </tr>
      <?
    $numrows=$numrows-1;
  }
  }
?>
    </table>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yes I speak spanish, do you have an email to send you the db pass and username for you to check if you can fix it?
I posted that in spanish but it seems that spanish is a banned language & my post was deleted.
Tnx
 
I actually did see you post and posted back in spanish, but apparently you are right and spanish is not allowed, it removes the post ater a little while.

I said in my post that The ip address for thr DB, and user and the password.
I just hope that your server can handel remote connections.
my email is "vacunita arroba yahoo.com"




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
It Won't let me connect to the DB. it's probably not setup for remote connections. without that I can't connect.

Sorry.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top