SunQuest
           Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherProject Help Wanted

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old March 10th, 2008, 08:27 AM
nubianniht nubianniht is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 58 nubianniht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 33 m 10 sec
Reputation Power: 1
Question Servlets/JSP - Please Help w/ converting this block of PHP to JSP

i hope i posted this in the correct forum.

i've done searches throughout these forums and google searches for for flash jsp email forms but have came up with nothing solid.
any help on how to achieve results will greatly be appreciated.
thanks in advance

PHP Code:
<?
if(!empty($HTTP_POST_VARS['sms_smsTo']) && !empty($HTTP_POST_VARS['sms_taMessage']))
{
    
$to stripslashes($HTTP_POST_VARS['sms_smsTo']);
    
$subject stripslashes($HTTP_POST_VARS['sms_Subject']);
    
$body stripslashes($HTTP_POST_VARS['sms_taMessage']);
    
//$body .= "\n\n---------------------------\n";
    //$body .= "Mail sent by: " . $HTTP_POST_VARS['sms_From'] . " <" . $HTTP_POST_VARS['sms_From']  . ">\n";
    
$header "From: " $HTTP_POST_VARS['sms_From'] . " <" $HTTP_POST_VARS['sms_From'] . ">\n";
    
//$header .= "Reply-To: " . $HTTP_POST_VARS['sms_From'] . " <" . $HTTP_POST_VARS['sms_From'] . ">\n";
    
$header .= "X-Mailer: PHP/" phpversion() . "\n";
    
$header .= "X-Priority: 3";
    if(@
mail($to$subject$body$header))
    {
        echo 
"output=sent";
    } else {
        echo 
"output=error";
    }
} else {
    echo 
"output=error";
}
?>

Reply With Quote
  #2  
Old March 12th, 2008, 02:24 PM
nubianniht nubianniht is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 58 nubianniht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 33 m 10 sec
Reputation Power: 1
Unhappy

oh where's the love?

Reply With Quote
  #3  
Old March 13th, 2008, 12:41 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,677 stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 3 h 18 m 44 sec
Reputation Power: 301
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
This type of code is traditionally handled in a Servlet. This is one way to separate the visual display logic from the programming logic.

But soapboxes aside, what are you having problems on? To get a parameter that was posted or received as part of the URL use getParameter(). I'm not sure if I understand why you're doing a stripslashes but that would have to be coded as it isn't something in Java.

How is your email system configured? The issue is that there are many ways to send email - simple SMTP connection to password protected SSL with a self-signed certificate. Tag libraries like the mailer tag library can help.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #4  
Old March 13th, 2008, 01:17 PM
Yawmark's Avatar
Yawmark Yawmark is offline
Feelin' Groovy
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Aug 2001
Location: WDSMIA
Posts: 7,617 Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 1 Day 12 h 49 m 55 sec
Reputation Power: 1343
Send a message via ICQ to Yawmark Send a message via MSN to Yawmark
Quote:
Originally Posted by nubianniht
oh where's the love?

Oh where's the specific question?

If you want general project help (i.e., someone to translate some PHP to Java for you), I can move this to the appropriate forum. If you have specific question about Java (meaning: you're writing something and have run into a problem for which you can provide an SSCCE), please post it here.

~
__________________
Yawmark
class Sig{public static void main(String...args){\u0066or(int
\u0020$:"vÌÈÊ\"¤¾Àʲ¬Æ\"v¤Î¤\"²¤¨¸¬Æ".to\u0043h\u0061rArray()
)System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
+(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}

Reply With Quote
  #5  
Old March 19th, 2008, 10:21 AM
nubianniht nubianniht is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 58 nubianniht User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 33 m 10 sec
Reputation Power: 1
Quote:
Originally Posted by stdunbar
This type of code is traditionally handled in a Servlet. This is one way to separate the visual display logic from the programming logic.

But soapboxes aside, what are you having problems on? To get a parameter that was posted or received as part of the URL use getParameter(). I'm not sure if I understand why you're doing a stripslashes but that would have to be coded as it isn't something in Java.

How is your email system configured? The issue is that there are many ways to send email - simple SMTP connection to password protected SSL with a self-signed certificate. Tag libraries like the mailer tag library can help.



Quote:
Originally Posted by Yawmark
Oh where's the specific question?

If you want general project help (i.e., someone to translate some PHP to Java for you), I can move this to the appropriate forum. If you have specific question about Java (meaning: you're writing something and have run into a problem for which you can provide an SSCCE), please post it here.

~


my apologies for the late reply.
Yawmark, i'm sorry if i posted this in the wrong forum.

basically i have a flash based email app that post vars to the php script you see above.
i have 0 knowledge of java or jsp. so there is some terminology that you speak of i have no clue as to what you are referring to. i have a basic understanding of php.
our servers uses jsp as backend not php.
so i need to find a way to convert that php script i have into a jsp for. it would be awesome if i could just change the file extention.


i found a jsp file that suppose to receive var from flash but since i have no experience with jsp it's hard for me to figure out what's going on with this file.

Code:
<HEAD>
<script language = "javascript">
<!--
function setFlashVars()
{
  //initialize the variables of the Flash form
  emailForm.SetVariable("name", "<%= getVar("name", "", session) %>");
  emailForm.SetVariable("email","<%= getVar("email", "", session) %>");
  emailForm.SetVariable("subject", "<%= getVar("subject", "", session) %>");
  emailForm.SetVariable("message", "<%= getVar("message", "", session) %>");
  emailForm.SetVariable("url", document.location);
}
//-->
</script>

<TITLE>email_form</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" onLoad="setFlashVars()">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<!--Email: Message: Name: Please Fill in Your Infomation --><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
 ID="emailForm"
 WIDTH=550 HEIGHT=400>
 <PARAM NAME=movie VALUE="email_form.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="email_form.swf" quality=high bgcolor=#FFFFFF  WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>

<% }else{%>
<HTML>
<HEAD>
<TITLE>Email Submit</TITLE>
<BODY>
<H1>You Submitted the following info!</H1>

<B>Name:</B> <%=request.getParameter("name") %><BR>
<B>Email:</B> <%=request.getParameter("email") %><BR>
<B>Subject:</B> <%=request.getParameter("subject") %><BR>
<B>Message:</B> <%=request.getParameter("message") %><BR>

<%
   //Save the submitted variables in the HttpSession
   //so that the form can remember what was entered.
   session.setAttribute("name", request.getParameter("name"));
   session.setAttribute("email", request.getParameter("email"));
   session.setAttribute("subject", request.getParameter("subject"));
   session.setAttribute("message", request.getParameter("message"));
  
   //dump out all of the submitted variables as an HTML comment
   //to help debug the final values in the form.
   out.println("<!-----Debug output all vars: ------");
   Enumeration pNames = request.getParameterNames();
   while(pNames.hasMoreElements()){
      String pName = (String)pNames.nextElement();
      out.println(pName + ": " + request.getParameter(pName));
   }
   out.println("-->");
%>
</BODY>
</HTML>
<%}%>

Reply With Quote
  #6  
Old March 19th, 2008, 10:25 AM
Yawmark's Avatar
Yawmark Yawmark is offline
Feelin' Groovy
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Aug 2001
Location: WDSMIA
Posts: 7,617 Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level)Yawmark User rank is General 5th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 1 Day 12 h 49 m 55 sec
Reputation Power: 1343
Send a message via ICQ to Yawmark Send a message via MSN to Yawmark
Quote:
Yawmark, i'm sorry if i posted this in the wrong forum.

That's okay. I'll move this to the Project Help Wanted forum. With no experience in Java or JSP, you will not be able to do this on your own.

Quote:
it would be awesome if i could just change the file extention.



Best of luck with your project!

~

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherProject Help Wanted > Servlets/JSP - Please Help w/ converting this block of PHP to JSP [Moved from Java Forum]


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway