...

View Full Version : Database? or something else?



Vapor
09-05-2006, 09:10 PM
I have only gone skin deep when it comes to web design. I can navigate through html, javascripts, web design, but I have never done any programming or use of a database. I am creating a site that will allow people to purchase things I need a way for customers to choose what they want and send the info to me. The only way that I know how is to have an email sent to me through the mailto command in html. Is there a way other than this to send order information to me? When people speak of databases, I have never used mysql, but I have Microsoft Access, isn't this a database, or is that something completely different. I know this is probably a dumb question, but I know nothing about this.

Thanks for the help,

Vapor

mlseim
09-05-2006, 09:35 PM
If it's something they send that does not involve personal information
or credit cards, (like a simple form), you would use a server-side language
such as PHP or Perl(cgi) to process the form. Information on the form gets
sent to you - openly, not secured. Very easy to do, but NOT for sending
any personal bank or credit card information.

If it involves credit cards, you'll need some sort of PHP online shopping cart
program (like www.cubecart.com) and then a merchant account that you
pay for to handle credit cards securely. cubecart will handle all of the items,
costs, and pictures of the items, inventory control and sending the invoice
to the business. If you utilize the credit card part, it will seamlessly work
with most credit card merchant accounts (including PayPal).... the credit
card portion is where the security is needed.

Just about all PHP shopping cart programs require MySQL database, which
is set-up and configured along with the shopping cart program.

Vapor
09-05-2006, 10:29 PM
So I take it that server side is the only way. No client side?

I am not sending personal data such as credit card info, I just need to know how many orders I have, and having a link that pops up email kinda sucks, I want a form that cant be submitted to me. I know a database can do it, but I wondered if there was any way around it using client side.

ronaldb66
09-06-2006, 08:41 AM
You practically can't get around some form of session management linking a unique person to a certain set of activities, ending in an order; it would be far easier to do this server side. Also, storing and maintaining purchasable items could hardly be done, if at all, without server side scripting, and processing forms requires it.

I happen to be looking into hand rolling a simple shopping cart facility without online payment as an add-on to an existing database-driven site; simply registering order information for further processing and payment either through paying in advance or CoD.
I found a good tutorial for a simple shopping cart system based on PHP and MySQL, discussing all the necessary elements and containing example scripts to illustrate these; if you're interested I'd be happy to provide the links.

mlseim
09-06-2006, 02:36 PM
Vapor ...

Use PHP ...

Give us a link to your form (that you made ... which now emails you
data with your email client pop-up). We'll give you the simple PHP
script to email you the same data without your email client. You'll put
that PHP script in the same directory as your form.

We're assuming your webhost allows PHP scripting and PHP sendmail.
(you can check that with your webhost).

Vapor
09-06-2006, 08:13 PM
I don't have the site online yet, but if I give you the code will that help?

Here is the code for that page:


<html>
<head>
<title>New Account</title>
</head>
<body bgcolor=#000033>
<body text="gold">
<style type="text/css">
@import url(company.css);
h1 { background color: #330000; color: orange; font-family: impact }
p { font-family: papyrus, sans-serif }
body { background-color: #000033 }
a { text-decoration: none }
b { font-size: 15pt; line-height: 20pt }
p.1 { font-size: 30pt; color: green }
p.2 {
margin-top: -52px;
margin-left: 0px;
color: green;
font-size: 28pt;
font-weight: bold;
}
#test { background-color: #330000; height: 90px }
</style>
</head>
<body>
<div id="test">
<p class="1">New</p>
<p class="2">Account</p>
</div>
</body>
<center><i>To sign up for an account please click the link below and enter your Name, Email address, your desired username and desired password. You should have your new account information emailed to you within 72 hours or sooner.</i></center>
<p>
<br>
<center><a href="mailto:chrisfobian@hotmail.com?subject=NEW Account&body=Please fill in the following information.%0D%0AName:%0D%0AEmail Address:%0D%0ADesired User Name:%0D%0ADesired Password:">-->New Account Click Here<--</a></center>
</html>



Thanks

mlseim
09-07-2006, 02:16 PM
So your page (the <body> part), would look something like this:


<body>
<div id="test">
<p class="1">New</p>
<p class="2">Account</p>
</div>
<center><i>To sign up for an account please click the link below and enter your Name,
Email address, your desired username and desired password. You should have your new
account information emailed to you within 72 hours or sooner.</i></center>

<br>
<form action="register.php" method="post">
<p>Email: <input type="text" name="email" value=""></p>
<p>User Name: <input type="text" name="name" value=""></p>
<p>Password: <input type="text" name="pass" value=""></p>
<p>Re-Enter Password: <input type="text" name="pass2" value=""></p>
<p><input type="submit" name="submit" value="submit"></p>
</form>
</body>
</html>

Then, you would have a PHP script file that is called "register.php" ...
That file would be uploaded into the same directory as your form page.
You need to change a couple of lines ... your email address, and the page
where you want to return to ("redirect") after the email is sent.

Here is what that PHP script (called "register.php") would look like:


<?
#register.php

$redirect = "http://www.yoursite.com/thankyou.html";
$sender = $_POST['email'];
$username = $_POST['name'];
$pass = $_POST['pass'];
$pass2 = $_POST['pass2'];

$toaddr = "chrisfobian@hotmail.com";

$subject = "NEW Account";
$senddate = (date("d M Y h:m:s -0500"));

$message = "

New Account Contact Information
Online Form: $senddate
---------------------------------------------------
Email: $sender

User Name Requested: $username
Password Requested: $pass
Entered Again: $pass2

---------------------------------------------------
";

$extraheaders = "From: $sender\nReply-To: $sender\n\n";

if (! mail($toaddr, $subject, $message, $extraheaders))
echo "Mail did not send for some reason.";

header("Location: ".$redirect);

?>

Vapor
09-07-2006, 05:11 PM
I feel like a dork since I don't know a whole lot about php. But do I take the php code for the register.php and opne notepage, paste it in there and then rename the file to register.php? Or do I put it somewhere else? I tried this, and when I went to test the forum and hit submit, it just displayed all of the php code back to me.

Thanks for the help. Much appreciated!

mlseim
09-07-2006, 06:00 PM
Yes, you paste into Notepad and save-as "register.php"

It's the PHP extension that causes your webhost to execute the file
as a PHP script.

It's possible your webhost doesn't allow PHP, but I can't imagine there are
any hosts left that don't allow it.

Try this little test script (below).
Paste into Notepad, save-as "test.php"


<?php
echo "This is a test <br><br>";
?>


When you go to that URL (www.mysite.com/test.php)
it should only display "This is a test".

Rey
09-07-2006, 07:35 PM
Howdy.

You might try this site (http://www.mals-e.com/intro.php) for an easy to use shopping cart and free tool. I've just read the intro and some of the FAQ...

I came across it I think last year via a newsgrp and remember about it as I'm also looking to incorporate a shopping cart into a site.

Rey

Vapor
09-08-2006, 04:18 PM
ok mlseim,

I made sure that my web server supported php, and I did the php test and it worked! I even tested the forum and it took me to the yoursite.com/thankyou page, but I never received an email in my inbox. I'm a bit confused. Any ideas?

Thanks

mlseim
09-08-2006, 05:29 PM
I tested it on my webhost and it works fine.

The only thing I can think of ....

Check your spam or bulk bin with your email.
Perhaps the filter thought it was spam and didn't
put it in your "in box".

Or, this line is wrong:
$toaddr = "chrisfobian@hotmail.com";

Another thing to try (escape the @ character):
$toaddr = "chrisfobian\@hotmail.com";

Vapor
09-09-2006, 03:49 AM
Hmmm,

It redirects me, but still no email. Do you think a firewall or antivirus could effect this?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum