Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-10-2011, 05:35 AM Asp to Php
Novice Talker

Posts: 12
Trades: 0
I converted one asp code into php. then i checked in localhost, it was working fine but when i uploaded in server and checked it's showing an error. So, I need some help please!

The asp code is :
Code:
<%@ Language=VBScript %>
<%
Company_Email_address="info@rushlimousine.com"
Email_Server="relay-hosting.secureserver.net"
FromEmail="website@rushlimousine.com"
%>
<%if trim(Request.Form("Submitit")) = "Send" then
msg = "--[ Sender ]--------------------------"+Chr(13)+Chr(13)
msg = msg + "   Name: " + Request("Name") + "."+Chr(13)+Chr(13)
msg = msg + "    URL: " + Request("url") + "."+Chr(13)+Chr(13)
msg = msg + " E-mail: " + Request("email") + "."+Chr(13)+Chr(13)
msg = msg + "Subject: " + Request("subj") + "."+Chr(13)+Chr(13)
msg = msg + "Message: "+Chr(13)
msg = msg + Request("msg") + "."+Chr(13)+Chr(13)
msg=  msg +"Have a nice day!"+Chr(13)+Chr(13)

sSubject="You got mail! [Form: rushlimousine.com]"
StrSmartHost=Email_Server
ToEmail=Company_Email_address
EmailSubject=sSubject
EmailBody=msg

Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = FromEmail
objMail.Subject = sSubject
objMail.To = ToEmail
objMail.Body = EmailBody
objMail.Send

Set objMail = Nothing

curMsg = "<div align='left' style='color: #66B022; font: bold 12px Tahoma;'>Message sent. Thank you.</div>"
else
curMsg=""
end if
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Chicago Limousine | Chicago Area Limo Service | Chicago Ohare Limo | Contact us</title>

<meta name="description" content="Chicago Limousine Service in Chicago Rush Ground Transportation providing chicago area limo service, chicago ohare limo, chicago airport limo.">

<meta name="keywords" content="Chicago, CEO Charter, VIP Charter, VIP Coauch Bus, VIP Van Charter, VIP VAN, VIP Limo Bus, VIP limousine,chicago limousine, chicago area limo service, chicago limo, chicago ohare limo, limo service in chicago, chicago airport limo">

<link href="main.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="OtherFunctions.js"></script>

</head>



<body bgcolor="#FFFFFF">

<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td height="60" valign="middle"><div class="logo"><a href="index.html"><img src="img/welcome.png" width="301" height="30" hspace="75" border="0"></a></div>

        <div class="header">

          <table width="100%" border="0" cellspacing="0" cellpadding="0">

            <tr>

              <td ><a href="corpserv.asp"><img src="img/_corp.gif" width="141" height="17" border="0"></a></td>

              <td ><a href="corpapp.asp"><img src="img/_corp1.gif" width="155" height="17" border="0"></a></td>

            </tr>

          </table>

        </div></td>

  </tr>

</table>

<table width="100%" height="1%" border="0" cellpadding="0" cellspacing="0" style="border-bottom:2px solid white">

  <tr>

    <td width="50" height="18" align="right" valign="top" bgcolor="#FFFFFF"><img src="img/p.gif" width="64" height="1"></td>

    <td width="1%" height="18" align="left" valign="top" style="background-image:url(img/angle_l_t.png); background-repeat:no-repeat"><img src="img/p.gif" width="15" height="1"></td>

    <td width="6%" align="center" valign="middle" class="menu" ><a href="index.html">Home</a></td>

    <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="flight.html">Flight Crew Services</a></td>

    <td width="5%" align="center" valign="middle" nowrap class="menu" ><a href="fleet.html">Rush Fleet</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="load.html">Loading Procedures </a></td>

    <td width="6%" align="center" valign="middle" nowrap class="menu" ><a href="rates.html">Rates</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="reservations.asp">Reservations</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="regulations.html">Regulations</a></td>

    <td align="center" valign="middle" nowrap class="menusel" >Contact us</td>

    <td width="40%" align="left" valign="top" class="menu" >&nbsp;</td>

  </tr>

  <tr>

    <td height="18" align="right" valign="top" bgcolor="#FFFFFF">&nbsp;</td>

    <td colspan="10" align="center" valign="middle" nowrap bgcolor="#0A53A2" style="border-left:solid 1px white; border-top:solid 1px white" ><table width="100%" border="0" cellspacing="0">

        <tr>

          <td width="10" align="center" valign="middle" nowrap class="menuttt" ><img src="img/p.gif" alt="1" width="11" height="1"></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup_chicago.html">Pickup Chicago Limousine</a></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup.html">Pickup O'Hare Limousine </a></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup_w.html">Pickup Midway Limousine </a></td>

          <td width="95%" class="menu">&nbsp;</td>

        </tr>

    </table></td>

  </tr>

</table>

<table width="100%" height="239" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td align="left" valign="bottom" bgcolor="#C5D6DE" style="background-image:url(img/bg_1700.jpg); background-repeat:no-repeat">

     <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td width="420" valign="bottom"><div style="position:relative">

    <div style="position:absolute; left:-20px; top:-170; width: 438px;"><img src="img/tech_cont.png" width="437" height="254"></div>

    <div style="position:absolute; left:350px; top:-220px;"><a href="index.html"><img src="img/logo.png" border="0"></a></div>

    <div style="position:absolute; left:400px; top:-200px;"><img src="img/flight.png" width="224" height="23"></div>

    </div></td>

    <td width="40%" align="right" valign="top"><a href="index.html"><img src="img/home.png" width="16" height="16" hspace="5" vspace="45" border="0"></a><a href="mailto:info@rushlimousine.com"><img src="img/email.png" width="16" height="16" hspace="10" vspace="45" border="0"></a></td>

    <td width="30%"><img src="img/p.gif" width="1" height="239"></td>

  </tr>

</table>

</td>

  </tr>

</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td height="90" valign="bottom"><img src="img/p.gif" width="420" height="1"></td>

    <td width="80%" rowspan="2" align="left" valign="top" class="main" style="border-bottom:1px solid #EAEAEA">

    <div class="ttl"><img src="img/ttl_17.png" width="118" height="25" align="absmiddle"><%=curMsg%></div>

    <div>

<script language="JavaScript">

function chk(it) {

        if(!StringTest(it.name, "Your Name is required"))    { 
            return(false); 
            }
        if(!isEmail(it.email.value)) {
            it.email.focus(); 
            return(false); 
            }
        if(it.subj.value.length < 3)   {
            alert("Subject field is required."); 
            it.subj.focus(); 
            return(false); 
            }
        if(it.msg.value.length < 3) {
            alert("Message field is required."); 
            it.msg.focus(); 
            return(false); 
            }

        return (true);

    
}
</script>



    <form id="contactform" method="post" onSubmit="return chk(this)">

    <input type="hidden" name="posted" value="1" />

    <table cellpadding="0" cellspacing="0" class="form1" style=" border-top:3px solid #CCCCCC; border-bottom:3px solid #CCCCCC;">

        <tr>

          <td><strong>Name:</strong><font color="#ff0000"> *</font></td>

          <td><input name="name" class="formnamelong" tabindex="1" value="" /></td>

        </tr>

        <tr>

            <td><label for="email"><strong>E-mail:</strong><font color="#ff0000"> *</font></label></td>

            <td><input name="email" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="url"><strong>Url:</strong></label></td>

            <td><input name="url" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="subj"><strong>Subject:</strong><font color="#ff0000"> *</font></label></td>

            <td><input name="subj" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="msg"><strong>Message:</strong><font color="#ff0000"> *</font></label></td>

            <td><textarea name="msg" rows="10" cols="45"></textarea></td>

        </tr>

        <tr>

            <td>&nbsp;</td>

            <td><input type="submit" value="Send" name="Submitit" class="gobutt"></td>

        </tr>

    </table>

</form>

    </div></td>

  </tr>

  <tr>

    <td height="92" align="right" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">

      <tr>

        <td width="50%" align="right" valign="bottom" nowrap class="shad" style="padding:0px 10px 5px 10px"><a href="mailto:info@rushlimousine.com"><img src="img/arr.png" width="5" height="10" hspace="5" border="0" align="absmiddle">info@rushlimousine.com</a> </td>

        <td width="50%" align="center" valign="middle" class="shad"><img src="img/contact.png" width="206" height="71" hspace="5" vspace="5" border="0"></td>

      </tr>

    </table></td>

  </tr>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

    <td></td>


  </tr>

</table>

</body>

</html>
and the php code is
Code:
<?php
 
/*
  ASP Translator Messages (These can be removed later)
  ----------------------------------------------------

  1. All "Dim" statements have been changed to comments for reference.

*/

?>
<?@ $Language=$VBScript ?>
<?
$Company_Email_address="info@rushlimousine.com";
$Email_Server="relay-hosting.secureserver.net";
$FromEmail="website@rushlimousine.com";
?>
<?if (trim(@$_POST["Submitit"]) == "Send") {
$msg = "--[ Sender ]--------------------------"+chr(13)+chr(13);
$msg = $msg + "   Name: " + Request("Name") + "."+chr(13)+chr(13);
$msg = $msg + "    URL: " + Request("url") + "."+chr(13)+chr(13);
$msg = $msg + " E-mail: " + Request("email") + "."+chr(13)+chr(13);
$msg = $msg + "Subject: " + Request("subj") + "."+chr(13)+chr(13);
$msg = $msg + "Message: "+chr(13);
$msg = $msg + Request("msg") + "."+chr(13)+chr(13);
$msg=  $msg +"Have a nice day!"+chr(13)+chr(13);
 
$sSubject="You got mail! [Form: rushlimousine.com]";
$StrSmartHost=$Email_Server;
$ToEmail=Company_Email_address;
$EmailSubject=$sSubject;
$EmailBody=$msg;
 
//dim $objMail;
Set $objMail = Server.CreateObject("CDONTS.NewMail");
$objMail.$From = $FromEmail;
$objMail.$Subject = $sSubject;
$objMail.To = $ToEmail;
$objMail.$Body = $EmailBody;
$objMail.$Send;
 
Set $objMail = Nothing;
 
$curMsg = "<div align='left' style='color: #66B022; font: bold 12px Tahoma;'>Message sent. Thank you.</div>";
} else {
$curMsg="";
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Chicago Limousine | Chicago Area Limo Service | Chicago Ohare Limo | Contact us</title>

<meta name="description" content="Chicago Limousine Service in Chicago Rush Ground Transportation providing chicago area limo service, chicago ohare limo, chicago airport limo.">

<meta name="keywords" content="Chicago, CEO Charter, VIP Charter, VIP Coauch Bus, VIP Van Charter, VIP VAN, VIP Limo Bus, VIP limousine,chicago limousine, chicago area limo service, chicago limo, chicago ohare limo, limo service in chicago, chicago airport limo">

<link href="main.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="OtherFunctions.js"></script>

</head>



<body bgcolor="#FFFFFF">

<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td height="60" valign="middle"><div class="logo"><a href="index.html"><img src="img/welcome.png" width="301" height="30" hspace="75" border="0"></a></div>

        <div class="header">

          <table width="100%" border="0" cellspacing="0" cellpadding="0">

            <tr>

              <td ><a href="corpserv.asp"><img src="img/_corp.gif" width="141" height="17" border="0"></a></td>

              <td ><a href="corpapp.asp"><img src="img/_corp1.gif" width="155" height="17" border="0"></a></td>

            </tr>

          </table>

        </div></td>

  </tr>

</table>

<table width="100%" height="1%" border="0" cellpadding="0" cellspacing="0" style="border-bottom:2px solid white">

  <tr>

    <td width="50" height="18" align="right" valign="top" bgcolor="#FFFFFF"><img src="img/p.gif" width="64" height="1"></td>

    <td width="1%" height="18" align="left" valign="top" style="background-image:url(img/angle_l_t.png); background-repeat:no-repeat"><img src="img/p.gif" width="15" height="1"></td>

    <td width="6%" align="center" valign="middle" class="menu" ><a href="index.html">Home</a></td>

    <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="flight.html">Flight Crew Services</a></td>

    <td width="5%" align="center" valign="middle" nowrap class="menu" ><a href="fleet.html">Rush Fleet</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="load.html">Loading Procedures </a></td>

    <td width="6%" align="center" valign="middle" nowrap class="menu" ><a href="rates.html">Rates</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="reservations.asp">Reservations</a></td>

    <td align="center" valign="middle" nowrap class="menu" ><a href="regulations.html">Regulations</a></td>

    <td align="center" valign="middle" nowrap class="menusel" >Contact us</td>

    <td width="40%" align="left" valign="top" class="menu" >&nbsp;</td>

  </tr>

  <tr>

    <td height="18" align="right" valign="top" bgcolor="#FFFFFF">&nbsp;</td>

    <td colspan="10" align="center" valign="middle" nowrap bgcolor="#0A53A2" style="border-left:solid 1px white; border-top:solid 1px white" ><table width="100%" border="0" cellspacing="0">

        <tr>

          <td width="10" align="center" valign="middle" nowrap class="menuttt" ><img src="img/p.gif" alt="1" width="11" height="1"></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup_chicago.html">Pickup Chicago Limousine</a></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup.html">Pickup O'Hare Limousine </a></td>

          <td width="10%" align="center" valign="middle" nowrap class="menu" ><a href="pickup_w.html">Pickup Midway Limousine </a></td>

          <td width="95%" class="menu">&nbsp;</td>

        </tr>

    </table></td>

  </tr>

</table>

<table width="100%" height="239" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td align="left" valign="bottom" bgcolor="#C5D6DE" style="background-image:url(img/bg_1700.jpg); background-repeat:no-repeat">

     <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td width="420" valign="bottom"><div style="position:relative">

    <div style="position:absolute; left:-20px; top:-170; width: 438px;"><img src="img/tech_cont.png" width="437" height="254"></div>

    <div style="position:absolute; left:350px; top:-220px;"><a href="index.html"><img src="img/logo.png" border="0"></a></div>

    <div style="position:absolute; left:400px; top:-200px;"><img src="img/flight.png" width="224" height="23"></div>

    </div></td>

    <td width="40%" align="right" valign="top"><a href="index.html"><img src="img/home.png" width="16" height="16" hspace="5" vspace="45" border="0"></a><a href="mailto:info@rushlimousine.com"><img src="img/email.png" width="16" height="16" hspace="10" vspace="45" border="0"></a></td>

    <td width="30%"><img src="img/p.gif" width="1" height="239"></td>

  </tr>

</table>

</td>

  </tr>

</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td height="90" valign="bottom"><img src="img/p.gif" width="420" height="1"></td>

    <td width="80%" rowspan="2" align="left" valign="top" class="main" style="border-bottom:1px solid #EAEAEA">

    <div class="ttl"><img src="img/ttl_17.png" width="118" height="25" align="absmiddle"><?=$curMsg?></div>

    <div>

<script language="JavaScript">

function chk(it) {

        if(!StringTest(it.name, "Your Name is required"))    { 
            return(false); 
            }
        if(!isEmail(it.email.value)) {
            it.email.focus(); 
            return(false); 
            }
        if(it.subj.value.length < 3)   {
            alert("Subject field is required."); 
            it.subj.focus(); 
            return(false); 
            }
        if(it.msg.value.length < 3) {
            alert("Message field is required."); 
            it.msg.focus(); 
            return(false); 
            }

        return (true);

    
}
</script>



    <form id="contactform" method="post" onSubmit="return chk(this)">

    <input type="hidden" name="posted" value="1" />

    <table cellpadding="0" cellspacing="0" class="form1" style=" border-top:3px solid #CCCCCC; border-bottom:3px solid #CCCCCC;">

        <tr>

          <td><strong>Name:</strong><font color="#ff0000"> *</font></td>

          <td><input name="name" class="formnamelong" tabindex="1" value="" /></td>

        </tr>

        <tr>

            <td><label for="email"><strong>E-mail:</strong><font color="#ff0000"> *</font></label></td>

            <td><input name="email" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="url"><strong>Url:</strong></label></td>

            <td><input name="url" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="subj"><strong>Subject:</strong><font color="#ff0000"> *</font></label></td>

            <td><input name="subj" class="formnamelong" value=""/></td>

        </tr>

        <tr>

            <td><label for="msg"><strong>Message:</strong><font color="#ff0000"> *</font></label></td>

            <td><textarea name="msg" rows="10" cols="45"></textarea></td>

        </tr>

        <tr>

            <td>&nbsp;</td>

            <td><input type="submit" value="Send" name="Submitit" class="gobutt"></td>

        </tr>

    </table>

</form>

    </div></td>

  </tr>

  <tr>

    <td height="92" align="right" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">

      <tr>

        <td width="50%" align="right" valign="bottom" nowrap class="shad" style="padding:0px 10px 5px 10px"><a href="mailto:info@rushlimousine.com"><img src="img/arr.png" width="5" height="10" hspace="5" border="0" align="absmiddle">info@rushlimousine.com</a> </td>

        <td width="50%" align="center" valign="middle" class="shad"><img src="img/contact.png" width="206" height="71" hspace="5" vspace="5" border="0"></td>

      </tr>

    </table></td>

  </tr>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

    <td></td>


  </tr>

</table>

</body>

</html>

It's showing Parse error: syntax error, unexpected T_VARIABLE in /home/content/83/7149483/html/rushlimo/contact.php on line 35
__________________
learner
neo.phyte is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-10-2011, 05:56 AM Re: Asp to Php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
The ASP code is utilizing external libraries so you can't implement the same functionality in PHP simply by rewriting it using PHP syntax.

This is line 35:
Code:
Set $objMail = Server.CreateObject("CDONTS.NewMail");
The . operator means something completely different in PHP. Even if it didn't there is no 'Server' object. In addition to this you do not declare types in PHP. Technically the following code is valid in terms of syntax, but it won't work because Server is undefined:
PHP Code:
$objMail Server::CreateObject("CDONTS.NewMail"); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-10-2011, 06:15 AM Re: Asp to Php
Novice Talker

Posts: 12
Trades: 0
thanks alot for the information.
so what can i do now to make it working?
__________________
learner
neo.phyte is offline
Reply With Quote
View Public Profile
 
Old 05-10-2011, 06:25 AM Re: Asp to Php
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And CDONTS is a Windows OS ONLY object, coupled with the fact that it was dropped after Windows 2000 server and has to be installed specifically.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2011, 06:26 AM Re: Asp to Php
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by neo.phyte View Post
so what can i do now to make it working?
Learn PHP.

There are a lot of things that just don't convert between the VB code and PHP. For instance, this line means nothing in PHP:
Code:
<?@ $Language=$VBScript ?>
There is no 'Request' object:
Code:
$msg = $msg + "   Name: " + Request("Name") + "."+chr(13)+chr(13);
You shouldn't use short opening tags ( <? ), and probably several more things I'm not noticing at first glance.

My advice is forget about the ASP code and try to implement the same functionality in PHP from scratch.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to Asp to Php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23685 seconds with 12 queries