|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
convert ASP mailer to PHP?
Hello, I have a shopping cart website that has been set up to send form information to an asp mailer via form post.
the asp mailer is based on another server and I want to have it all on my own Linux apache server. So I need to set up a php form mailer. The only problem is I don't really know where to start. The company sent me the example asp code (I was going to paste the ASP Code here but it was 2600 char too long). I have only just started to play with coding so I am very much a newbie. Can anyone help me out? The company that made the shopping cart gave me this info to help (sic) me on my way. --------------------------------------------------------------------------- Hello, well, generally this is a little bit complicated. You cannot use the ASP script, since ASP is only supported by Windows machines using IIS-WebServer-Software. But I can give you a few more details from what I know about the email service: The parameters send to the script are the following, all send via a form post, means you can access the values in the same way as you¹d access values from a simple HTML form: Code:
Interface Configuration Name Type Description SiteDirectory String Contains the path and the protocol of your store ( e.g: http://www.myshop.com/docs/ ) IsDialogue String „true“ if the request comes from the dialogue page, "false" if it is an order. Interface Recipient Name Type Description SenderName String Recipient (Name) To String Recipient ( Emailaddress ) From String ShopProvider (EmailAddress) Subject String Subjectline Interface Content ( isDialogue = „true“ ) Name Type Description Message String Your customers dialogue message Interface Content ( isDialogue = „false“ ) Name Type Description Message String Orderdata ( ShoppingCart etc. ) HeaderUser String Headermessage for your customer HeaderProvider String Headermessage for the shop provider FooterUser String Footermessage for Customer FooterProvider String Footermessage for the shop provider Prolog String Introduction (Text) BillToData String Billing Address ShipToData String ShippingAddress DeliveryMethodData String Deliverymethod details PaymentMethodDate String Paymentmethod details Last edited by direwolf : March 9th, 2002 at 04:59 AM. |
|
#2
|
||||
|
||||
|
It is not very difficult to convert the asp mailer to php.i'll show you a small exmple how you can do it easily.
test.asp PHP Code:
The same asp code you can convert to php using mail() function. test.php PHP Code:
i hope you understand what i'm trying to explain. Good Luck!
__________________
SR - webshiju.com www.lizratechnologies.com "The fear of the LORD is the beginning of knowledge..." Last edited by Shiju Rajan : March 12th, 2002 at 07:04 AM. |
|
#3
|
||||
|
||||
|
Ahhh I hate it when someone makes it look so easy.
![]() Yes I can understand your example as I can compare the two. But when I look at the code of the asp mailer, my head hurts. I am trying hard to pick stuff up and when I think I have something worked out it all turns to poo. Here is a snippet from the code to see what I mean. Edit: Removed old code Last edited by direwolf : March 19th, 2002 at 05:44 PM. |
|
#4
|
||||
|
||||
|
You may convert it easily as i said earlier.
here is the sample code from your code snippet.try to convert all the code like that. PHP Code:
post your question here, if you are facing any problem to convert. |
|
#5
|
||||
|
||||
|
Thank you Shiju Rajan.
I will now spend a few days trying to work the rest of it out from what you have given me so far. Thank you for your offer to answer more questions from me (I think I may need it ) now the fun begins. ![]() |
|
#6
|
||||
|
||||
|
<<
Thank you for your offer to answer more questions from me (I think I may need it ) now the fun begins. >> yea, i know you will make it. |
|
#7
|
||||
|
||||
|
Ok, I have given the next snippet a go myself. I must say some of the code is still confusing. I have a basic understanding of pesudo code and "if-then-else" statements and such - but this stuff blows my mind!!
If you could cast your eye over what I have done and point out any errors (I know there will be heaps) that would be great. Thanks Edit: Removed old code ![]() Last edited by direwolf : March 19th, 2002 at 05:43 PM. |
|
#8
|
||||
|
||||
|
This is the final part I have converted:
Edit: removed old code ![]() Last edited by direwolf : March 19th, 2002 at 05:41 PM. |
|
#9
|
||||
|
||||
|
Ok, I tested the script and it didn't get very far.
![]() Parse error: parse error in /var/www/mail/mailer.php on line 130 which is this line: Code:
// Define Variables // Name of the page that the user is being redirected to // Stores if the request has been made from a physical directory // e.g. a hard disk or a cd-rom. // in this case we have to pay special attention to Netscape // customers, coz Netscape doesn't allow you to redirect the // browser to a local file. $isFileProtocol = $siteDirectory,"file:" > 0 |
|
#10
|
||||
|
||||
|
i think someone who is experienced in programming should help you this work going.any way i have just edited your script a bit.you need to edit further for running this script going. PHP Code:
|