Solved

Script sample for small webshop

Posted on 2007-11-15
8
559 Views
Last Modified: 2012-08-13
Hi Experts,

I need to create a small ’webshop’ on our exciting website that is currently build on HTML and ASP.

My company has published a book, and therefore wishes to make it available to be purchased online.

So I’m looking for a simple script that I can insert (copy/paste) into our webpage. Besides the options to insert name, company address, qty etc. we need a email to be sent when placing an order as well for inserting the data into a access file.

When can I find such a script sample with these few extensions?

We’re running IIS6 – 2003R2 – and I have no gift in programming what so ever!

Thanks in advance.
0
Comment
Question by:dsl77
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Expert Comment

by:deeppra
ID: 20288888
This is a small Email library developed in java i think this suits u r needs

http://www.chilkatsoft.com/java-email.asp
0
 
LVL 5

Expert Comment

by:deeppra
ID: 20288920
Here is a small program to send email


Sending email via SMTP

The first example shows how to send a basic email message via SMTP. Below, you'll find the SimpleSender class, which takes your message's details from the command line and calls a separate method -- send(...) -- to send it:

package com.lotontech.mail;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
/**
  * A simple email sender class.
  */
public class SimpleSender
{
  /**
    * Main method to send a message given on the command line.
    */
  public static void main(String args[])
  {
    try
    {
      String smtpServer=args[0];
      String to=args[1];
      String from=args[2];
      String subject=args[3];
      String body=args[4];
      send(smtpServer, to, from, subject, body);
    }
    catch (Exception ex)
    {
      System.out.println("Usage: java com.lotontech.mail.SimpleSender"
       +" smtpServer toAddress fromAddress subjectText bodyText");
    }
    System.exit(0);
  }

for more info http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
0
 
LVL 12

Expert Comment

by:pigmentarts
ID: 20299062
mals ecommerce is totally free and allows you to do just this into a html site free ssl included. once users have paid they are automated a download link. free gateways also! its all done for you, if you do decide to  pay you can then customises it to the look and theme of your site.

http://www.mals-e.com/
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:dsl77
ID: 20311130
Hi all, many of the above solutions are great.

But the solution we need is more simple. i have found a scipt that i have tried to edit to my needs.

i need the funktion to send email, perhaps some more code is needed. And also a checkbox/radio whether to select book a or book b.

Thanks in advance.

contact.php
 
<?php
$EmailFrom = "contact@test.com";
$EmailTo = "sysadm@company.dk";
$Subject = "Contact Form";
$Name = $_POST['Name']; 
$Email = $_POST['Email']; 
$Company = $_POST['Company']; 
$Phone = $_POST['Phone']; 
$Comments = $_POST['Comments']; 
 
// The body text of your email
 
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "
";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "
";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "
";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "
";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "
";
 
// command that calls the php mail() function
$result = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
 
// redirection as a function of $result variable boolean value 
if ($result){
print "<meta http-equiv="refresh" content="0;URL=messagesent.html">";
}
else{
print "<meta http-equiv="refresh" content="0;URL=messagenotsent.html">";
}
?>
 
contact.html
 
<html><style type="text/css">
<!--
body {
	background-image: url(overview_bg_.jpg);
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
<body>
<p><strong>text</strong></p>
<p>&nbsp;</p>
<table cellspacing="0" cellpadding="0" width="50">
<form action=contact.php method=post name=form class="style1">
<tr>
<td>Name:</td>
<td><input name="Name" size="40" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input name="Email" size="40" /></td>
</tr>
<tr>
<td>Company:</td>
<td><input name="Company" size="40" /></td>
</tr>
<tr>
  <td>Address:</td>
  <td><input name="Company2" size="40" /></td>
</tr>
<tr>
  <td>City:</td>
  <td><input name="Company2" size="40" /></td>
</tr>
<tr>
  <td>Zip Code:</td>
  <td><input name="Company2" size="40" /></td>
</tr>
<tr>
<td>Phone:</td>
<td><input name="Phone" size="40" /></td>
</tr>
<tr>
<td>Comments:</td>
<td><textarea name="Comments" rows="5" cols="32"></textarea></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="Send" /></td>
</tr>
</form>
</table>
<p>&nbsp;</p>
</body>
</html>

Open in new window

0
 
LVL 12

Expert Comment

by:pigmentarts
ID: 20311363
mals will send auto email with a download link if you after payment
0
 

Author Comment

by:dsl77
ID: 20311454
Malswith credit card payment ... it's to advanced for our needs. We only need to sell one product online and the information the users types in, will be used when sending an invoice.

Can anybody use the code submitted?
0
 
LVL 12

Accepted Solution

by:
pigmentarts earned 500 total points
ID: 20315999
to be honest mals is best with only a few products 1 or 2 otherwise its better to have a full dynamic site or more products. its one pice of code thats goes on your site gets all user info etc
0
 

Author Comment

by:dsl77
ID: 20334303
We'll use Mals ... thanks for all your help! ;)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
diffSum example 4 37
web services creation SOAP vs REST 5 41
What display techniques for text on a video? 3 42
Remove all hidden metadata properties of MS .Docx Files 7 38
Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
Learn about the eCommerce marketing trends for the year ahead.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question