Jump to content

Change a simple script from ASP to PHP, newsletter registering


visto

Recommended Posts

I am going to change host and therefore change my ASP things to PHP.

Can someone help med with a PHP script that does the same job as the ASP script below: In the form on the html-webpage you have to write 1) your name, 2) your mailadresse 3) by means of radio buttons chose between getting the newsletter or being removed from the mailinglist.

 

In ASP the script is:

 

<%

set msg = Server.CreateOBject( "JMail.Message" )

msg.Logging = true

msg.silent = true

msg.ContentType = "text/html"

msg.From = Request.Form("Email")

msg.FromName = Request.Form("Name")

msg.AddRecipient "[email protected]", "mydomaine.dk"

msg.Subject = "Concerning newsletter"

msg.Body = "Fra:<br>" & Request.Form("Name") & "<br><br>Email:<br>" & Request.Form("Email") & "<br><br>Wish:<br>" & Request.Form("M")

if not msg.Send("localhost" ) then

Response.write "<pre>" & msg.log & "</pre>"

else

Response.write "<p class=""message""><br><br>You shall have a confirmation when you are registred</p>"

end if

Set msg = Nothing

%>

 

(I can see that pre- and br-tags were removed above), so the script is not accurate, but I hope you get the idea.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.